2012-11-01 48 views
4

我想兩個圖像複製到一個大的圖像,但不幸的是我無法用下面的嘗試只插入1圖像:複製兩個圖像到一個圖像與OpenCV的2.4.2

void showTwoImages(Mat imageOne, Mat imageTwo, string title) { 
    int totalCol = imageOne.cols+imageTwo.cols; 
    int totalRow = imageOne.rows; 

    Mat totalImage(Size(totalCol, totalRow), 8, 3); 

    imageOne.copyTo(totalImage(Rect(0,0,imageOne.cols, imageOne.rows))); 

    viewImage(totalImage, title); 
} 

我的錯誤:

enter image description here

不幸的是,我不從在Xcode中得到一個特定的錯誤,但參考彙編代碼,所以我無法判斷出現錯誤。

回答

5

變化

Mat totalImage(Size(totalCol, totalRow), 8, 3); 

Mat totalImage(Size(totalCol, totalRow), imageOne.type()); 
相關問題