split Divides a multi-channel array into several single-channelarrays.
C++: void split(const Mat& mtx, Mat* mv)
C++: void split(const Mat& mtx, vector& mv)
其实还有一个函数merge可以实现相反的操作,简单说明如下:
merge Composes a multi-channel array from several single-channelarrays.
C++: void merge(const Mat* mv, size_t count, OutputArray dst)
C++: void merge(const vector& mv, OutputArray dst)
其示例代码如下:
#include "stdafx.h"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include
#include
using namespace cv;
int main( int argc, char** argv )
{
}
联系客服