Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

image subtraction

Hi,
 
I am using a CCD camera to capture the slow movement of a bright sphere and trying to use shift register to get the subtraction image between the current image frame and the previous frame. However I always get a black subtraction image, although I should be seeing something (like a tiny bright moon-shaped dot) since the object is moving.
 
Could someone look over my code and tell me what's wrong? Thanks a lot,
 
Carol   
0 Kudos
Message 1 of 5
(3,785 Views)
Hi Carol,
              Can you post your code for lv 8.0? or a screen shot of your block diagram?
Message 2 of 5
(3,768 Views)
Carol,
 
After your first loop, the image buffer for "Current image" is also the image buffer in "Previous Image".  Remember, Vision does not copy buffers for you like most data.
 
What I would do is use two shift registers.  One would hold "Current" and the other would hold "Previous".  At the beginning of each loop, acquire a new "Current" image and do the subtraction operation.  At the end of each loop, swap the shift registers contents.
 
If you want to get fancy, you could do the same thing with a single shift register.  Add a second terminal on the left hand side.  The top terminal is Previous and the bottom terminal is Current.  Current goes to the acquire image, and Previous goes straight to the image subtraction.  At the end of the loop, Current goes into the shift register terminal on the right.  This might be the easiest method, because all you have to do to your current code is add the terminal and route "Current frame" through it.
 
In both methods, you would need to feed a unique image buffer into each shift register terminal on the left side of the loop.
 
Bruce
Bruce Ammons
Ammons Engineering
Message 3 of 5
(3,755 Views)
Strange.  I pushed the post button once and got a double post.  Hmmm....
 
Bruce


Message Edited by Bruce Ammons on 08-12-2008 10:39 AM
Bruce Ammons
Ammons Engineering
Message 4 of 5
(3,755 Views)
Yes I tried Bruce's method and it worked perfectly. Thanks so much to everybody who replied.
0 Kudos
Message 5 of 5
(3,733 Views)