Ask Your Question

Revision history [back]

Hi,you may try OTSU method to solove the problem. in my code

Mat src = imread("chair.bmp");
vector<Mat> planes;
split(src,planes);
Mat red = planes[2];
Mat temp = planes[2] - planes[0];
threshold(temp,temp,0,255,THRESH_OTSU);
imwrite("reslut.jpg",temp);

the result pic is image description