08-17-2010 04:44 AM
Hi
I do have a cam with a frame rate of 50 Images/sec (20ms). With each new image (cycle) I do some image processing which takes about 5ms each time (complete sequence). Afterwards I wait for the next image and do the same again. This loop goes forever as long no stop occurs.
Here it is obvious that the image processing is faster with 5ms than the image aquisition with 20ms. Which image is taken for the image processing (sequence) right after finishing the image processing? Is it still the "old" image or already the next, new one? How do I ensure that only the latest image is used for the image processing if I have a different frame rate than my sequence has? Or in other words how do I syncroize the image acquistion (cam) with my sequence for the image processing?
Below is an example how the vi is made so far.
Thanks in advance..!
08-18-2010 02:29 AM
Hi Norick,
the main loop will be implicitly timed by the acquisition so you will get something like the following:
1. start loop iteration
2. acquire image
3. process image
4. end of loop iteration
5. start next iteration
6. wait for next image
7. acquire image
8. repeat 3 to 7...
The acquisition function knows that it only needs to run every 20ms and so it will wait if it has to, thus stalling the whole loop. This is standard dataflow behaviour of LabVIEW and already does what you want it to do.
In order to see the flow of data, try activating the highlight mode on the block diagram (the light bulb on the toolbar). This will run the program in slow motion and show how the data flows through the diagram.
Regards,
08-18-2010 03:48 AM
Thanks!