[英]OpenCV creating a matrix of certain size has the wrong height - C++
I am trying to create a matrix of dimensions that are the max of both dimensions from two existing images. 我正在尝试创建一个尺寸矩阵,该尺寸矩阵是两个现有图像中两个尺寸的最大值。 My code is below:
我的代码如下:
int width = 0, height = 0;
(frameOne.cols >= frameTwo.cols) ? width = frameOne.cols : width = frameTwo.cols;
(frameOne.rows >= frameTwo.rows) ? height = frameOne.rows : height = frameTwo.rows;
cout << "frameone: " << frameOne.cols << " " << frameTwo.rows << endl;
cout << "frametwo: " << frameTwo.cols << " " << frameTwo.rows << endl;
cout << "Width: " << width << endl;
cout << "Height: " << height << endl;
The issue that I am having is that when I print out the rows of each frame they are all 711 (as they should be) but the resulting width is 720.. I should just be 711 and do not know where it is getting changed as it is a simple assignment. 我遇到的问题是,当我打印出每一帧的行时,它们全都是711(应该是它们),但是结果宽度是720。我应该只是711,不知道它在哪里改变了这是一个简单的任务。
正在为frameOne的行打印错误的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.