LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best practice handling images?

Hi,

 

What is the best practice for acquiring live images with IMAQdx Grab, and process each image as they arrive? I was using queues and Producer-Consumer design than I've learned that it is not advisable (http://digital.ni.com/public.nsf/allkb/FB1C0ABD37AB3DC586257C28003F554D) because you only pass the reference of an image to your processing loop. I've looked into event structures but couldn't pass the image from one case to an another and same goes for case structures. Local variables don't work either for they couldn't catch the speed. It is 33 frames per second now. I'm attaching three VIs, 

1- EnqCamtest3: It is working but I'm not sure it's the best way and I need to make it user friendly

2- Camera-User Interface: I cannot make the mode to change the display. (I only tried the threshold stage. It's not finished yet and I'm sure it has a lot of fundamental errors in it, but I'm still learning.) 

3- Low-Level Acquisition: It is another method of dealing with images which I've found in here, can't seem to work right. 

Can anyone give me a hand please I'm lost.

 

Thank you

0 Kudos
Message 1 of 4
(2,885 Views)

General Principle with dealing images:

-If consumer can process your images faster before second image arrives then no issues with single buffer and using Queue to Pass the reference.

-Where as the Consumer is Slow then there is a chance of Producer overwriting the previous image and hence it is not suggested to pass it in Queue.

-To overcome above method there are two ways: Ring Acquisition or Manually create User Buffers.

-In Ring mode of acquisition, the images are directly to copied to user buffers and overwritten in cyclic mode.

-The other method is manually creating user buffers with different Image name(reference)  and after all processing done dispose the image with IMAQ Dispose(Note: If you are continuously creating buffers and not disposing there'll be memory overflow).

Thanks
uday
0 Kudos
Message 2 of 4
(2,864 Views)

Thanks for the advice. I've found this example on LabVIEW when you say ring acquisition (''Low-Level Ring Parallel Workers''). Did you mean something like this, if I put my processing tools instead of buffer displays? But it counts so many lost buffers as it is...

0 Kudos
Message 3 of 4
(2,841 Views)

In this case i assume the Ring Acquisition refers to a fixed buffer of e.g. 10 pictures, 1st goes to 0, 2nd to 1 and so on, and the 10th overwrites 0 and so on in a cyclic fashion. This gives you the possibility to calculate on 1-10 in parallell or if the framerate is very high (it's not in this case) you could simply buffer all pictures and do calculations afterwards.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 4
(2,813 Views)