LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time dependant recording of pixel line values ?

Hello everyone,

 

I am trying to implement a new tool to a live image treatment and recording Labview VI based on IMAQ VIs.

What I want to do is to observe the evolution of a line of pixel over time, i.e. record a time-stamped array of pixel values arrays. I hope it is understandable ?

 

I get the pixels value with the VI "IMAQ GetPixelLine" then I have tried two approachs:

- Use a while loop to add a time stamp to this 1d array and then append it iteratively to a 2d array. That does not work since once the while loop has started, the value of the image is not updated anymore (or so I have understood).

- Use a "write to measurement file". I could not have it work properly, seems it can only read one point after the other and thus create a single 1d array of ordinates.

 

Included is this additionnal VI I am trying to build. It will be part of a larger Monster. So far it only plots and record the maximum of the live image, and shows the x and y pixel profiles from this maximum. The blank case structure represent what I want to add, possibly then displayed in a waterfall graph...

 

Any hint of what I could use ? could the waveform format be a solution ?

 

Any comments/questions are welcome,

 

Best regards,

 

GL

0 Kudos
Message 1 of 6
(2,849 Views)

Because Image Acquisition, particularly video, is "clocked" by the camera, it really pays to take advantage of LabVIEW's inherent parallelism by using a Producer/Consumer Design Pattern, with the acquisition of images (say, at 30 frames per second, or every 33 milliseconds) being almost the only activity in the Producer Loop, and a separate Consumer loop processing the images in the "free time" (say, 32.99 out of the 33 msec) that the CPU is otherwise idle.  Using Queues to pass data from Producer to Consumer means that if one Consumer loop requires a little extra time (say, 40 msec), it won't cause the Camera to "miss a frame" because the two loops are working asynchronously.

 

One of the less-explained (and certainly less-understood-by-me) concepts in IMAQ and IMAQdx is that of an "Image" or "Image Buffer".  I believe that when you "Create Image" in IMAQ, what you are really creating is a pointer to an area of memory where images will be stored.  Every time you create an Image, you create one such area.  The important thing is if you only create one "Image" for the Camera and for subsequent processing, the next time the camera "takes a picture", it will overwrite that area of memory, even if you are attempting to "process" it with other IMAQ functions.  For this reason, there is a Configure Acquisition function that allows you to specify the buffers that are associated with the Camera, and to set them up so that the Camera uses them in a ring fashion, giving you additional time to process images from these buffers before they are over-ridden by the Camera.

 

Doing "simple things" with images in LabVIEW is easy.  Doing more complex things is much harder, due in part to the minimal documentation and tutorials for Vision acquisition (though more is coming -- there's a recent book called "Practical Guide to Machine Vision Software: An Introduction with LabVIEW", as well as a 2004 book (before IMAQdx) called "Image Processing with LabVIEW and IMAQ Vision".  Note that to take advantage of the power of IMAQdx and image processing, you will probably need to get into the "dirty details" of the lower-level functions -- Express VIs are not going to have the flexibility you will (probably) require.

 

Bob Schor

0 Kudos
Message 2 of 6
(2,830 Views)

Thanks for this explanation, though that's not very encouraging! I was fearing that I was coming too close to where easyness is no more...

But since I manage to get the live plot of pixels lines values, I should be able to somehow grab and record these values, isn't it?

 

So if we forget the origin of the data, is there a simple way to time-record arrays of values?

 

0 Kudos
Message 3 of 6
(2,820 Views)

Hello,

 

as Bob already mentioned it will not be trival to get this done.

The saving to file and update of the indicators can not be done in the same loop as calcuation.

 

Some work with Pixel Lines can be found here:

http://forums.ni.com/t5/Machine-Vision/Imaq-get-pixel-line/td-p/1143023

 

 

0 Kudos
Message 4 of 6
(2,767 Views)

Hello,

 

Enclosed is a partial solution. It basically records a few pixels from the "power center" of my image.Looks like it provides coherent results.

If I get you right, your worry is that with small exposure time (i.e. faster acquisition) and too many points to record with this solution, the different point won't be recorded from the same picture, right ? Or has it a stronger effect on the timing that I should worry about?

 

Let's state this more clearly: if I want to record with this VI the evolution of a line of 10 points on pictures with a 200ms exposure time, will the time written in the measurement file be precise to the second for recording of 5 minutes?

 

Thanks for your kind and helpful answers!

 

GL

0 Kudos
Message 5 of 6
(2,753 Views)

Hey,

 

if you log the timestamp at every interation of image acquisition this can be logged.

But you will not get a timestamp for every point of the line, als long as the whole line Data provided by the LineProfie.vi you can create only one stamp.

 

Regards

 

0 Kudos
Message 6 of 6
(2,733 Views)