我已经看到了几个关于皮肤颜色的问题,但没有在rgba中找到确切的皮肤颜色范围。有人可以告诉一个中年欧洲男人什么是min-max rgba颜色吗?什么是rgb中的肤色范围?
我的代码是这样的:
//Here should be scin min max rgba range
static CvScalar min = cvScalar(0, 0, 130, 0);//BGR-A
static CvScalar max= cvScalar(140, 110, 255, 0);//BGR-A
public static void main(String[] args) {
//read image
IplImage orgImg = cvLoadImage("colordetectimage.jpg");
//create binary image of original size
IplImage imgThreshold = cvCreateImage(cvGetSize(orgImg), 8, 1);
//apply thresholding
cvInRangeS(orgImg, min, max, imgThreshold);
//smooth filter- median
cvSmooth(imgThreshold, imgThreshold, CV_MEDIAN, 13);
//save
cvSaveImage("threshold.jpg", imgThreshold); }
所以我只是需要在这里指定RGBA值。
你为什么不测量它?拍一张照片并绘制不同肤色的直方图 – Maljam
@Maljam我在哪里可以阅读如何做到这一点?以及如何制作只有我需要的颜色的直方图? –
您需要选择一堆数字图片,在图片上手动指定“蒙皮”区域,提取RGB值,创建直方图。它只是编程......加上大量的手动工作。 –