#include <opencv2\opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
	Mat img = imread("./test.jpg");
	cvtColor(img, img, CV_BGR2GRAY);
	for (int i = 0; i < img.rows; ++i) {
		for (int j = 0; j < img.cols; ++j) {
			img.at<uchar>(i, j) = 45;
		}
	}
	imshow("单通道",img);
	Mat img_3 = imread("./test.jpg");
	for (int i = 0; i < img_3.rows; ++i) {
		for (int j = 0; j < img_3.cols; ++j) {
			img_3.at<Vec3b>(i, j)[0] = 23;
			img_3.at<Vec3b>(i, j)[1] = 76;
			img_3.at<Vec3b>(i, j)[2] = 98;
		}
	}
	imshow("三通道", img_3);
	waitKey(0);
	return 0;
}