Mat src=imread("image/color.jpg"); imshow("a",src); int i,j; int cPointR,cPointG,cPointB,cPoint;//currentPoint; for(i=1;i<src.rows;i++) for(j=1;j<src.cols;j++) { cPointB=src.at<Vec3b>(i,j)[0]; cPointG=src.at<Vec3b>(i,j)[1]; cPointR=src.at<Vec3b>(i,j)[2]; if(cPointB>100&cPointR<100&cPointG<100) { src.at<Vec3b>(i,j)[0]=0; src.at<Vec3b>(i,j)[1]=0; src.at<Vec3b>(i,j)[2]=0; } } imshow("da",src);
时间: 2024-10-13 11:28:42