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: 

Saving Binary Image with Overlay?

Solved!
Go to solution

Hi

 

I'm having some issues saving an image with overlay information. I'm using IMAQ Find Circles to measure the radii of holes in a binary image. The hole data is then used with IMAQ Overlay Oval, to draw on ovals to highlight the circles detected. Works fine and the image is shown as expected in the image output on screen, pallette is set to binary. (See second image of 3, below)

 

When I try and save the image to PNG I just get a blank (black) image. If I use the IMAQ Merge Overlay tool, I just get the green circles on the black (see last image of 3 below). Is there something I'm missing with pallettes/merging? Any help much appreciated. Snapshot of (messy) code attached.

 

 

0 Kudos
Message 1 of 3
(4,770 Views)
Solution
Accepted by topic author noodles

The problem is the binary image is all zeroes and ones.  A normal image goes up to 255, so a value of 1 looks black.

 

One solution is to multiply the binary image by 255, which makes the image black and white.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 2 of 3
(4,756 Views)

Thanks very much, a simple solution, makes perfect sense. Image now saving as two tone greyscale, many thanks!

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