我试图将两个图像复制到一个大图像,但不幸的是我无法插入只有1个图像以下尝试:
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,imageOne.cols,imageOne.rows))); viewImage(totalImage,title); }
我的错误:
解决方法
更改
Mat totalImage(Size(totalCol,3);
至
Mat totalImage(Size(totalCol,imageOne.type());