LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

image subtraction original image destroyed

Hello all,

Sorry if this is a repost of a question previously asked. I can't seem to find it in the forum.

Basically, I have a background subtraction vi that takes a bg image and subtracts it from a realtime (RT) snapshot image. The problem is, I can only display the subtracted image and not the snapshot. I've tried converting the RT image to an array and recover it with a new image name, copy it to a new blank image under a different name, but nothing seems to work.

However, strangely enough, if I don't attempt to branch the RT image to a display in the front panel and probe before and after the subtraction routine, they appear fine!?!?

Any help would be greatly appreciated. I've attached my vi's in a zip file. MAIN.vi is the main program to run.

I believe you will need the NIVISION ACQUISITION package to view it properly.

Regards,
Anderson Chen

0 Kudos
Message 1 of 6
(2,904 Views)
No one has any ideas?

No quick fixes?
0 Kudos
Message 2 of 6
(2,879 Views)
Anderson,

First, the overlaycapture.vi where the actualy acquisition is missing from your zip file.  It appears that there might be a misunderstanding of how the image datatype works. The image datatype is actually a pointer to a memory buffer where the image data exists.  That means, that previous image data is not maintained in the program unless it is copied over to a new location.  Chances are that you are missing this background portion because you are subtracting it out!

I hope that helps!

Jeffrey Phillips
National Instruments Applications Engineer
0 Kudos
Message 3 of 6
(2,863 Views)
Thanks for your reply.

Hum... I guess I zipped the wrong files. Let me try it again.

So I'm still addressing the same memory if I use the IMAQ copy command to copy it to another "image" created using the IMAQ create command?

Regards,
Anderson


Download All
0 Kudos
Message 4 of 6
(2,859 Views)
One small correction in the main.vi.

Got the wiring mixed up between IMG SRC and IMG DST.


0 Kudos
Message 5 of 6
(2,858 Views)
Thanks Jeff.

I think I finally understood you. I've fixed the issue.

Regards,
Anderson
0 Kudos
Message 6 of 6
(2,852 Views)