07-23-2009 08:51 AM
Hi to everyone
I'm developing a simple motion detector/tracking system using a USB WEBCAM, i've computed easily the frame difference, among successive frame, using a case structure that exploit a while loop to store in two buffer two successive frame.
Using IMAQ subtract over the two stored image i've obtained the difference image. On this image i've performed an image casting using the IMAQ cast image module, and successively i've applied in cascade the following modules:
1 - IMAQ BCGLookup (To enhance Brightness and contrast of the difference image)
2 - IMAQ AutoBThreeshold 2 (To obtain a threesholded image)
3 - IMAQ GrayMorphology (To enhance object shape int the threesholded image)
4 - and finally IMAQ Count Objects 2 (To count and track obejcts in the scene)
The result is almost good (is not a real motion tracker but it suffice for my purpose).
Now my problem is related to the image flickering effect on the display image area, that make impossible to see image result on front panel. A Highlighting on the block diagram allows to obtain a more stable image (even if highlighting after the application of IMAQ count Objects flickers however). The Flickering effect is absent in a simple vi writed to visualize webcam source.
Now what i have to do to remove this effect ?? Is a system problem or a problem related to the webcam video sampling (I'm using a low cost webcam with a resolution of 640x480 15 frame/s)?
I've aleady readed some posts of other person, in this forum, on this problem but my case is slightly different.
to overcome misunderstanding of my explanation i'm attaching a view of the diagram that i've realized.
Thanks in advance for any answer that you can give me about this problem.
Solved! Go to Solution.
07-23-2009 11:56 AM
07-23-2009 02:31 PM - edited 07-23-2009 02:31 PM
07-23-2009 03:12 PM
07-24-2009 02:05 PM - edited 07-24-2009 02:06 PM
I am not sure what you do in that last vi in the chain, but if you create another image reference and add it as an input it into that vi, you can use the new reference as your image destination. That should eliminate the flicker, since your image control will now be showing only the data coming from the new reference which will only update one a loop cycle. If you didn't already know, the flicker is actually the image control trying to keep up with the changing data as you process the image data.
The IMAQ Dispose has a Dispose All input that you can wire with a boolean.
07-25-2009 08:00 AM
07-28-2009 02:32 PM - edited 07-28-2009 02:34 PM
Take a look at the CASE structure in the top left part of your loop. It looks like you have left some outputs unconnected in the cases that I cannot see. Make sure you wire all outputs in all cases in the CASE structure.
As for the Image reference, what you did is not what I meant. If you post your code, I will show you the modifications that I am referring to.
07-28-2009 04:05 PM
07-29-2009 10:46 AM
07-30-2009 11:35 AM
Take a look at the attached. I added your sub vis to my existing program. You had two issues that I saw with yours.
1. There is a bug with the USB camera grab that forces the image output to be RGB32. Since the Canny Edge Detection.vi needs U8 images, you need to Cast them as such before passing them into that vi.
2. I added a control to the front panel to set the Filter Parameters for the Canny Edge Detection.vi. This will give you more flexibility in the edge detection. Play around with the parameters to see how they affect the image. You can probe the output of the edge detector vis to see these images on the fly.