Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Size is Size(width, height), you simply reversed it here:

Mat merged = Mat(Size(imgFixedSize*height*2, imgFixedSize*width*2), CV_8UC3);

this would be ok:

Mat merged = Mat(imgFixedSize*height*2, imgFixedSize*width*2, CV_8UC3);

or that:

Mat merged = Mat(Size(imgFixedSize*width*2, imgFixedSize*height*2), CV_8UC3);

Size is Size(width, height), you simply reversed it here:

Mat merged = Mat(Size(imgFixedSize*height*2, imgFixedSize*width*2), CV_8UC3);

this would be ok:

Mat merged = Mat(imgFixedSize*height*2, imgFixedSize*width*2, CV_8UC3);

or that:

Mat merged = Mat(Size(imgFixedSize*width*2, imgFixedSize*height*2), CV_8UC3);

again, just a simple typo, you're almost there !

Size is Size(width, height), while the Mat constructor is Mat(H,W,...) . you simply reversed it here:

Mat merged = Mat(Size(imgFixedSize*height*2, imgFixedSize*width*2), CV_8UC3);

this would be ok:

Mat merged = Mat(imgFixedSize*height*2, imgFixedSize*width*2, CV_8UC3);

or that:

Mat merged = Mat(Size(imgFixedSize*width*2, imgFixedSize*height*2), CV_8UC3);

again, just a simple typo, you're almost there !

Size is Size(width, height), while the Mat constructor is Mat(H,W,...) . you simply reversed it here:

Mat merged = Mat(Size(imgFixedSize*height*2, imgFixedSize*width*2), Mat(Size(imgFixedSize.height*2, imgFixedSize.width*2), CV_8UC3);

this would be ok:

Mat merged = Mat(imgFixedSize*height*2, imgFixedSize*width*2, Mat(imgFixedSize.height*2, imgFixedSize.width*2, CV_8UC3);

or that:

Mat merged = Mat(Size(imgFixedSize*width*2, imgFixedSize*height*2), Mat(Size(imgFixedSize.width*2, imgFixedSize.height*2), CV_8UC3);

again, just a simple typo, you're almost there !

(oh, and also size.width, not size*width , thanks @LBerger.)