Binary 2D image array

I'm lookking for a solution for this problem: I have a binary 2D array of an image. Now I want to search for and count all "1" (= high) values in the 2D array. Please help me to solve this problem. Thx.

I don't know what a "binary image array" is, but if you mean a 2D boolean array, you can wire it into Boolean to (0,1) and wire the output of that into Add Array elements (Boolean and Numeric palettes).
If that doesn't help, you should post your VI so we can see what your array looks like.
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
Try to take over the world!

Similar Messages

  • Transform jpeg image to binary coded image

    how to transform jpeg image to binary coded image? using which properties? thanks .

    well, I dont think so. but what exactly do you need, transforming it into bits or bytes?
    well, I have no time to do the program for you, but this is the idea:
    FileInputStream inputF=null;
    File imageF;
    byte content [];
    try {
        imageF=new File ("The image path");
        content=new byte [(int) imageF.length ()];
        inputF=new FIleInputStream ("the image path");
        inputF.read (content);
    } catch (Exception E) {
    }and thats all to have a byte array with the bytes of the image.

  • Please Help!-Problem using Image[ ] array

    Hi everyone,
    I have this real confusing bug in my code which i am not able to fix.
    Image[] tmpImg = new Image[Img.size()];   /initializing an image array tmpImg
                for(int i=0; i<Img.size(); i++) {          //i require this display the image a number of times
                try{
                       icon = Image.createImage("/Icon.png");
                       im = new ImageItem("Image", icon,ImageItem.LAYOUT_CENTER,"image"); //using a imageItem to display the image in a form
                       form.append(im);
                       icon2 = Image.createImage("/Icon2.png");
                           im2 = new ImageItem("Image2",icon2,ImageItem.LAYOUT_CENTER,"image"); //using another imageItem to display the second image
                      form.append(im2);
                       if (imageValue.elementAt(i) == "availableImage") {
                           tmpImg[i] = icon;  //assigning the value to the image array based on a condition from a String Vector
                      if (imageValue.elementAt(i) == "offlineImage") {
         tmpImg[i] = icon2;   //assigning the value to the image array based on a condition from a String Vector
                      } catch(IOException err) {}
           System.out.println(tmpImg[0]);
           System.out.println(tmpImg[1]);
           System.out.println(tmpImg[2]);
           System.out.println(tmpImg[3]);
           return tmpImg;
       }My problem is that when i try to print tmpImg[0], tmpImg[1] etc all the values are printed null. But the Image is created and being displayed on a ImageItem. but i am not able to assign the image to the image array 'tmpImg' which is within an if condition.
    Can anyone tell me why is this so. I would be grateful
    Thank You

    Thank u deepspace
    I got a lil' frustrated, so completely did not think that way. The code is working now
    Thanx again

  • Piv to Image Array

    I have a program on my computer called Pivot Stickfigure Animator which I use to make graphics. Is there a way to read a Pivot file into an Image Array?

    compdude wrote:
    It exports animated gifs. Can I convert it to image array?Here's some code I wrote in 2004: [http://forum.java.sun.com/thread.jspa?threadID=425360&start=17]
    I'm sure there are 3rd party libraries to help you do this, but I don't know of any other way to do it in the J2SE API.

  • Read Binary(raw Image) data from a file

    Hi
    PLEASE HELP, I want to Read Binary(Raw Image)data (16 bit integer) from a file and display on the JPanel or JFrame.

    Hi, you'll need to use MemoryImageSource.
    You read each RGB triple and add it to a pixel[].
    Heres the roughg idea.
    Hope that helps.
    Harley.
    int width,height;
    int[] pixels = new int[width*height];
    while(!fileDone)
    for(int i=0; i<(width*height) i++){
    int rgb = inputStream.readInt();
    pixels[i] = rgb;
    DirectColorModel colorModel = new DirectColorModel(16,0xff00,0x00ff,0x00ff);
    MemoryImageSource memImage = new MemoryImageSource(width,height,pixels,0,width));

  • 32 Bit Image to Image Array

    I am attempting to get an image array from a 32 Bit image.  I
    attempted to use IMAQ ImageToArray.  This did not work when
    passing in a 32bit RGB image.  It works fine after I convert the
    image to 8 or 16 bit image, but this is a step I am attempting to
    remove.  So, my main questions is there a way to get an Array of
    an image directly from a 32 Bit Image?

    In the Color Utilities there is a function called IMAQ Color Image to
    Array.  That is the one you want to use.  Hopefully you have the Vision
    Development module or you may not have access to this vi.
    Randall Pursley

  • Need Help Creating Image Array

    Hello,
    I am a newbie at Flex 2 and I am working on this site that
    needs an image array consisting of 5 images. The ideal thought
    would be for the images to load into an HBox I created as a holding
    place and have the images change every 5 seconds or so. I have
    looked around the forums and the internet but I have yet to find
    anything. If anyone can please help me on this I would greatly
    appreciate it.
    Regards,
    Jose

    If you've done what I think you have, then I may have tried something similar.
    I tried creating a BufferedImage in a JPanel, basing the size of the BufferedImage on the size of the JPanel in the constructor, but when the JPanel was created, it tried to set up the image before resizing the JPanel i.e. the BufferedImage size was set to (0,0) and that threw an IllegalArgumentException at runtime. I found that I had to declare variables for an initial image size, then optionally change the image size later.
    Hope that helps.

  • Image array

    How can I put three jpgs in an Image array declared as follows:
    Image[] images; is this an array?
    can I do somewthing like that:
    i am getting the names of the images from a command line argument.
    if user types ShowPic house jpg 2
    I want to put in the array house0.jpg and house1.jpg
    Images[] images;
    public ShowPic(String image, String type, int num)
              for (int i=0;i<num;i++)
              images[i] =tKit.createImage(image+i+"."+type);
    public static void main(String[] args)
              ShowPic showPic = new ShowPic(args[0],args[1], Integer.parseInt(args[2]));

    here you go!
    import java.awt.Image;
    import java.awt.Toolkit;
    import java.awt.Graphics;
    import java.awt.Color;
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    import java.awt.image.*;
    public class ShowPic extends JFrame implements Runnable{
         Image[] images;
         int current_image=0;
         int maxNumber;
         Toolkit tKit = Toolkit.getDefaultToolkit();
         Thread th;
         Graphics g;
         JPanel panel;
         public ShowPic(String image, String type, int num)     {
              panel=new JPanel();
              panel.setSize(getWidth(),getHeight());
              maxNumber=num;
              images = new Image[maxNumber];
              for (int i=0;i<maxNumber;i++)          {
                   images=tKit.getImage(image+String.valueOf(i)+"."+type);
                   System.out.println(image+String.valueOf(i)+"."+type+" added");
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.setSize(500,500);
              this.setContentPane(panel);
              this.setVisible(true);
              th = new Thread (this);
              th.start ();
         public static void main(String[] args)     {
                   try          {
                        System.out.println(args[0]+" "+args[1]+" "+(Integer.parseInt(args[2])));
                        ShowPic showPic = new ShowPic(args[0],args[1], Integer.parseInt(args[2]));
                   }          catch (NullPointerException e)          {
                        System.out.println("Something is wrong!");
         public void run()          {
              while (true) {
                   System.out.println("Thread is true - animate");
                   animate(g);
                   try               {
                        Thread.sleep(100);
                   }catch (InterruptedException e)               {
                        System.out.println(e);
         }//end of method
         public void animate(Graphics g){
              if ( current_image == maxNumber-1){
                   current_image=0;
              }else{
                   current_image++;
              paint(g);
         public void paint(Graphics g)     {
              if(g == null){
                   g=panel.getGraphics();
              g.setColor(Color.WHITE);
              g.fillRect(0, 0, getWidth(), getHeight());
              g.setColor(Color.BLACK);
              g.drawString(""+current_image,10,10);
              g.drawImage(images[current_image],10,10, this);

  • Problem displaying binary tif image from rfc

    Hello All,
    I am trying to display an image that is returned from RFC as binary image
    <b><u>Context description:</u></b>
    Context Node From RFC -  Out_Et_Image node type tbl1024
    Node element Line
    As I understand the node is representing a byte array and each Line element i a part of the array .
    <b><u><i>i did</i></u></b>
    <b>1. merge it into one byte array :</b>
    int ArrayTot = 0 ;
    for ( i =0;i<wdContext.nodeOut_Et_Image().size();i++){
         ArrayTot = ArrayTot+wdContext.nodeOut_Et_Image().getOut_Et_ImageElementAt(i).getLine().length     ;
         final byte[] pictureContentTemp1 = new byte[ArrayTot];
         for ( i =0;i<wdContext.nodeOut_Et_Image().size();i++){
              if(i>0){
                   j=j+wdContext.nodeOut_Et_Image().getOut_Et_ImageElementAt(i-1).getLine().length;
                   System.arraycopy(wdContext.nodeOut_Et_Image().getOut_Et_ImageElementAt(i).getLine(),0,
                        pictureContentTemp1,0,wdContext.nodeOut_Et_Image().getOut_Et_ImageElementAt(i).getLine().length     );
              }else{
                   j=wdContext.nodeOut_Et_Image().getOut_Et_ImageElementAt(i).getLine().length;
                   System.arraycopy(wdContext.nodeOut_Et_Image().getOut_Et_ImageElementAt(i).getLine(),0,
                                       pictureContentTemp1,j,wdContext.nodeOut_Et_Image().getOut_Et_ImageElementAt(i).getLine().length     );
    <u><b>2. using the IWDCachedWebResource to generate and display it</b></u>
    IWDCachedWebResource resource = WDWebResource.getWebResource
    (pictureContentTemp1,
    WDWebResourceType.GIF_IMAGE);
    resource.setResourceName("pic");
    try{
    IWDWindow window = wdComponentAPI.getWindowManager().
    createExternalWindow(resource.getURL(), "gggg", true);
    // Eliminate some features of the window
    window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    window.removeWindowFeature(WDWindowFeature.MENU_BAR);
    window.removeWindowFeature(WDWindowFeature.STATUS_BAR);
    window.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    window.setWindowSize(780,430);
    window.setWindowPosition(20,140);
    window.open();
    }catch (Exception e){
         wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(),false);
    The problem is that I get a corrupted file and i cant see or open it .
    Some more details:
    The original image size is 42,234 bytes
    i get from the RFC after merging the array 43,008 bytes i think that the extra bytes that a get are the problem , but i don't have any idea how to get rid of them or solve the problem .
    My WAS version is nw04 sp19
    Does any one encounter this problem? Or can guide me what to do?
    Thanks
    Ronen

    Try this VI (It's from "Image Acquisition and Processing with LabVIEW" - see for more details...
    cheers,
    Christopher
    Christopher G. Relf
    Certified LabVIEW Developer
    [email protected]
    International Voicemail & Fax: +61 2 8080 8132
    Australian Voicemail & Fax: (02) 8080 8132
    EULA
    1) This is a private email, and although the views expressed within it may not be purely my own, unless specifically referenced I do not suggest they are necessarily associated with anyone else including, but not limited to, my employer(s).
    2) This email has NOT been scanned for virii - attached file(s), if any, are provided as is. By copying, detaching and/or opening attached file
    s, you agree to indemnify the sender of such responsibility.
    3) Because e-mail can be altered electronically, the integrity of this communication cannot be guaranteed.
    >
    Copyright © 2004-2015 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.
    Attachments:
    Image_Browser-Selector_Example.llb ‏107 KB

  • Get binary from image

    I'm trying to get the binary pattern from an image and store it byte by byte, so i can manipulate it.
    Any help on how i would go about doing this would be greatfully recieved.
    Perhaps a url to some relevant material would be nice. Thought I'd come to the guys who know about this sort of thing.
    Thanks
    Fraser

    try {
                int[] pixels = new int[width * height];
                PixelGrabber pg = new PixelGrabber(img, 0, 0, width, height, pixels, 0, width);
                pg.grabPixels();
                return pixels;
            } catch (InterruptedException ie) { return null; }This code is an example using a pixel grabber to retrieve an array of int values, each representing pixel data.
    int values are 32 bit, but the pixel data should only encompass the first 8 bits of each int.
    You can't cast the int to a byte because it will chop off the bits from the other end leaving you with a byte full of 0's and a black image.
    To convert these ints to bytes you can use bitwise operators to chop off the leading 0 bits and then build a byte array with your image data.

  • How do i convert a picture back to a image array and extract the coulor table.

    Been trying to do so for the past 2 weeks and the folks at NI India also are unable to support me. please help. I am on labview 6.1
    Ankur

    I suppose that you are talking about a LV picture.
    My opinion is that LV 6 was an absolute pity for picture management. LV 7 is only a pity.
    Your problem could be solved in a breath using a few of the IMAQ vision tools. Unfortunately, NI has decided to keep separated its image management tools from its graphic development environment. I think that this situation should be discussed...
    With LV 6, there is probably a solution that use the Flatten to String function, convert the string to a 1D-array of bytes, remove the 32 bytes or so the Flatten function has added before the actual picture bytes, then reshape the array according to the initial picture size. I have done that in the past for a 8byte picture. Not sure if it is as simple for a colored picture. Not sure either if I'll have some time to spare on the problem today.
    Hope you will find here some more constructive help !
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Binary File to Array

    I need to choose a file with a file chooser and then convert it to an array.  The file is a binary file and I just want every byte out of it as an element in a very large byte array.  Im not quite sure how to go about this, can someone who has done this or knows how guide me in the right direction?
    When I run the enclosed vi it acts as if the file is not 512 bytes big and says that an EOF has been reached.  Im sure Im just doing it plain wrong tho .
    The zip contains two of the files I wish to read in as well as my poor attempt to read the file into a byte array. The vi has two main problems:
    1) It doesn't work
    2) It doesn't take into account variably sized files
    Thanks
    Cason Clagg
    SwRI
    LabView 7.1, Windows XP
    Attachments:
    FileOpen.zip ‏12 KB

    (1) You wire a byte stream type of I32, meaning you read 4x as many bytes as intended.
    --> solution: right click in the type constant and select Representation:U8.
    (2) You can get the actual file size e.g. with the eof function.
    See attached modification (LabVIEW7.1).
    ... and don't forget to close the file when done
    Message Edited by altenbach on 07-21-2005 06:16 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    OpenFileMOD.vi ‏24 KB

  • FM to convert binary to image

    Hi All,
    Does anyone know any function module to convert 'image binary data' back to 'image' (bmp, jpeg..etc) format?
    I appreciate any help.
    Regards.
    Edited by: mike curtis on Aug 12, 2010 9:10 PM

    hello  mike .
    I am facing with the similar problem that u have faced .  I am very happy to see that your question has been answered.
    Conversion of binary data into photo in sap.  the binary data is of the same type as u faced , but still i am sending the data
    FFD8FFE000104A46494600010101006000600000FFDB004300080606070605080707070909080A0C140D0C0B0B0C1912130F141D1A1F1E1D1A1C1C20242E2720
    this data i need to convert into image (or)  photo.
    could you please help me in finding the solution for it. i will be very thankful and will be waiting for ur reply.
    thanks in advance.

  • Image array applet freezes

    I'm using a modified version of Romain Guy's music shelf (http://www.curious-creature.org/2005/07/09/a-music-shelf-in-java2d/), using it as an applet in an extension for a mozilla based media player.
    In order to allow decent performance I'm using a proxy pattern, so the images are not actually loaded until they're needed. All the proxies are stored in a simply java array at startup. When more than 100 of the proxies have loaded their image, the whole thing slows down, and when 113 (exactly and always) have loaded, the applet freezes completely.
    Anyone got any idea why this might be happening?? There's plenty of memory left and the applet is run localy so it shouldn't be security probem either.

    Nevermind..... a classic case of RTFM. I might have enough memory, but java only has 64mb....

  • Image Array , GUI Issue

    I am currently trying to insert a 20X20 image a specific spot on an array spot[X][Y], but do not know how to get them in the array.
    Can anyone help me?
    I am using JPanel and want the images to be displayed within the GUI.

    AWebster wrote:
    How would i be able to do this? By reading the Sun Swing tutorials JLabel section and by playing with JLabels and ImageIcons first before trying to incorporating them into your main application.
    And sorry im a Beginner, but would this mean i would have to make 100 separate JLabels to fill the 10X10 grid for the array?Yes, you'd have to make 100 JLabel objects, but not 100 separate JLabel variables as all the JLabel objects would be held in a single 10 by 10 array.
    Is this a memory game application?

Maybe you are looking for

  • "Firefox is already running" error while opening a Firefox Document

    I am a web developer, so I decided to have different versions of Firefox in order to test my web pages. Thus I decided to install Firefox 3.6 in "C:\Archivos de programa\Mozilla Firefox\Firefox 3.6", Firefox 4 in "C:\Archivos de programa\Mozilla Fire

  • Cannot upgrade the firmware.

    I am using a BEFW11S4 router Version 4. When I checked the site and after a full day of messing around I found that the problem I was having was covered in the latest update. I downloaded the bin file and tried the upgrade process from the router man

  • When I send RAW file to PS, the LR edits are ignored

    Hi, I wonder if someone might have had this issue and could help me to solve it. When I send a RAW file to PS for further edit, the edits made in LR are ignored. This started to happen randomly, and now it's becoming the rule. If I send the same file

  • Passwords and Mails, newbie

    It's my new BlackBerry, and I'm really bad in all the things related to technology. I would lik eto know what to do about the authorisations. The mobile asked me about a PIN, which I already know, an email, and a password. I should need this to get o

  • Show date and time but hide seconds

    In grid view I like having the date and time shown on each slide but I find seeing the seconds a distraction. Does anyone know of a way to display the hours and minutes but NOT seconds? THANKS