Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

saving the overlay

Hi

I am writing overlays to my images.

Images are 12bit grayscale and the overlay is white

The overlay has to be permanent and viewable in Windows

The image displays correctly in the viewer with the overlay.

I use .Overlays.Item.(1).Merge, this creates a complete white image instead of a image with an overlay.

I can save the image successfully using .WriteImageandFileInfo or .WritePNGFile but the overlay does not show.

How can I solve this?

Thanks


0 Kudos
Message 1 of 4
(3,511 Views)
There are two things you can do to show the overlay.

1.   Use the Merge Overlay function to merge your overlay with the existing image.  You can create a secondary image as the destination image to contain the new merged image.

2.  Create a secondary image and set it to the same size as your primary image and then use Copy Overlay  to copy the overlay data from your original image to the blank secondary image and  then Merge Overlay to make the secondary image an image of the overlay data.



Randall Pursley
0 Kudos
Message 2 of 4
(3,510 Views)
Hi

My images type is I16

If I use the Merge overlay function it changes the image to RBG32 thus the whole image become white

Regards
0 Kudos
Message 3 of 4
(3,505 Views)
I see what you mean.  It says in the help that the output is always RGB for this function.  I guess that's because the overlay can be in color.  Sorry I didn't notice that before I responded.

My first cut for your problem would be

1.  Use IMAQ Copy Overlay to copy your overlay to a new image.  This new image should be black with the white overlay visible.
2.  Use the IMAQ Add function to add your new image of your overlay to the original image.  The white areas in the overlay should remain white in the resutling image since the sum will be larger that the maximum number for I16 images(at least I think), and adding the black areas to your original image will keep them looking the same.
Randall Pursley
0 Kudos
Message 4 of 4
(3,498 Views)