LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

real time processing of greyscale values in lab view

Hi!
well, i wish to capture images @1000 fps using my camera and i have a program in  labview to get an array of the greyscale pixel values of the images .
however i wish to process each image separately , as in take the array ,do some calculations , convert the grey scale values into a picture and depending on the results cary out other processes.  then similarly do the same procedure to all the images captured. my application so requires that all this programming be done in real time.
at present all my program does is show a very fast changing array of values!! it looks nice but doesnt do any work for me!!
does any one have any suggestions how this can be carried out?
thanks
regards
amol
0 Kudos
Message 1 of 6
(3,181 Views)
I am a little confused by your post. Concerning this array of rapidly changing values, where does it come from and what does it contain? Do you convert the images into arrays that you manipulate? Is this an array of analysis results?

Finally, what is it exactly that you want to do? Does this really need to be real time as in deterministic operation (a new image has to come in and be processed every millisecond, no matter what) or real time in the sense that you simply want the images processed as they come in (you don't want to wait till all the images come in to process them). If it's the former, Windows won't do it for you as it is not a real-time OS.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 6
(3,179 Views)
Hi mike,
 
thanks for your comments.
 
well this array is generated by a dll supplied by the camera company. It captures the image and then generates for example 1.3 million values( for settings at the highest resolution).these values represent the values of grey scale value of each pixel ,ranging from 0-255 depending on the intensity of light at each pixel . I wish to use each array to analyse the data and then carry further processes. for example if a particular grey scale value at array position 100 is equal to 140 , i want to enter a while loop and carry out that process and once its done come back to the next array and process that data .  ideally i want to be able to carry out processing of 1000 frames a second and i can also try to work at processign one image once every 3 ms.
i hope i have been a bit clearer now!
 
regards,
 
amol
0 Kudos
Message 3 of 6
(3,170 Views)

it seems one needs still more clarifications:

is the analysis of your data going to affect the system on real time, in that sense that the next frame grabbed might be changed due to some feedback?

if not, then you probably dont need real time in the proper sens of the word, and just need analysis of your image as it comes. is it just to avoid saving the image for future analysis, thus saving HD space?
for such solution, one can use a queue of arrays. the grabber loop would produce the queue, while some other loop would just consume it, and forward the info to unrelated subvis or loop. in such way, you have 2 independant threads, and the rate of consuming the data will not slow down the grabbing frame rate. of course, still assuming the consuming loop would not take forever to perform analysis on data. you might have to do some optimisation there.

if you actually need real time, then you have to hope your analysis is going to be faster than frame grabbing. check the analysis you do on each picture, and how much time it takes, using "perfomance and memory" tool, in tools->profile menu of your vi. but do remember: 1KHz frame grabbing, is only 1M times faster than your computer...this might then require a bit of optimisation.

 

Message Edited by Gabi1 on 07-08-2007 03:33 PM

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 4 of 6
(3,171 Views)
Hi,
 
well i need to capture an image , check its pixels values and depending on the values, i might have to program the camera to change the region of interest .and then capture the next frame and so on. so i guess i would need a feedback as well right?
the processing is dependent on the values in the array, so i figure i need to save the array somewhere and then analyse it ,
and then convert those pixels back into an image,so that i have a live on screen imaging. then allow the next image to come in.
 
so i have 3 questions
 
1. how to convert the pixels back into an image?
2. how to store the array of pixels and  analyse it ? 
3.and then to carry out another process dependent on those pixel values .after it ends then bring another image into the array and so on as long as the camera is capturing images.
 
regards,
amol
0 Kudos
Message 5 of 6
(3,162 Views)
To answer your questions:

1. To display an array as a picture you would use a picture control. There are examples that ship with LV that will give you the idea of how to use it.

2a. Storing the pixel values is a bit more complicated. If you are really going to use 1.3Mp resolution they are going to be big files, so I would start by storing them as flattened arrays of U8 values. This will take up the minimum space and is easy to convert back and forth. Does the data come from the DLL as a 2D matrix of pixel values or a 1D array? If it comes out as a 1D array you will need to convert it into matrix at some point - probably during the analysis process as it is a very "costly" process in terms of time. Also do the raw images have any archival value?

2b. In terms of the analysis part, as far as LV is concerned, your image is just another array of number so you can use all the existing functions in LV to manipulate it. Just be sure to always take advantage of the polymorphism of the math operators. Don't treat pixel values separately unless you absolutely have to as it will slow you way down. If you need to do very involved sorts of things like blob counting or the like you may need to get the imaging toolkit.

3. I'm not sure how much other detail I can provide, as this is getting into the details of how to structure your application and I don't have near enough information to advise you on that.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 6
(3,145 Views)