Image to array

Hello
I am trying to imput an image to labview, then convert it to array and then convert the array to spreadsheet string. I was trying to do it using NI example for imagetoarray, but i cant. can you help me with some hints or a sample code please
Thanks
Solved!
Go to Solution.

Hello its very helpful this.
I have attached the code that i am trying to produce. But i dont know how i can connect your code to mine. My code is about transmit string wireless (using zigbee modules). I have checked it and work when i am trying to send characters. How i can connect it to your code in order to select an image preview it convert it to array send this array to another laptop and then convert this image to array and preview it.
Thanks in advance 
Attachments:
Import image-convert array-covert string-transmit-array to image-preview.vi ‏62 KB

Similar Messages

  • Image to array maximum image size

    Hey guys,
    I have a problem with the Image to array VI. I am getting the image from a FL2-20S4M camera from point grey, which has a maximum resolution of 1624x1224 pixels. The image is loaded with IMAQ vision and displayed. I now use image to array to convert the image and display it in an intensity graph. When I set the resolution of IMAQ vision to 800x600 it worked. When I set it to 1624x1224 the image was still displayed, but the intensity graph was empty. Now I set the resolution back to 800x600, but the intensity graph does not work again.
    Is this a known problem or is there a maximum resolution for image to array? How could I fix the problem or at least make it work with 800x600 again?
    Thanks a lot in advance,
    Stefan

    Is the camera a 16bit one?If yes then can you convert it to 8 bits and try?

  • IMAQ image to array vi not working with images extracted from avi file

    Hi,
      I downloaded some avi's and uncompressed them so that I can analyze them within labview. I am trying to convert images I am reading from the avi file to an array. When I use "IMAQ image to array" I get the following error " IMAQ Image To Array  Invalid image type" -1074396080.
       I am able to display each read image and save them to the hard drive, but I am unable to convert the vision image to array. I verified that the image extracted from avi is the same as the image type I created in memory to hold the image.
      Please see the attached vi I created.
    thank you
    Ruz
    Attachments:
    example2.vi ‏62 KB

    Hi all, this thread was useful for me...but i have another doubt... when I try to extract a single plane (Luminance, Saturation, R,G,B...anyone) and try to save it in jpg as gray image, it saves an image with blue tones. I have examinated it using Matlab and checked that Red plane has low values (but not zero), the same for G plane and high values for B plane. An image of the VI is attached.
    Thanks in advance
    Attachments:
    planes.png ‏28 KB

  • How could I plot 2D images or arrays serie to 3D object in LabVIEW?

    Hello, everybody.
    I would like to ask you guys about plotting 2D images or arrays series into a 3D graph or object or any possible.
    If I have serie of 2D arrays (It's 3D). For example, the 3D array contains 500 (z) x [ 500 x 500 (x and y)].
    Could anyone tell me the possible way to do this problem?
    Thank you very much .....
    Racha

    Hi rachacha
    I have been investigating about your question and I realized that we have a document with one example that it use different 2D picture for building a 3D object. I belief it will be useful for you.
    ->>  https://decibel.ni.com/content/docs/DOC-4765
     

  • Image Byte Array - Hex?

    Hi all,
    I'm trying to read in an image and get an int / hex array out of it. Basically, I want to get an array that would look like what you see if you open an image in a hex editor. I have no problems getting a byte array using..
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    ImageIO.write( bufferedImage, "jpg", stream );
    bytes = stream.toByteArray();
    But, it's weird, it's not really what I want. The result is not the same as what I see if I drop the same image into a hex editor and look at the bytes. Not sure if I need to convert the bytes to hex or what. Any help would be much appreciated.

    hmm.. can you explain a bit?.. let's say I do...
    BufferedImage srcImage = ImageIO.read( new File( pathIn ));
    ByteArrayOutputStream streamIn = new ByteArrayOutputStream();
    ImageIO.write( srcImage , "jpg", streamIn );
    byte[] bytes = stream.toByteArray();
    ByteArrayInputStream streamOut = new ByteArrayInputStream( bytes );
    BufferedImage writeImage = ImageIO.read( streamOut );
    ImageIO.write( writeImage, "jpg", new File( pathOut ));Looks a little odd out of context, I know. But, basically, the resulting image is different than the original image. I assume, maybe, there is some sort of compression going on. But i don't really know. Should I be decoding / encoding in specific formats to get the resulting image to be /exactly/ the same as the source?
    thanks

  • Image Byte Array

    How do we get byte array of an image(immutable/mutable) object.I want to save it in RMS tht is why i need to get the image in byte array form.
    I want to send mutable and immutable images through HTTP.Is it possible to do so ??Please Help.
    Thnks in advance.

    Why don't you just try in stead of asking questions. I'm not here to hold you hand on every step. The api docs should provide you with more than enough information to help you on your way. You'll just need to reed that information very well.

  • Images in Arrays

    So I'm sitting with this patch of code I'd like to clean up a bit. Searching has already answered all but one of my questions (of course...). For what it's worth, I'm working with NetBeans.
    This is the current, working code:
    for (int i = 0; i < 5; i++)
        dieNumber[i] = (int)(Math.floor(Math.random()*6)+1);
    ImageIcon dieGif1 = new ImageIcon(Toolkit.getDefaultToolkit().getImage("dice\\die" + dieNumber[0] + ".gif"));
    ImageIcon dieGif2 = new ImageIcon(Toolkit.getDefaultToolkit().getImage("dice\\die" + dieNumber[1] + ".gif"));
    ImageIcon dieGif3 = new ImageIcon(Toolkit.getDefaultToolkit().getImage("dice\\die" + dieNumber[2] + ".gif"));
    ImageIcon dieGif4 = new ImageIcon(Toolkit.getDefaultToolkit().getImage("dice\\die" + dieNumber[3] + ".gif"));
    ImageIcon dieGif5 = new ImageIcon(Toolkit.getDefaultToolkit().getImage("dice\\die" + dieNumber[4] + ".gif"));
    labelDie1.setIcon(dieGif1);
    labelDie2.setIcon(dieGif2);
    labelDie3.setIcon(dieGif3);
    labelDie4.setIcon(dieGif4);
    labelDie5.setIcon(dieGif5);This is how I'd like it to be-ish:
    Image [] dieGif = new Image [5];
    for (int i = 0; i < 5; i++)
        dieNumber[i] = (int)(Math.floor(Math.random()*6)+1);
        dieGif[i] = Toolkit.getDefaultToolkin().getImage("dice\\die" + dieNumber[i+1] + ".gif"));
    labelDie1.setIcon(dieGif[0]);
    labelDie2.setIcon(dieGif[1]);
    labelDie3.setIcon(dieGif[2]);
    labelDie4.setIcon(dieGif[3]);
    labelDie5.setIcon(dieGif[4]);Except that doesn't work, 'cause setIcon() won't work with Image objects, and for some reason I'm unable to create an ImageIcon array. Suggestions for how to fix this?
    Additionally, and completely unrelated, if anybody knows if and how I can store the jLabels in an array (labelDie[]), I'd love to hear that as well. I've seen it done in several code examples but quite frankly don't have the faintest idea of how to do it in NetBeans.

    Jebus, that was fast.
    @DrLaszloJamf: I'll get back to your solution sometime over the weekend, don't know if I have time to look at this again till Saturday.
    @Quacked:ImageIcon [] dieGif = new ImageIcon [5];
    for (int i = 0; i < 5; i++)
        dieNumber[i] = (int)(Math.floor(Math.random()*6)+1);
        dieGif[i] = Toolkit.getDefaultToolkit().getImage("dice\\die" + dieNumber[i+1] + ".gif");
    }Gives me:
    found   : java.awt.Image
    required: javax.swing.ImageIcon
                dieGif[i] = Toolkit.getDefaultToolkit().getImage("dice\\die" + dieNumber[i+1] + ".gif");PS: the first post featured a couple of errors not present in the actual code. That'll teach me to copy/paste instead of typing from memory.

  • Locations of all pixels of image into array...

    In my program, the user clicks on my JPanel and an image of a ball about 15 pixels in diameter appears. The user will then click again to add another ball. I can't allow the new ball to be placed where the balls touch or looked like they intersect.
    If I could get all the pixels associated with the first ball into an array, I could test those x,y coordinates against the new ball's and prevent the user from adding a new ball if they intersect.
    Any ideas? I was looking at pixelgrabber, but that seemed like it was about the color of pixels...

    ok so I understand what you are saying... I know the center pixel of the circle when I out it down... so I have by default, the left, right, top, bottom, and 4 corner pixels of the circle.
    Here's the overall picture though... this is a simple billiards project... So I need to write a test that will return true if one ball can make it past another ball into a a pocket without colliding, and false if the balls with hit each other. Thats why I figured I would need all the pixels of each ball in an array to test against, or at least every pixel on its circumference... this is where I get really confused...
    This is what I'm thinking if I can just extract this info: (psydocode)
    Ball ball1 = new Ball(x,y); //class Ball will also contain the array of pixels
    Ball ball2 = new Ball(x,y);
    private boolean shotTest(Ball ball1, Ball ball2)
         int [] array1 = ball1.getArray();
         int [] array2 = ball2.getArray();
         for(int i=0, i<array1.length(); i++)
              for(int j=0; j<array2.length(); j++)
                   if(*straight line from array1[i] to pocket hits array2[j])
                        return false;
         return true;
    }...is that a start?

  • Terminal images for arrays on block diagram

    I had always know that the thickness of the wire is representative of the size of the array on the block diagram (Thin wire, scalar, thicker wires, larger dimension arrays)
    I never noticed before that the terminal on the block diagram contained the [ ] symbols to indicate it is an array.  But also, the larger the dimension of the array, the thicker the brackets are, up to about 5-D.  (Probably because I rarely need a 3-D array, and large than isn't any practical, logical reason for a 4-D or larger array.)
    However, looking at the image of the terminal, the shaded area containing the outgoing or incoming triangle actually obscures one bracket or the other.
    While I wouldn't want the terminal to get any larger (which is why I don't like the icon view, it is way too large), it seems like the terminal should show both the opening and closing brackets to indicate an array rather than obscuring one.
    Any comments?
    Message Edited by Ravens Fan on 08-22-2009 12:59 AM
    Attachments:
    Example_VI_BD.png ‏3 KB

    Definitely keep the arrows. They are what tell me the direction of the terminals.
    As I was saying in another post, there is nothing intuitive about the thick border/thin border differences to tell whether the terminal is a source or sink. I like that they are a bit different, but if you put them side by side with no wires and no arrows, I couldn't tell you which was which.
    As for array size, as Christian says, if I want to know the type/dimensions of the array, I'll use context help. I just thought it was interesting (and I had never noticed it before) that the array size was encoded in the image as well.
    I myself wouldn't mind if the terminal grew 2 or 4 pixels wider, but I can completely understand how it would bother a lot of people.
    I think in the current image, too much is obscured by the arrow and its background, even for the scalar type. Actually, why is there a light background behind the arrow at all. That is the real source of the problem. Eliminate the background, and move the arrow over to the edge, and you can see everything without extra shading and without causing the terminal to grow.
    See below:
    1. Terminal size maintained.
    2. Direction arrow maintained, just slightly moved.
    3. Goofy shaded background removed.
    Message Edited by Ravens Fan on 08-22-2009 09:48 PM
    Attachments:
    terminals3.png ‏5 KB

  • Image in Array to background of mc

    So.  Managed to get past my last issue and now when the xml file of images is loaded, I place each image into an element of an Array so I can handle them individually.  Problem I am having now is this.  When image at element 1 is pressed, it should become one of my movie clips background.  I am using some code I was using in as3, when the image wasnt in an Array, and it worked fine.  Now I am in AS2, and the image is in an Array, it doesnt seem to work.  Additionally, I get no errors whatsoever.  The code for this is
    picHolder[1].onPress = function() {
              picHolder[1].width = card.width;
              picHolder[1].height = card.height;
              picHolder[1].x = 0;
              picHolder[1].y = 0;
              card.addChild(picHolder[1]);
    Whereby picHolder[1] is an image, and card is my movie clip.  If I do picHolder[1].startDrag(true), I can pick up and drag the image.  So, I know I am dealing with the correct image here.  Should I be doing the above differently when working with an Array?
    Cheers

    Ok, what I am doing now is in AS2.  So, I know that
    function thumbClickable():Void {
         picHolder[1].onPress = function() {
    Is AS2, so what I have done inside of it must be AS3.  So, what would the inside look like in AS2?  I cant really see how this could be much different.
    cheers

  • IMAQ: "image to array" directly wired to "array to image" seems to have a pb with U16

    Hello.
    I am using the two VIs "ImageToArray" (ITA) and "ArrayToImage" (ATI) to do some image processing, and I've noticed something strange I'd like to share with you.
    I am acquiring 16bits data from a GiGe camera. If I wire the output image of the camera to the ITA VI, and then I wire the output of ITA directly to the input of ATI, I cannot get the image back!
    Look at the files I attached. Image2 should simply show the same picture as Image1, shouldn't it...? But it doesn't!
    Did I miss something, maybe...?
    Does anyone has an explanation/solution?
    (If it might be of any importance, please note that the camera dynamic is 12 bits. But I don't think that would change anything if it was 16 "full" bits...)
    For your information, if I try to do exactly the same with 8 bits data, then it works perfectly fine. Only when the camera returns 16 bits data si there a pb.
    Best regards.
    Luc
    Solved!
    Go to Solution.
    Attachments:
    ImageToArrayToImage_Diagram.png ‏3 KB
    ImageToArrayToImage_Front.png ‏194 KB

    I think, your camera deliver I16 image, but you using U16 - therefore array is empty and you see nothing.
    Try to use I16 instead:
    (and check all your image's types and control error outputs)
    Andrey.

  • Convert jpg image to array of integers and store in file

    For a project that I am working on I need to be able to take the black and white jpg images that I am using and convert each pixel into either a -1 or +1 according to if the pixel color is white or black. Then, once I have an array of those values, I need to store the array to a file. Can this be done? Can PixelGrabber accomplish this task? Thanks in advance!
    Keith Pemberton

    Yes
    PixelGrabber pg = new PixelGrabber(myImage, 0, 0, width, height, pixels, 0, width);

  • Construct image from Array of pixels

    Here's my problem:
    I've managed to call the pixelgrabber method on an image, so i've got a 1d array of pixels. Now i want to use that array to create the image within the internal frame so that the image can be changed quickly when the contents of the array change. I was wondering whether using the paint method and mofiying it in some way is the way to go, or is there a much better way to do it?

    i'm guessing that no one knows an answer?Bad guess. I know the answer.
    The solution lays in the correct use of the following classes:
    BufferedImage
    WritableRaster
    DataBuffer
    SampleModel
    ColorModel
    It goes something like this:
    1) Wrap a raw array (probably bytes or ints) in a DataBuffer.
    2) Create a SampleModel that describes the layout of the raw data.
    3) Now create a WritableRaster that wraps the DataBuffer and SampleModel
    4) Create a ColorModel that describes how the raw data maps to the color of a pixel.
    5) A BufferedImage can be created from the WritableRaster and the ColorModel.
    Drawing operations on the BufferedImage's Graphics2D objects will be reflected in the raw data array. And modifications to the raw data array will be shown when the BufferedImage is drawn onto other Graphics.

  • Save image in array

    hello...
    im doing j2me application that can download an image using a servlet in server...the image i save it in array for temporary usage... i got one problem...when i install the .jar/.jad in hp...the application sometimes can only download one or two image...but using emulator...i can download it many times...each image size is about 100k-140k...why is this happen?...does the image that i save it in the array will affect the size of my .jar/.jad?....actually when we download the image...where does the the midlet put the downloaded image...in the hp memory or in .jar/.jad?...

    Much like any other array. Each image will be a 2D array. Without knowing exactly how you are acquiring your images or what type of images they are you can convert them to arrays using IMAQ imagetoarray or IMAQ colorimagetoarray. Each frame will be a page element of a 3D array. When you want to review these images simply convert the arrays back to images, selecting the frame as a page from your 3D array.
    PaulG.
    "I enjoy talking to you. Your mind appeals to me. It resembles my own mind except that you happen to be insane." -- George Orwell

  • How can i load or put an image into array of pixels?

    i am doing my undergraduate project , i am using java , mainly the project works in image manipulating or it is image relevant , few days ago i stucked in a little problem , my problem is that i want to put an image scanned from scanner into array or anything ( that makes me reach my goal which is go to specific locations in the image to gather the pixel colour on that location ) , for my project that's so critical to complete the job so , now am trying buffered image but i think it will be significant if i find another way to help , even it isn't in java i heared that matlab has such tools & libraries to help
    thanks .....
    looking forward to hearing from you guys
    Note : My project is java based .

    Check out the PixelGrabber class: http://java.sun.com/j2se/1.5.0/docs/api/java/awt/image/PixelGrabber.html
    It's pretty simple to get an array of Color objects - or you could just leave it as an int array - though it can be somewhat slow.
    //img - Your img
    int[] pix=new int[img.getWidth(null)*img.getHeight(null)];
    PixelGrabber grab=new PixelGrabber(img,0,0,img.getWidth(null),img.getHeight(null),pix,0,img.getWidth(null));
    grab.grabPixels();  //Blocks, you could use startGrabbing() for asynchronous stuff
    Color[] colors=new Color[pix.length];
    for(int in1=0;in1<colors.length;in1++){
    colors[in1]=new Color(pix[in1],true);  //Use false to ignore Alpha channel
    }//for
    //Colors now contains a Color object for every pixel in the image//Mind you, I haven't compiled this so there could be errors; but I've used essentially the same code many times with few difficulties.

Maybe you are looking for

  • Taking ownership of a drive, to access it externally.

    I have an Ideapad running Windows 7.   Last week I started getting a "disk read error, please press ctrl + alt + del to reboot"  (or something like that).  When inquiring about the error, I was told that I need to do a factory reset.   However, befor

  • Attachments are not sent correctly?

    When I send an email with an attachment, the recipient does not receive the attachment; even though I use the "send windows friendly attachments". This happens very often, specially when the recipient is a PC and uses any of the following servers: ho

  • Apple TV - Purchasing and renting movies / videos in Austria

    I want to buy an Apple TV in the next days, but today I saw, that it is not possible in my region (Austria) to rent or buy movies in iTunes yet. So I'm afraid it would make no sense to buy the Apple TV. Does anybody know, until when movies will be av

  • Problem with access sequence display  in pricing Analysis:

    Hi We have a situation that seems to occur for a specific customer/material combination where there are missing key combinations in the pricing analysis screen.  In some instances, we will have 10 key combination for a condition type, but only the fi

  • Converting GB files to mp3

    i am trying to convert my garageband songs into mp3 format. currently, when i export my GB files to iTunes, it keeps them as AIFF files, which i can't work with. any suggestions?