Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

white area segmentation from color image

By particle i meant the centre rectangle particle and eliminating the rest of the images. Particle analysis works on binary images. You can always use the co-ordinates from binary image to your original image.

0 Kudos
Message 11 of 12
(2,139 Views)

@BruceAmmons wrote:

Take a look at the image after splitting it into HSL image (hue, saturation, intensity).  I suspect the hue image will be almost all black, because white, black, and red all have a hue around 0 (some might be 255, though, or many different hues depending what color is dominant in the black and white areas).  The saturation image will probably highlight the red areas, with the black and white areas both showing as black.  The intensity will highlight the red and white areas, but not black.

 

You can do this as a two step process.  Use the saturation image to make a mask for the red areas.  Use the mask to remove the red areas from the intensity image, which gives you the white areas.  Whatever is left is the black areas.  Does that do what you need?

 

Bruce


Instead of HSL, i used HSV, but Bruce's approach seems to be legit:

1.png

 

I used an unspervised approach (k-means, which Kl3m3n showed us how to use here) to generate class 0 to 5, so there might be room for optimization,

but class 3 seems to do a proper job in segmenting the white area:

 

0.PNG 

 

masks for class 2, 3 and 4:

2.png

 

 

Regards,
Alex

 

Message 12 of 12
(2,099 Views)