#include <opencv2\opencv.hpp>
#include <iostream>
#include <math.h>
#include <vector>
using namespace cv;
using namespace std;
int main()
{
vector<Mat> channels;
Mat imageBlueChannel;
Mat imageGreenChannel;
Mat imageRedChannel;
Mat srcImage4 = imread("test1.jpg");
split(srcImage4, channels);
imageBlueChannel = channels.at(0);
imageGreenChannel = channels.at(1);
imageRedChannel = channels.at(2);
namedWindow("lansetongdao", WINDOW_AUTOSIZE);
imshow("lansetongdao", imageBlueChannel);
namedWindow("lvsetongdao", WINDOW_AUTOSIZE);
imshow("lvsetongdao", imageGreenChannel);
namedWindow("honhsetongdao", WINDOW_AUTOSIZE);
imshow("hongsetongdao", imageRedChannel);
waitKey(0);
return 1;
}
基于C++的opencv练习三颜色通道分离
最新推荐文章于 2023-10-11 16:26:30 发布