(8)修改彩色图片某通道的值

#include
#include
#include


using namespace std;
using namespace cv;


int main()
{
Mat image = imread("C:\\Users\\Administrator\\Desktop\\1.jpg");
for(int i=0;i for (int j = 0; j < image.cols; j++)
{
image.at(i, j)[2] = 0;
}


//显示结果
namedWindow("Image");
imshow("Image", image);
waitKey(0);
return 0;
}

你可能感兴趣的:(OpenCV+Cpp)