【问题标题】:function cv::findChessboardCorners corners cannot be std::vector<cv::Point2f>函数 cv::findChessboardCorners 角不能是 std::vector<cv::Point2f>
【发布时间】:2016-03-05 14:48:52
【问题描述】:

我有一个问题,当我在Qt-MinGW平台上运行findChessboardCorners时,我可以得到正确的board_feature_locations_xy结果,但是当我在VS2015平台上运行相同的代码时,我得到了错误的结果,但是如果我将定义 std::vector&lt;cv::Point2f&gt; board_feature_locations_xy; 更改为 cv::Mat board_feature_locations_xy; 我可以得到正确的结果。 那么任何人都可以解决这个问题吗? 我用的是opencv-3.1.0。

std::vector<cv::Point2f>  board_feature_locations_xy;
cv::Size board_feature_size(8, 6);
cv::findChessboardCorners(calibration_image_cv, board_feature_size, board_feature_locations_xy, CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FILTER_QUADS);

【问题讨论】:

    标签: c++ opencv opencv3.1


    【解决方案1】:

    我遇到了类似的问题,当我在系统上本地构建 Opencv 而不是使用预构建的库时,它得到了解决。您可以参考此线程在您的系统上构建 Opencv Where is the lib folder (or its replacement) in the current OpenCV?

    我还更改了相机校准代码以适用于 cv::Mat 点缓冲区类型而不是矢量。如果您正在进行相机校准并且遇到了这个问题,那么唯一的改变是您使用 imagePoints1.push_back(board_feature_loactions_xy) 作为角落为棋盘检测到的。

    【讨论】:

    • 我也用过Cmake构建的openCV lib,在vs2015 x64平台上。我不知道如何进一步解决这个问题。不知道为什么同一个openCV源码不能移植到不同平台上。
    • 你是在使用棋盘进行校准吗?如果是这样,您可以轻松更改使用数据类型为 Mat 的代码,以便获得相机的校准值。
    • 是的,我想我现在必须将数据类型更改为 Mat,方法如下:stackoverflow.com/questions/31441204/…
    • 我有另一个关于 cv::calibrateCamera 在 vs2015 x64 平台上的错误,reproj_error = cv::calibrateCamera(this->object_points_xyz_, this->image_points_xy_,calibration_model_size,intrinsic,distortion,rotation_vector, translation_vector, cv_calibration_flags );
    • 如果您共享代码或编写正确的错误,我将能够帮助和调试您的代码。目前的信息不足以提出任何解决方案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多