Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I keep my images collected with IMAQdx Grab.vi from flickering?

Solved!
Go to solution

I am collecting images with a firewire camera. I get the images I want but the image output flickers periodically. The images need to be stable in my application. I slowed down the speed by using 'Wait (ms)' inside the 'While Loop' but still have the same problem. Looks like this is caused by buffering at different times. This seems to be a common problem although I could not find good instructions at ni.com. Has anyone had similar problems before or it is just me?

Thanks in advance.

0 Kudos
Message 1 of 8
(4,016 Views)

I am guessing you are displaying the image at the end of your processing, then acquiring a new image and putting it in the same buffer.  The problem is the display shows the current contents of the image, not always the contents when you sent it to the display.  The fix is to right click on the image display and select "snapshot".  This will automatically make a copy of the image when you display it.  That usually eliminates the flickering.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 8
(4,015 Views)

Bruce,

I tried that but I still get the same flickering. What you said makes sense but it must be something else.

 

 I am displaying the image in the middle of various image processing. For example, I display the image after 2-Threshold in my image processing: 1-ImageGrab => 2-Threshold => 3-RejectBorder => 4-ParticleFilter and so on. I always use 'IMAQ Create' and 'IMAQ Copy' functions to display any image I took out at a particular step. Attached is a file to show the image when I had the flickering.

 

Thanks for your help in advance.

 

 

0 Kudos
Message 3 of 8
(4,009 Views)

That looks like a grayscale image being displayed as a binary image.

 

Look at your code.  Is the next processing step parallel with the display output?  Is it possible for the next processing step to occur before the image is displayed?  Make sure everything happens in the order you expect by wiring errror wires in the order you expect.

 

Can you post your code or an image of it so we can look at it?  That is usually a quick and easy way to find the problem.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 8
(4,004 Views)

Attached is a copy of the block diagram. I started deleting some of the error wires like you suggested and sometimes it seemed to work better. But, when I do this, I started getting 'IMAQ Vision: Incompatible image type' error in 'IMAQ Mask' function. I don't know why.

 

Looks like the problem is caused when I connected error wires to some functions but deleting some of the wires causes a different error in 'IMAQ Mask'. I captured the screen of the most recent version where the image is now mostly stable after the error wires for some functions are deleted but I get the 'Incompatible image type' error after a while.

 

Thanks.

0 Kudos
Message 5 of 8
(3,999 Views)
Solution
Accepted by topic author ygno

You have some sequencing issues.  For example, you display Image 1 at the same time that you are copying it and extracting a color plane, which changes the image.  These three events are in parallel.  Who knows what happens first?  You could be copying the extracted plane, or the original color image.  Likewise, either one can be displayed.

 

As a general rule, whenever I use an operator that changes the image type, I input an image of the new type as the destination image.  This keeps the type of each image unchanged.

 

If you are using an image in two places (in parallel), any operator that changes it should have a new image as the destination image.  If not, the error wire should be routed so that the non-changing processes happen before the changing processes.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 6 of 8
(3,996 Views)

The image is stable now. Sequencing must have caused the flickering. I sometimes get 'Incompatible image type' error at 'IMAQ Mask' but I guess it is a different issue. I will start another thread if I cannot solve the problem.

Thanks.

0 Kudos
Message 7 of 8
(3,985 Views)

I am pretty sure it is the same problem.  Every now and then, an image copy and image conversion are running in the opposite order than you expect them to, because they are parallel.  If you force one to go before the other using some form of sequencing, you will solve the problem.  Another method to force the sequence of operations is the flat sequence structure.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 8 of 8
(3,980 Views)