Pixel to array conversion (Vision toolkit)

Hello everybody,
I'm writing a vi to read out a CCD camera. I'd like to visualize the read out image converting one of its axis from pixels to other units (namely nm). I managed to do that by visualizing the image on an intensity graph creating accordingly a property node for the axis I wanted to convert . Is there a way to do this, so basically to convert one of the axis from pixels to a given array of values, using the vision toolkit?
Many thanks.

Hello,
Thanks for the reply.
The problem I've got to solve is the following. I have to read out a CCD camera. The light reaching the CCD is dispersed by a spectrometer. I know the algorithm to determine the correspondance between a given pixel of the camera and the wavelength of the light dispersed by the monochromator and reaching that pixel. I wrote a small VI (please find it attached) to obtain an array of values of wavelengths corresponding to each pixels, basically I can use the output of this small VI to know which are the minimum and maximum values of wavelength (in nm) displayed on the CCD camera and the increment in wavelength (in nm) correspondng to each pixel.  So if I display the read-out image using an intensity graph, I can use those values to create a property node for one axis of the graph and have it converted in the units I want (namely nm).
Now my question is: is there a way I can do the same using the output of my small conversion VI and one of the displaying options of the vision toolkit? The bottom line is: I'd like to use the vision toolkit vis instead than the intensity graph to display my images.
I hope my question is a bit clearer than before.
Many thanks for the help.
Cheers
Attachments:
Pixel2nm.vi ‏12 KB

Similar Messages

  • String to 2D string array conversion

    Hi,
    I have a string like this below. I would like to extract all the texts within the quotes "  ". How to do that?.
    05-Mar.20:52   skalyana    label type "BASELINE_1.2" (locked)
    28-Apr.19:19   skalyana    label type "BASELINE_1.8"
    i have tried using Match regular expression. I am able to extract one text within " ".
    I would like to know how to extract all the text within " "
    I have attached the vi for your reference
    Thanks
    Kalyan
    Attachments:
    string to 2D string array conversion.vi ‏19 KB

    Hi Jim,
    its simply superb...
    how to get more info on these 'Regular Expressions', is there any KB (knowledge base) or tutorial available for the same.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • NI VISION toolkit v6.1

    hello
    I've bought and use NI VISION toolkit v6.1 by labview v7.0 but there is a problem to use it in labview v7.1 and v8.2.1
    do you have any experience about this problem?
    thanks for demonstration

    I wouldn't be too upset about needing to upgrade, the versions after V6 are a lot easier to use...
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Pixels to mm conversion help needed!

    Hi.. it's a long shot, but I am constructing a dummy web page... and need to figure out how to take 1000 pixels and convert to a mm or cm box to do a design in.
    Does anyone know how to do that... as web designers say they need a 1000 pixel wide page!
    I cant seem to find a conversion tool that gives just measurements...
    any help appreciated....
    as in iweb i just set it but cant find it in cm either!

    It depends on the dpi. Usually 72dpi = 72 pixels per inch.
    1000/72 = 13,88888 inch
    1 inch = 25,4 mm
    13,88888 * 25,4 = 352,7777 mm
    You do the arithmatic with a calculator.
    To do the same with pictures, you can do it in any image editor. Even Preview.app :
    !http://www.wyodor.net/_Discussions/PreviewResize.png!

  • Dynamically controling the size (in pixels) of array elements?

    Hey Everyone,
    I am writing a large vi where front panel space is becoming a limitation.   One of the elements that I want to display is a 2-D array of boolean indicators (rectangular LEDs).  Is there any way to dynamically resize the elements in the array so that regardless of the number of elements, the entire array is always visible and has a constant footprint.  For example, say the array is 8 x 8 elements, and takes up 160x160 pixels on the front panel so each element is roughly 20x20 pixels.  Then the number of elements shifts to 4x4.  I want the display to stay 160x160 pixels, but the size of each element to double to 40x40 pixels.  Is this possible?
    Thanks all,
    Matt
    Solved!
    Go to Solution.

    So thank you for two great ideas/examples.  Definitely think I have a couple of very workable approaches.  I have a follow on question about using the intensity graph approach.
    First some background.  This indicator is going to show the progress of a sorting operation, 1-4 copies of 1-8 unique items are being sorted into 1-32 containers.  The items arrive at the sorter in random order, are identified, and then placed into the container where they are still needed.  The point of this indicator is to show the user, at a glance, how full each container is andwhich componenets are missing.  I want the elements (columns) to appear different for the unique items, which I know you can't do in an array of booleans.  So I had already dumped the boolean approach for an array of colorboxes, and it was the color boxes that I was trying to dynamically size. There is still a boolean array to keep track of if an item has arrived, but that array drives the array of colorboxes where each type of item is color coded by assigning a gray value to colorbox for false, and a particular color if true.  See attached, which works pretty well (detailed adjusts will make it just right).
    I think the intensity graph will look much nicer though, so here is the question:
    How do I map the different colors onto the intensity graph so it looks like the colorbox array without the lines?  The attached get vi puts out a different value for each yes/no, which is to say I already know how to take the boolean and convert the 1 state to a unique number, what I don't know how to do is map that number into a particular color on the intensity graph.
    Thanks guys.
    Super helpful as always!
    Matt
    Attachments:
    Puzzle_MM.vi ‏42 KB

  • Document to array conversion

    Hi all,
    i'm new to java and i would like to ask if there is some kind of command that would allow me to convert a document containing strings & numbers & characters(!,',-,=) into an array.
    For example:
    the file "test.txt" conatins the following text:
    "Hello world. Today is 15-August."
    I would an array to be created containing {"Hello" ,"world", ".", "Today", "is", "15", "-","August"}.
    Is there such a command?
    I know how to input text files, edit them and/or create text files using java but i all i need is that command for the conversion.
    Cheers!

    You can use the String.split method but this won't
    give you the . and - as elements in the
    array.
            String data = "Hello world. Today is 15-August.";
            String[] splitData = data.split("\\s+|(?<=[-.])|(?=[-.])");

  • Video Conversion: Vision M - Ipod with vi

    A word to forum visitors who are considering purchasing a Creative Vision:M instead of an Ipod with video (5th gen):
    The capability of the Vision:M to handle multiple video formats is not really an advantage over the Ipod with video, because the Vision:M is very picky about what bitrates/framerates/encoder is used to make each video file. Even if the video format is "supported", most likely the settings used to encode the file are incompatible with the Vision:M, so all your videos will probably have to be converted anyway, which takes FOREVER...
    My point is this - If you think getting a Vision:M will save you time from converting to a format compatible with an Ipod, you're WRONG... you're probably going to convert the files anyway because the Vision:M will only take specific setting ranges. Also, iTunes offers many videos that are perfectly compatible with ipods for a very low price ($2!), that DON'T require conversion. While there are many reasons to get a Vision:M over an ipod, you should think twice about video formats.

    not true. I have been using my Creative Vision M all summer to watch tv shows that I get through P2P sites. I was amazed at how easily I could transfer these variety of files (in many different formats - Xvid, Divx, etc) to my Vision M in a matter of minutes with no need for further conversion.
    It is a lot of fun to either watch these tv shows on the go or use my av cable (a standard one - I just leave it out one click -- a tip that I read on the internet) to watch them on my tv. Out of the many video files I have used, I have only come across two instances of needing conversion -- once for a tv episode that someone encoded in a window size (like 900 X 300) that was very unusual for downloading and once for a video format that turn out to not be supported.
    BUT OVERALL when Zen Vision M advertises that it can handle many video formats without further conversion, especially with tv/video files people get from P2P sites, IT IS 00&#37; TRUE.
    To be fair, P2P downloading is legal but you have to be careful on not downloading copyrighted content and further distributing it. So buying stuff from apple's sites is a guaranteed safe route that also guarantees to play easily on one's video ipod.
    Sorry for the long post -- I would have loved to read a review where someone told me that the Vision M plays just about any P2P video file (I just took a leap of faith); so hopefully people who want to know that-find this post. ;o)Message Edited by virgo09085 on 08-08-2006 0:36 AM

  • How to convert imaq image to a 2D array without vision development module

    Hi,
    I'm looking for a way to convert an Imaq image into a regular picture (2D array) without using "Vision development module", nor saving it to a file (I need a refresh rate of about One frame per second).
    any ideas?
    thanks,
    Gilad.

    Greetings, 
    If instead of attempting to acquire the image as the raw data as per the last example, are you looking for something then like the IMAQ Image to Array? I made some research and initially I believed this VI was part of the Development Module, but I was thinking of the Array to Image VI, which is why I did not bring it up earlier.
    Finally, how exactly will you then be manipulating that array? Or will you simply be interested in displaying it? 
    Cordially;
    Simon P.
    National Instruments
    Applications Engineer

  • Create fast intenstiy histogram without Vision toolkit

    I am trying to create an intensity histogram from an 8bit gray scale image that is being acquired from a USB camera.  Using the drivers that camera that came with the camera I am able to get a 2D array of image data (1021 x 764).  What I am doing is concatenate all the columns in the array to create a 1d array.  I then use the general histogram function that is set to a max of 256, min of 0 and 100 bins.  This approach takes approx. 5 secs. to complete. Attached is my approach.
    Is there a better approach that would process much faster? 
    If I use the Vision functions to convert the image data to an IMAQ image and then using the IMAQ histograph function, it processes almost immediately.  However I do not wish to use the Vision functions because I do not wish to pay for a Vision runtime license for each installation of my application.
    Thanks
    Terry.
    Solved!
    Go to Solution.
    Attachments:
    Image Histogram.vi ‏14 KB

    This is the simplest way to obtain a histogram.  Is it fast enough?
    That will give a 256-bin histogram, but I iust noticed that you want 100 bins for some reason.  The easiest way to do that is to scale your image from 0-255 to 0-99 (multiply by 99/255) and do the same thing, something like this:

  • 1D Boolean Array to 1D Integer Array conversion for FPGA FIFO

    Hello, I am using a PXI7813R card. I would like to pass some data between the target (FPGA) vi and the host vi using the FIFO. I have a FIFO setup to 1023 "32 bit integer" samples. I have a boolean array of 32000 samples which would be the same as 1000 32 bit integers, that I acquired using the PXI7813R card.  I would like to convert the 1D boolean array to a 1D "32 bit intger" array. This seems like a more a difficult problem than I first thought as the labview functions are reduced when targetting a FPGA device. I have attached a jpg of how I would like to do it. I am getting a "Arrays must be fixed size in current target" error for the output from the array subset function. I know this is because one of the inputs is not exactly a constant, i.e. the index input  for array subset, but regardless of the index, I will only ever be taking 32 bits from the boolean array at any time to convert to a 32 bit integer to then place in the FIFO. Any suggestions of how I may get around this problem would be gratefully recieved. Regards, Michael.
    Message Edited by Michael_Limerick on 02-08-2008 04:54 AM
    Attachments:
    fifo_out1.JPG ‏52 KB

    Hi Daniel,
    Thanks for your reply.
    I had a look at the thread that you suggested and I'm not sure if that would solve the problem I was having, the option box was checked as default. I think my issue has to do with the limitations of the different LV functions when targeting a FPGA device.
    I have decided to take another route anyway, it seems that trying to compile a large array (even a 1D boolean array) for a FPGA target both takes a long time and also a lot of FPGA resources.
    Thanks again for your reply,
    Regards,
    Michael.

  • Char array conversion from String: toCharArray()

    Greetings,
    Can anyone tell me why this code:
    import com.wuw.debug.Trace;
    public
    class charTest
       public static void
       main( String[] args )
           String strIn = new String( "strIn" );
           Trace.DTRACE( "strIn: "+strIn );
           Trace.DTRACE( "strOut: "+strIn.toCharArray() );
    }produces this output:
    [DTRACE]: strIn: strIn
    [DTRACE]: strOut: [C@1fef6f
    and not:
    [DTRACE]: strIn: strIn
    [DTRACE]: strOut: strIn

    Because:
    String.toCharArray returns an array of chars.
    An array is basically an object in java.
    Objects are converted to strings with the method toString - if it's not implemented in your class the string that method returns will be of the form classname@hashcode.
    In the case of a char array, the name of the class is "[C". The hashcode of you object seems to be "1fef6f" (in hex).
    You'll just have to remember that an array of chars is [i]not a string in java.

  • Vision toolkit

    Hello everybody,
    I've built a state machine with LabVIEW to read out a CCD camera. I'd like to implement a state of the machine in which the program just waits for the user to draw a ROI (line, point or rectangle) on the image on the Display to then do something else. The main problem I'm facing is that I have no clue of how to make the program wait for the user to draw a ROI using one of the tools of the Vision tollkit.
    Can somebody please help me?
    Many thanks.

    Hi minni,
    You may be able to use a property node of the IMAQ image on the front panel. There are multiple properties associated with the ROI drawn on the image. You may be able to read the size of the ROI with this method. If the size is more than zero, then a ROI exists, otherwise if it is zero then no ROI exists.
    I've attached a very simple demonstration of using a property node for an IMAQ image.
    Good luck!
    Josh E
    Applications Engineer
    National Instruments UK & Ireland
    Attachments:
    ROI Property Node.vi ‏35 KB

  • Object stream and byte array conversion

    Hello everyone,
    I am wondeirng how to convert an ObjectInputStream to a byte array, then convert the array back to ObjectInputStream -- should I convert the array back to ObjectOutputStream other than ObjectInputStream?
    Any sample codes?
    thanks in advance,
    George

    Isn't it the other way around? You can't do this directly:
    ObjectInputStream ois = ...;
    ByteArrayInputStream bais = new ByteArrayInputStream(ois);(but you can do it indirectly), but you can do this:
    ByteArrayInputStream bais = ...;
    ObjectInputStream ois = new ObjectInputStream(bais);

  • Pixel intensity array, pass or fail

    I am having issues creating a VI that inspects the pixtel intesity within a given rectangle.
    One of the problems I have is that in between the solar cells (see picture attached) there is a lead that appears black under SWIR imaging. So I would need two rectangles to inspect the system, and I havent been able to succeed in creating such program.
    The second issue I have, I need a VI that checks within the rectangle(s) region specified all the pixel intensity. If there is an amount of pixels that is not within that region (broken solar cell), assign a fail inspection. (see attachement).
    Any help would be appreciated
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    good-broken.jpg ‏61 KB

    You should look into the Histogram tool.  I've attached a VI as an example.  It doesn't solve your ROI question, but it shows how to cut out the area as a rectangle.
    Here's an image of the results of the histogram.  You could use the "Mean Value" as a measure of good/bad.
    Attachments:
    Histogram.vi ‏384 KB
    broke.jpg ‏17 KB
    good.jpg ‏15 KB

  • How to get pixel positions with IMAQ Vision for CVI

    Hi,
    I am trying to connect a callback to an IMAQ window that contains an image that I generated. The purpose simply to get the coordinates of the mouse for every left_click event on that IMAQ window.
    How can I do this by using the function
    imaqGetPixelAddress(); and using a callback associated to the IMAQ window.
    Is there an example code to help doing this in LW-CVI?
    Many thanks,
    JHH

    Hello,
    You can do this by calling the imaqGetLastEvent() function with IMAQ_CLICK_EVENT as the tool parameter.
    Hope this helps!
    Yusuf C.
    Applications Engineering
    National Instruments

Maybe you are looking for