From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing image buffers

HI all,

 

There is probably a trivial answer to this but as yet I don't have it. Is it possible to clear an image buffer without destroying the reference to it? I can clear the image indicator by wiring an empty image constant to it, but if I do this to the buffer reference it appears to destroy the reference. 

Thanks

Simon

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

The Image Buffers created using IMAQ Create are references to the memory location with Image Name as pointer to it.

-To Properly dispose this image and memory you have to use IMAQ Dispose.

Thanks
uday
0 Kudos
Message 2 of 8
(4,041 Views)

Hi Uday,

 

This is not quite what I meant. When you create a buffer reference I guess initially it points to an image location with no data in it. You capture an image and the reference points to some data. I was wondering whether it was possible to revert to the original state by deleting the data but not the reference.

 

As of this morning I have decided to dispose and recreate the buffers each time, which works, but it would be nice to know if the buffer data can be deleted and the reference maintained.

 

Thanks

Simon

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

When you are writing empty image constant to image wire it will be overwritten but the reference will not be released unless you use IMAQ Dispose as per my knowledge.

Thanks
uday
0 Kudos
Message 4 of 8
(4,026 Views)

I found that writing an empty image constant to the image wire prevents you loading an image into memory, so I assume that the reference has been disposed of.

0 Kudos
Message 5 of 8
(4,018 Views)

I can think of two simple methods.  If you want to keep the existing image size, use IMAQ Fill to set the entire image to a specific color.  Another option is to set the image size to either 0x0 or 1x1, which should eliminate all the data in the image.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 6 of 8
(4,008 Views)

Thanks. I'll check this out.

 

Simon

0 Kudos
Message 7 of 8
(4,005 Views)

image buffer place in labview are based on name that you select for imaq vi and it is image reference 
if you want to not lose reference but make buffer empty any where that you want just wire an zero size image to one Imaq with same name in this case you still have your reference based on imaq name but buffer of this reference is empty 
 

0 Kudos
Message 8 of 8
(3,965 Views)