Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

overlay binary (red/black) on greyscale image to highlight defects in .net

Solved!
Go to solution

I have the following task: I have an image and I need to find defects in that image. I have my filtering set up and everything so I am comfortable with the quality of inspection, but I need to display it in such a way so the user can see that it's working. The best way I can think of to do this is to overlay the binary image showing defect areas in red on top of the greyscale image of the image before processing.

 

Here's the problem: I can't figure out how to take my binary image and overlay it on the greyscale image so that the defects come out in some color, not white.

 

Any ideas?

0 Kudos
Message 1 of 7
(5,097 Views)
Solution
Accepted by dstanisl
One thing you may be able to try is using ReplaceColorPlanes on a color image (convert a greyscale to a color image) and specify the binary image (with the Threshold function using 255 instead). That way you can make the red plane only red where you found the binary threshold is true.
Jeff | LabVIEW Software Engineer
Message 2 of 7
(5,082 Views)

This looks like it works! Here's my code:

 

CWIMAQImage Output = new CWIMAQImage();

Output.SetSize(ThresholdImage.Width, ThresholdImage.Height);
axCWIMAQVision1.ReplaceColorPlanes(NullImage, test, ThresholdImage, System.Type.Missing, System.Type.Missing, CWIMAQColorFormats.cwimaqColorFormatRGB);

 

ThresholdImage is the output from my threshold operation.

 

Thanks!

0 Kudos
Message 3 of 7
(5,079 Views)
Glad to help.
Jeff | LabVIEW Software Engineer
0 Kudos
Message 4 of 7
(5,050 Views)

I'm looking to do something very similar. Could you post your .vi file? I don't really understand how to read the code you posted.

 

Thanks,

 

-Aaron

0 Kudos
Message 5 of 7
(4,305 Views)

i am also looking for the same as above mentioned  overlay (red) on grayscale image to highlight defects but in labview not .net

 

is it possible ??

0 Kudos
Message 6 of 7
(4,134 Views)

The method described in the solution for this thread works in LabVIEW. He named the VI's to use.

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 7 of 7
(4,120 Views)