Mat img = imread("999.jpg");
imshow("原画", img);
waitKey(0);
for (int row = 0; row < img.rows; row++)
{
for (int col = 0; col < img.cols; col++)
{
if ( ((img.at<Vec3b>(row, col)[1] - img.at<Vec3b>(row, col)[0]>65))
&& ((img.at<Vec3b>(row, col)[1] - img.at<Vec3b>(row, col)[2]>65)))
{
img.at<Vec3b>(row, col) = Vec3b(255, 255, 255);
}
}
}
imshow("新图", img);
imwrite( "111.jpg", img );
waitKey();