Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can allocate a matrix of the correct size and then copy the images into the new matrix manually with the following:

cv::cuda::GpuMat NewImg(img1.rows, img1.cols + img2.cols, img1.type); img1.copyTo(NewImg(cv::Rect(0,0,img1.cols,img1.rows))); img2.copyTo(NewImg(cv::Rect(img1.cols,img1.rows, img2.cols,img2.rows)));

click to hide/show revision 2
No.2 Revision

updated 2020-10-01 09:04:40 -0600

berak gravatar image

You can allocate a matrix of the correct size and then copy the images into the new matrix manually with the following:

cv::cuda::GpuMat NewImg(img1.rows, img1.cols + img2.cols, img1.type);
img1.copyTo(NewImg(cv::Rect(0,0,img1.cols,img1.rows)));
img2.copyTo(NewImg(cv::Rect(img1.cols,img1.rows, img2.cols,img2.rows)));

img2.cols,img2.rows)));