Programming/openCV2014. 7. 3. 14:02
core.hpp에 선언되어 있는 split을 사용하면 된다.
//! makes multi-channel array out of several single-channel arrays
CV_EXPORTS void merge(const Mat* mv, size_t count, OutputArray dst);
//! makes multi-channel array out of several single-channel arrays
CV_EXPORTS_W void merge(const vector<Mat>& mv, OutputArray dst);
    
//! copies each plane of a multi-channel array to a dedicated array
CV_EXPORTS void split(const Mat& src, Mat* mvbegin);
//! copies each plane of a multi-channel array to a dedicated array
CV_EXPORTS_W void split(const Mat& m, CV_OUT vector<Mat>& mv); 

vector<Mat> 형으로 변수를 선언하여
split(src, dst); 식으로 사용하면 되며
imshow에서 channel[0] 이런식으로 하면 채널별로 출력하면 된다.

[링크 : http://opencvexamples.blogspot.com/2013/10/split-and-merge-functions.html#.U7TjMPl_vKl]
[링크 : http://compvisionlab.wordpress.com/2013/03/07/opencv-basics-splitting-rgb-channels/]
[링크 : http://denislantsman.com/?p=103]
[링크 : http://baram4815.tistory.com/entry/OpenCV-2이미지에서-RGB-채널-분리
[링크 : http://baram4815.tistory.com/entry/OpenCVsplit-and-merge]
Posted by 구차니