0

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);
Berriel
  • 12,659
  • 4
  • 43
  • 67
Chester
  • 21
  • 4

1 Answers1

0

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 .

Community
  • 1
  • 1
Nikita Chopra
  • 440
  • 9
  • 22
  • I have also used the openCV lib builded by Cmake, and on vs2015 x64 platform. I don't know how to solve this problem further. I don't know why the same openCV source code cann't be transplanted tran on different platform. – Chester Mar 07 '16 at 03:37
  • Are you doing calibration using chessboard. If so you can easily change the code which uses the data type as Mat so as you can get the calibration values for camera. – Nikita Chopra Mar 07 '16 at 03:54
  • Yes, I think I have to change the data type as Mat now, as following method: http://stackoverflow.com/questions/31441204/opencv-issue-with-findchessboardcorners – Chester Mar 07 '16 at 07:11
  • I have another error about cv::calibrateCamera on vs2015 x64 platform, reproj_error = cv::calibrateCamera(this->object_points_xyz_, this->image_points_xy_, calibration_model_size, intrinsic, distortion, rotation_vector, translation_vector, cv_calibration_flags); – Chester Mar 07 '16 at 09:35
  • If you share the code or write proper error I would be able to help and debug your code. The current information is not sufficient to suggest any solution. – Nikita Chopra Mar 07 '16 at 14:41
  • The problem has been solved, it's a linker issue. I link the release version of opencv against a debug build. – Chester Mar 08 '16 at 01:43