opencv之通道分离和合并
void split(const Mat& src, Mat* mvbegin);
void split(InputArray m, OutputArrayOfArrays mv);
void merge(const Mat* mv, size_t count, OutputArray dst);
void merge(InputArrayOfArrays mv, OutputArray dst);
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
std::string image_name = "/home/liuzhiyang/test/color_image.png";
cv::Mat color_image;
color_image = cv::imread(image_name, cv::IMREAD_COLOR);
std::vector<cv::Mat> v_channel;
cv::Mat blue_channel, green_channel, red_channel;
cv::split(color_image, v_channel);
blue_channel = v_channel.at(0);
green_channel = v_channel.at(1);
blue_channel = v_channel.at(2);
cv::Mat merge_image;
cv::merge(v_channel, merge_image);