LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to subtract images in real time

Hi,
I am continually acquiring images from two b/w cameras connected to the NI 1405 framegrabber cards.  I need to display the two images as-is and then in a third panel, display the subtraction of the two images.  All 3 images are to be displayed continuously.  What is the best way to go about this problem?  I have the imaq library installed.
Thanks,
Owais
0 Kudos
Message 1 of 4
(3,197 Views)
Owais,
 
    You may have looked already, but there are a few example programs that can definitely get you started.  If you open the LabVIEW example finder, click the Browse tab and the Task button.  On the right find Hardware Input and Output >> IMAQ >> High Level and there is a VI called HL Grab.vi which is a continuous acquire VI.  If you look at the block diagram you can see that it is creating a image line then using that to acquire images.
    Assuming that your two cameras are each hooked up to a different card, you can essentially double the main VI's in the code for a second acquisition.  Then in the loop at the end where it displays the image you could put in an image subtraction and then display the result as well.  Make sure that you make a separate image buffer (by using the IMAQ Create.vi) for the newly subtracted image to be stored in.   Let me know if you have more questions about the specifics, thank you!
 
-Allison S.
Applications Engineering
-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 2 of 4
(3,180 Views)
Hi,
I am using labwindows/cvi.  and yes, I was able to modify HLgrab, and subtract the images by going through each pixel and doing a subtraction in a software loop.  This however, drops the frame-rate drastically from  30fps down to around 11.  I don't know if the Vision library does it any faster, do you?  If it does not, what can you suggest I do?
Thanks
Owais
0 Kudos
Message 3 of 4
(3,181 Views)
Compiling for Release brought the frame rate up to 30
Owais

0 Kudos
Message 4 of 4
(3,172 Views)