Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Images persist in camera buffer

Hi,
 
I'm working with an AVT marlin camera in Labview using the IMAQ 1394 vi kit. hoping someone could shed some light on this problem. I'm hoping its something really basic I've missed.
 
I'm having a problem with images persisting in buffers somewhere in memory (either the camera or labview).
 
I have a program which follows the following rough steps
 
1) Takes a foreground "control" image (an average of 'n1' images)
2) Takes a background image  (again, an average of 'n1' images)
3) Takes a fast series of 'n2' images triggered on a digital line synchronised to a counter (which we then compare to the control)
 
My problem is, between executions of the labview vi, images taken in step 3 appear in step 1. More rigorous debugging has revealed that even though I tell it to take n1 image in the first step, an extra 1 or 2 images ends up in series 3. What could be causing this?
 
Thanks in advance
 
 
0 Kudos
Message 1 of 5
(3,809 Views)
I'm not sure about the buffer issue, but I did notice one potential problem.  I would recommend clearing the images you use for summing all the images.  Images tend to retain their previous contents, even when you stop and restart a program, especially if you don't destroy the image at the end.
 
To clear the image, I would set all the pixels to zero.  There is a vi that does this, but I don't remember the exact name.
 
Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 5
(3,805 Views)
Thanks, I was unaware that I had to clear the IMAQ variables each time. The "IMAQ dispose" Vi seems to be the one, it has a flag you can set to true for "Clear All" that I put at the end of the VI. Unfortunately it also clears the front panel images...but this is something I can probably fix with a bit more methodical image variable use.
 
Sadly it hasn't helped the previous problem and I'm still seeing images persisting between runs. I suspect its a problem internal to the camera, and will look at manually flushing the camera between runs. Thanks anyway.
 
0 Kudos
Message 3 of 5
(3,800 Views)
just as an ammendum to this, I've changed the "overwrite mode" property of IMAQ getimage to "Fail" and it appears to have fixed it.
0 Kudos
Message 4 of 5
(3,797 Views)

Glad it is fixed.

I knew I wasn't being clear enough about resetting the image.  I wouldn't worry about disposing of the images at the end of the run.  It is okay to just reuse them during the next run.  You also get look at them after the run, which is a big advantage.

I was specifically talking about the image you are using for your average.  It starts with image from the previous run, instead of all zeroes.  It is kind of like an uninitialized shift register.  The vi I was suggesting was IMAQ FillImage, which sets all the pixel values to zero (or whatever value you specify).  It is found under Vision Utilities -> Pixel Manipulation.  I would use it to initialize your image summation right before the loop.

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 5
(3,790 Views)