我正在尝试将两张图片复制到一张大图片中,但不幸的是,我无法插入只有一张图片并尝试以下操作:
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);
}
我的错误:
不幸的是我没有从XCode中获得特定错误,而是引用汇编程序代码,因此我无法确定发生的错误。
答案 0 :(得分:5)
更改
Mat totalImage(Size(totalCol, totalRow), 8, 3);
到
Mat totalImage(Size(totalCol, totalRow), imageOne.type());