标签:iostream named using namespace print gre show int bit
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
Mat src = imread("f:/temp/images/lena.jpg");
if (src.empty())
{
printf("Could not find the image!\n");
return -1;
}
namedWindow("input", WINDOW_AUTOSIZE);
imshow("input", src);
vector<Mat> mv;
// 通道分离
split(src, mv);
int size = mv.size();
printf("number of channels: %d\n", size);
imshow("blue channel", mv[0]);
imshow("green channel", mv[1]);
imshow("red channel", mv[2]);
// 修改通道内容然后合并通道
mv[2] = Scalar(0);
// bitwise_not(mv[0], mv[0]);
Mat dst;
// 通道合并
merge(mv, dst);
imshow("merge dst", dst);
waitKey(0);
destroyAllWindows();
}
标签:iostream named using namespace print gre show int bit
原文地址:https://www.cnblogs.com/wbyixx/p/12244340.html