分别对三通道赋值img.at(i,j)[2]=255;

 

 

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include 
#include 
#include 
#include 
using namespace cv;
using namespace std;

int main()
{
	double time = static_cast(getTickCount());//书P110计时
	Mat img = imread("D:/kt.jpg");
	Mat img2, img3, img4;
	int i = 0, j = 0;

	for (int i = 0; i(i, j)[0] = 255;
			//img.at(i,j)[1]=255; 
			//img.at(i,j)[2]=255;
		}
	} printf("sld %d", img.rows);

	imshow("原来", img);

	imwrite("攒公开.jpg", img);

	time = ((double)getTickCount() - time) / getTickFrequency();//书P110计时
	cout << "时间:" << time << "秒" << endl;//书P110计时函数
	waitKey(0);

}


这是img.at(i,j)[2]=255;的结果

分别对三通道赋值img.at(i,j)[2]=255;_第1张图片

 

 

这是img.at(i,j)[1]=255;的结果

分别对三通道赋值img.at(i,j)[2]=255;_第2张图片

 

 

这是img.at(i,j)[0]=255;的结果

分别对三通道赋值img.at(i,j)[2]=255;_第3张图片

你可能感兴趣的:(分别对三通道赋值img.at(i,j)[2]=255;)