#include <iostream>
#include <opencv2/highgui.hpp>
#include <opencv2/core.hpp>
using namespace std;
using namespace cv;
int showPicture()
{
Mat img = imread("pic.jpg");
if (img.empty())
{
cout << "opencv image failed!" << endl;
return -1;
}
cout << "rows:" << img.rows << ", cols:" << img.cols << endl;
cv::imshow("Picture", img);
waitKey(10000);
Mat channels[3];
split(img, channels);
imshow("B", channels[0]);
imshow("G", channels[1]);
imshow("R", channels[2]);
imwrite("channelB.jpg", channels[0]);
imwrite("channelG.jpg", channels[1]);
imwrite("channelR.jpg", channels[2]);
waitKey(0);
return 0;
}
int showVideo()
{
return 0;
}
int main()
{
showPicture();
return 0;
}
最后
以上就是俊逸发卡最近收集整理的关于opencv GRB三通道颜色分离的全部内容,更多相关opencv内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复