OpenCV创建一定大小的矩阵具有错误的高度 - C ++

时间:2015-05-12 20:29:21

标签: c++ opencv matrix

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

    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而且不知道它在哪里因为它是一个简单的任务而被改变。

1 个答案:

答案 0 :(得分:0)

为frameOne行打印错误的值。