0
使用cv::imread
我能夠讀取RGB圖像cv::Mat
(如下)添加alpha通道的OpenCV墊
Mat picture = imread(fileName, -1);
代替讀,我嘗試使用以下代碼來創建的RGB圖像:
Mat arr1 = Mat(9, 9, CV_8UC1, &data1);
Mat arr2 = Mat(9, 9, CV_8UC1, &data2);
Mat arr3 = Mat(9, 9, CV_8UC1, &data3);
Mat pic;
vector<Mat> mk(3);
mk.at(0)=(arr1);
mk.at(1)=(arr2);
mk.at(2)=(arr3);
merge(mk,pic);
Mat picture
和Mat pic
是否相等? 由於cv::imread
有一個標誌'-1',表示'Return the loaded image as is (with alpha channel)'。我不能理解,我如何匹配'圖片'到'圖片'?(不是圖片來源)