Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

image from signal

I'm trying to make a LabVIEW 8 VI to take an analog signal from a microscope, and turn it into an image.  The VI i've attached takes data from a DAQmx Read VI configured for analog, 1 channel, N samples.  The array operations are to remove unwanted data and format what is left into a 500x500 2D array, which is what I want to make into an image.  For some reason, the IMAQ VIs i've used produce a 0x0 image, which isnt terribly helpful in telling me what i've done wrong.  The examples I find that use IMAQ VIs usually work with existing images, or with cameras which create images, rather than signals.  Does anybody know what I'm doing wrong, or where I can find more applicable examples?
0 Kudos
Message 1 of 4
(3,326 Views)
I just realized that i neglected to attach my VI, here it is
0 Kudos
Message 2 of 4
(3,324 Views)
You need to create your image as a "Grayscale (SGL)" if you are going to wire your array into "Image Pixels (Float)" on the IMAQ ArrayToImage vi. I've attached a correction.

Kevin C.
National Instruments
NI Vision
0 Kudos
Message 3 of 4
(3,308 Views)
Hello,

The problem with the code you sent me is the array is un-initialized.  Even though you are reshaping the array, the IMAQ ArrayToImage function is receiving an array with no values in it (ie a 0x0 array) and creating an image of the same size.  Once you initialize the values in the array the IMAQ ArrayToImage function will create an image with the same number of elements of the initialized array.

I made some quick changes to the example you sent to initialize an array of size 255 X 255 with values from 0 to 255.  The image displayed will  255 X 255 with a gradient shift from black to white. 

For your program make sure your DAQ values are actually getting into the array and are being passed to the IMAQ ArrayToImage function.  If IMAQ ArrayToImage is creating a 0 x 0 image it is because it is receiving a 0 X 0 array.  You can check this by placing probes on the wires while the VI is running to see their values.  If your VI runs too quickly click on the "Retain Wire Values" button in the tool bar so you can see the values after the VI has completed running.
S. Arves S.
National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(3,305 Views)