OpenCV——肤色检测
一、RGB color space 检测代码如下: void SkinRGB(IplImage* src,IplImage* dst) { //RGB颜色空间 //均匀照明:R>95,G>40,B>20,R-B>15,R-G>15,R>B%R //侧向照明:R>200,G>210,B>170,R-B<=15,R>B,G>B int height = src->height, width = src->width, channel = src->nChannels, step = src->widthStep; int b = 0, g = 1, r = 2; cvZero(dst); unsigned char* p_src = (unsigned char*)src->imageData; unsigned char* p_dst = (unsigned char*)dst->imageData; for(int j = 0; j < height; j++){ for(int i = 0; i < width; i++){ if((p_src[j*step+i*channel+r] > 95 && p_src[j*step+i*channel+g] > 40 && p_src[j*step+i*channel+b] > 20 && (p_src[j*step+i*channel