opencv中改变图像中某一颜色通道值

#include
#include
#include

using namespace std;
using namespace cv;

int main(int argc, char**argv)
{
	Mat srcImage = imread("D:/pic/pic_fj.jpeg");
	Mat logoImage = imread("D:/pic/pic_fgo.jpeg", CV_LOAD_IMAGE_GRAYSCALE);
	vector channels;
	split(srcImage, channels);
	addWeighted(channels.at(2)(Rect(100, 100, logoImage.cols, logoImage.rows)), 1, logoImage, 0.5, 0, channels.at(2)(Rect(100, 100, logoImage.cols, logoImage.rows)));
	merge(channels, srcImage);
	imshow("红色通道", srcImage);
	waitKey(0);

}



你可能感兴趣的:(opencv)