Converting a roi to image

I am trying to convert a ROI I got from Magic Wand to display as an image. I am able to get the mask but what I need is just an image of the ROI. Are you able to help?

Bruce, Thanks a lot! I have another problem. I am need a 'solid' area/shape to process. Knowing that sometimes magic wand yield an irregular shape, I am using the imaqGetROIBoundingBox function. But I have probs with it. My logic is as follows:
ROI* wandROI;
Rect* RoiRect;
Rect NewRect;
wandROI = imaqMaskToROI (mask, NULL);
imaqGetROIBoundingBox(wandROI, RoiRect);
NewRect = imaqMakeRect(RoiRect->top, RoiRect->left, RoiRect->height, RoiRect->width);
imaqCopyRect (template, image, NewRect,imaqMakePoint(100,100));
imaqDisplayImage (template, 3, 1);
My error comes in line of NewRect: Dereference of Null Pointer.

Similar Messages

  • Creating a PDF from Word 2010 doesn't correctly convert text boxes and images

    I have Acrobat 11 and my co-workers with 9 and 10 can correctly convert Word docs with images and text boxes, but v.11 cuts off the text and doesn't convert images correctly.

    Hi Anubha,
    I tried exporting by printing through the "File" menu as well as using the ribbon menu bar in Word 2010. Results were still not good. Below is the original Word File and then what I got when I tried to export using those two methods. I've also tried running the "Repair Acrobat Installation", but that didn't help.
    -Luke
    Original File
    1. Converting using "File" menu
    2. Converting Using Acrobat Tab in Ribbon in Word 2010

  • How to convert Doc file into image

    hello frnds
                     Can any body guide me how to convert doc file into image and show into swf loader.
    actually i have to convert doc files into swf files in runtime so that i have to use this flow.
    is it possible to convert doc file into byte array and than convert into image.
    Thanks And Regards
        Vineet Osho

    You can convert any DisplayObject to byeArray using this function ImageSnapshot.captureBitmapData().getPixels()

  • Convert mouse position to image position

    Using a zoomed IMAQ image in an image control, I want to recover the position of the mouse in the co-ords of the underlying image. LastMousePositionX (and Y) give the info I want but they are one click in the past and not the current position. Amazingly, there doesn't appear to be an equivalent CurrentMousePositionX. I can't seem to find the info I need to do the conversion manually. The mousedown event returns the current mouse position and I can get the position in the image container by subtracting off its left and top position. But to convert this to the image position I need to know both the zoom and where the images origin is relative to what is displayed. I can't seem to find that origin position in the list of property nodes. The only thing I can seem to come up with is to extract the info from teh image information string, but this seems like an incredibly poor way to extract such obvious information - espeically since the info must be calculated to put in the string anyway. Can anyone help with this?

    Hi,
    I am confused why you get the mouse position one click in the past because it seems to work ok for me. I've had to use four of the image properties to recreate the effect using the mousemove event, but this seems to give the same values as the Last Mouse Position property so I think it does what you want. I couldn't see an origin property so I did the conversion using the position given at the image center. I wanted to post a snippet here but I'm new to posting and couldn't seem to get it to work for the whole block diagram, so I'm using a screenshot instead. I hope this helps in some way.
    Will
    Attachments:
    mouse position test.vi ‏58 KB

  • Convert PDF Page to Image format

    Is there any way to convert PDF page to Image formats (like JPG, GIF...)?
    I am looking in iTextSharp. If there are other options also, please let me know.

    There is a sample included with the Acrobat SDK that shows how to perform conversions of PDFs to other formats. There are also other options available to plug-ins such as PDPageDrawContentsToMemory() and then using an image library of your choice to save the bitmap data into various image formats.
    > I am looking in iTextSharp
    This is the Acrobat SDK forum - for questions regarding coding using the Acrobat SDK. Have you considered asking this in an iTextSharp forum if you are limiting yourself to that product?

  • How do i convert my scanned jpg images into word

    How do i convert my scanned jpg images into word

    No, Acrobat Pro is expensive
    95% of all the professional scanned in books are in PDF, the entire structure and countless years of work have gone into Acrobat being not just the "best" standard for scanned books, but really the ONLY standard for them.
    Yes, many many little programs can convert to PDF after you have them in a file, or even from Safari you can "print as PDF" or "save as PDF"
    however it just saves them as PDF, and you can use Acrobat READER for free,....
    but Reader is just that, a reader, you cannot do pro editing, scale down the file size etc etc, signatures, portfolios etc.
    Ive got a 42 Terabyte collection of PDF books,.....Ive spent too much time staring at PDF books   LoL.

  • How to convert a folder of images to a Collection?

    Ques 1
    How do I convert a folder of images that has been sorted, files rejected, files hidden, and so on, to a Collection? When I create a New Collection and drag the images across from the folder, all editing is lost and the images appear in alphabetical order. I'm using CS6.
    Ques 2
    What is the location of the file that contains the sorted/rejected/hidden data for a folder?

    A Collection is just a saved search.  It does not contain any images.
    Wonder why your question went unanswered for so long?
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    A screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Cannot convert from ImageIcon to Image

    Please tell me why I'm getting error: I have seen many example of this both in this forum and other places.
    Type mismatch: cannot convert from ImageIcon to Image[b]
    Thanks in advance
    here's my code, I m using fileupload to load my images:
    <%@ page import="java.util.List"%>
    <%@ page import="java.util.Iterator"%>
    <%@ page import="java.io.File" %>
    <%@ page import="java.io.IOException"%>
    <%@ page import="java.io.*"%>
    <%@ page import="java.awt.image.ImageFilter"%>
    <%@ page import="java.awt.Color"%>
    <%@ page import="java.awt.image.ImageProducer"%>
    <%@ page import="java.awt.image.ReplicateScaleFilter"%>
    <%@ page import="java.awt.image.FilteredImageSource"%>
    <%@ page import="javax.swing.*"%>
    <%@ page import="java.awt.image.BufferedImage"%>
    <%@ page import="java.awt.Image"%>
    <%@ page import="java.awt.Graphics"%>
    <%@ page import="java.awt.Toolkit"%>
    <%@ page import="com.sun.image.codec.jpeg.JPEGCodec"%>
    <%@ page import="com.sun.image.codec.jpeg.JPEGImageEncoder"%>
    <%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
    <%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
    <%@ page import="org.apache.commons.fileupload.*"%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
       <center><table border="2">
            <tr><td><h1>Your files  uploaded </h1></td></tr>
       <%
        //setting the target w + h
         int targetWidth=0;
        int targetHeight=0;
         //session values used to rename loaded image.
         String adID = "EM225";
         session.setAttribute("adID", adID);
         String fileName = null;
      // String imageid = request.getParameter("imgageID");
         boolean isMultipart = ServletFileUpload.isMultipartContent(request);
         if (!isMultipart) {
         } else {
            FileItemFactory factory = new DiskFileItemFactory();
            ServletFileUpload upload = new ServletFileUpload(factory);
            List items = null;
            try {
                 items = upload.parseRequest(request);
            } catch (FileUploadException e) {
                 System.out.println("Unable to load image" +  e.getMessage());
            Iterator itr = items.iterator();
            while(itr.hasNext()) {
                   FileItem item = (FileItem) itr.next();
                   if (item.isFormField()) {
                        //String name = item.getFieldName();  //This will get the field names. for eg. if u have a hidden field this line will get the hidden filed name.
                    //value = item.getString();
                        //out.println(value);
                   } else {
                 try {
                      File fullFile  = new File(item.getName());
                      fileName = fullFile.getName();
                      String id = (String)session.getAttribute("adID");
                      String newName =  id+fileName;
                      //passing renamed uploaded image.
                      Image sourceImage = new ImageIcon(Toolkit.getDefaultToolkit().getImage(newName));
                      // Calculate the target width and height
                      float scale = 50/100;
                      targetWidth = (int)(sourceImage.getWidth(null)*scale);
                      targetHeight = (int)(sourceImage.getHeight(null)*scale);
                      BufferedImage resizedImage = this.scaleImage(sourceImage,targetWidth,targetHeight);
                      ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(baos);
                      encoder.encode(resizedImage);
                   byte[] b = baos.toByteArray();
                     // File tosave = new File(getServletContext().getRealPath("/"),resizedImage);
                     // item.write(tosave);
                 } catch (Exception e) {
                      System.out.println("Unable to save the image" + e.getMessage());
       %>
       <%!
       private BufferedImage scaleImage(Image sourceImage, int width, int height){
            ImageFilter filter = new ReplicateScaleFilter(width,height);
            ImageProducer producer = new FilteredImageSource
            (sourceImage.getSource(),filter);
            Image resizedImage = Toolkit.getDefaultToolkit().createImage(producer);
            return this.toBufferedImage(resizedImage);
        private BufferedImage toBufferedImage(Image image){
            image = new ImageIcon(image).getImage();
            BufferedImage bufferedImage = new BufferedImage(image.getWidth(null),image.getHeight(null),BufferedImage.TYPE_INT_RGB);
            Graphics g = bufferedImage.createGraphics();
            g.setColor(Color.white);
            g.fillRect(0,0,image.getWidth(null),image.getHeight(null));
            g.drawImage(image,0,0,null);
            g.dispose();
            return bufferedImage;
       %>
        </table>
       </center>
        </table>
       </center>

    Hello. So, it's difficult to say, but the following line is probably the cause of the problem.:
    Image sourceImage = new ImageIcon(Toolkit.getDefaultToolkit().getImage(newName));Basically, you are making an ImageIcon by passing an image, but perhaps you can just replace the line with this:
    Image sourceImage = Toolkit.getDefaultToolkit().getImage(newName);I use ImageIcon when reading from files, such as:
    BufferedImage image = ImageIO.read(file);
    Icon icon = new ImageIcon(image);However, if you already have an Image, I don't see why you just can't just use the Image reference. Perhaps someone more wise will have a more concise answer. Good luck.

  • How to convert HTML text to image

    Hi all!
    I&acute;m having this problem: I have a html code (dynamic generated) and I need to convert it to a image, any idea how to do that?
    Thanks, J.

    Im no Java2D expert but if you want the actual code as an image couldnt you just use 'drawString("<br>", x, y)' to display it and then allow it to be saved as an image, I know theres built in capability in Java to import/export common image formats. Or do you mean you want what the html actually produces as an image?
    Ken

  • What is the easiest way or most direct way to convert an edited raw image to jpeg?

    What is the best way to convert an edited raw image to jpeg?

    After you open the edited raw file from the camera raw dialog using Open, then in photoshop elements use File>Save As>Jpeg

  • Want to convert an array to image in gray scale

    i have an image that i have read into the vi. using the draw unflattened pixmap , i have an array of numbers .after some mathematical computations on the array i should be able to convert the array back to the image. how can i convert from array to image.and then from image to gray scale?

    I am not sure what you are doing. Can you post a simple example program?

  • Convert video file and image file

    Is there a way convert video file to a lot of images?
    Or convert a lot of images to video file? Thanks. Kevin.

    Believe it or not, you actually can do this is Photoshop quite easily, using the Import -> Video Frames to Layers command. There also is a corresponding Export feature that allows you to Render to Video, which can be used to output an image sequence instead of a video file. I think these features were added in CS3, because that is when they added the Animation functionality, but I'm not certain...

  • Can PSE8 for mac convert an 8 bit image to 16 bit?

    can Photoshop Elements 8 for mac convert an 8 bit image to 16 bit?
    I use Photomatix Pro and when I am working with a single image in Photomatix Pro, it has to be 16 bit.

    Yes, you can. These are the steps when using the elements editor.
    Depending on the file format:
    1. If this file is from a camera raw file, simply open the original
        raw file and at the bottom of the camera raw dialog choose 16 bits.
        This would open the file in pse editor as a 16 bit file.
        Then save as a tif file with no compression.
    2. If the file is a jpg or tif file, in the pse editor select: File>Open As>Camera Raw.
        This will open the file in the camera raw dialog. Then select 16 bit from the menu
        at the bottom of the camera raw dialog. After the file opens in pse editor, in 16 bits,
        save as a tif with no compression.
    3. If the file is a psd file with no layers, then step 2 will work. If the psd file has layers,
        open the the file in pse editor and resave the file using maximize compatibilty.
        This will allow the psd file to have both layers and open in the camera raw dialog as
        in step 2. When you open the file in the pse editor, it will just be a single layer and then
        just save as a tif file with no compression.
    Hope this helps.
    MTSTUNER

  • How can I convert an array to image(8bit)

    I can convert an array(acquire from usb camera)to a picture,but not images(8 bit grayscale),how can I do it.many thanks!
    Attachments:
    array to image.vi ‏249 KB

    Sorry, this is the kind of thing that happens when you have been out for too long.
    Message Edité par chilly charly le 10-22-2006 11:09 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    array%20to%20image[1].png ‏3 KB

  • How can i convert a .img disk image to a .dsk disk image?

    I own an intel-iMac running MacOS 10.5.6.
    I own both an Apple //c and Apple System Disk 4.0.2.
    I now have an emulator called Virtual ][.
    I also have a disk image of the Apple System Disk 4.0.2,
    but it is in the .img format. I need it to be in the .dsk
    format so the emulator can "see" the disk and run it.
    How can I convert from .img to .dsk?
    Thanks,
    Apple //GS

    have a look here:
    http://discussions.apple.com/thread.jspa?threadID=246070

Maybe you are looking for