OPENCV创建一定大小的矩阵的高度错误-C

OpenCV creating a matrix of certain size has the wrong height - C++

本文关键字:错误 高度 创建 OPENCV      更新时间:2023-10-16

我正在尝试创建一个尺寸的矩阵,这是两个现有图像的两个维度的最大值。我的代码如下:

    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;

我遇到的问题是,当我打印出每个框架的行时,它们都是711(应该是),但所产生的宽度为720 ..我应该是711,不知道它在哪里更改是一个简单的作业。

正在打印我们的框架行的错误值。