简体   繁体   中英

function cv::findChessboardCorners corners cannot be std::vector<cv::Point2f>

I have a question, when I run findChessboardCorners in the Qt-MinGW platform, I can get the correct board_feature_locations_xy results, but when I run the same code on the VS2015 platform, I get the wrong results, but if I change the definition std::vector<cv::Point2f> board_feature_locations_xy; to cv::Mat board_feature_locations_xy; I can get the correct results. So anyone can solve this problem? I use 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);

I had similar problem and it got fixed when I built Opencv locally on my system instead of using pre-built libraries. You can refer to this thread for building Opencv on your system Where is the lib folder (or its replacement) in the current OpenCV?

Also I changed the camera calibration code to work for cv::Mat point buffer type instead of vector.If you are doing camera calibration and you encountered this problem then only change is you use imagePoints1.push_back(board_feature_loactions_xy) for the corner that were detected for a chessboard .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM