Digital image processing operations 1.1 image segmentation based on human facial skin color space

Disclaimer: Photos from the network only for academic research and study purposes please leave a message if the demands of copyright will be removed immediately Bowen

First read pictures, read random method, you can use Image under the PIL, numpy which can be read directly open, you can also use openCV, for color space conversion following division convenience I use the openCV of cv2

 

 Operational requirements under the picture of RGB color space conversion is divided into at YCrCb color space, so a direct openCV use of tools, of course, write their own matrix multiplication can be, after I read the file above has been transformed completed:

 

 The YCrCb Y represents brightness, i.e. grayscale value, and Cb and Cr represent color and saturation, color designation for the image. Wherein Cr reflect differences in the brightness of the red part of the RGB input signal, Cb is the difference reflects the blue part of the RGB input luminance signal                    
described color segmentation following steps:         
1. converting the RGB image to the YCrCb space image and extracts a Cr component           
2. Cr component Gaussian filter           
3 made of self-Cr binary thresholding processing method OTSU

 

 The figure is an image of the Cr component after filtering be told

 

 The figure is an image using the Gaussian filter OTSU binarizing divided, following the point of view using a Gaussian adaptive segmentation method, Cr raw component is not passed Gaussian filter processing results:

 

 See the final result obtained two points on the skin component CrCb color range by statistical laws:

 

Guess you like

Origin www.cnblogs.com/NWNU-LHY/p/11458605.html