opencv-merge通道合并
作者:互联网
方式一
cv::Mat src(4, 3, CV_8UC1,cv::Scalar(10)); cv::Mat src1(4, 3, CV_8UC1,cv::Scalar(20)); cv::Mat src2(4, 3, CV_8UC1,cv::Scalar(30)); cv::Mat dst; cv::Mat newChannels[3]={src,src1,src2}; cv::merge(newChannels, 3, dst);//通道合并 //参数1:单通道数组 //参数2:需要合并矩阵的个数 //参数3:目标矩阵 std::cerr<<src<<std::endl; std::cerr<<src1<<std::endl; std::cerr<<src2<<std::endl; std::cerr<<dst<<std::endl;
方式二
标签:Mat,merge,8UC1,cv,src2,opencv,Scalar,CV,通道 来源: https://www.cnblogs.com/liming19680104/p/15544232.html