2013-01-06 63 views

回答

3

對於這樣的任務有merge()。我假設你使用C++作爲下面的示例代碼,但是這個函數也可用於C和Python(請參閱文檔)。

// Suppose you have 3 matrices (instances of class cv::Mat) 
// named channelR, channelG and channelB that hold your data 
std::vector<cv::Mat> channels; 
channels.push_back(channelR); 
channels.push_back(channelG); 
channels.push_back(channelB); 

cv::Mat outputImage; 
merge(channels, outputImage); 
+0

偉大的傢伙,它工作正常。 +1 – ttokic