OpenCV (C ++ / Qt) - cornerSubPix error

Hello!

I'm having problems with the cornerSubPix method from the imgproc.hpp file. I do not understand which library is missing or which error. I work with Qt 5.4.1 on OS X 10.10.3 and using the OpenCV 3.0.0 C ++ library.

Here is my code:

#include <opencv2/opencv.hpp> #include <opencv2/core/types.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/features2d/features2d.hpp> #include <vector> #include <stdio.h> #include "cameraparams.h" #include <iostream> [...] vector< vector <Point2f> > left_2D_points, right_2D_points; for( int i=0;i<left_images.size();i++){ Mat left_image = left_images[i]; Mat rig ht_image = right_images[i]; std::vector<cv::Point2f> left_im_points,right_im_points; bool found_left = findChessboardCorners(left_image,Size(width,height),left_im_points,CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE+ CALIB_CB_FAST_CHECK); bool found_right = findChessboardCorners(right_image,Size(width,height),right_im_points,CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE+ CALIB_CB_FAST_CHECK); if( found_left && found_right){ Size winSize = Size( 7, 7 ); Size zeroZone = Size( -1, -1 ); TermCriteria criteria = TermCriteria( TermCriteria::EPS + TermCriteria::MAX_ITER, 40, 0.001 ); cv::cornerSubPix(left_image,left_im_points,winSize,zeroZone,criteria); } } 

And here is my * .pro file:

 INCLUDEPATH += /usr/local/include/ \ /usr/local/include/pcl-1.7/ \ /usr/local/include/eigen3/ \ /usr/local/include/vtk-6.2/ LIBS += -L/usr/local/lib \ -lopencv_core \ -lopencv_imgcodecs \ -lopencv_highgui \ -lopencv_imgproc \ -lopencv_objdetect \ -lopencv_calib3d \ -lopencv_features2d \ -lopencv_flann \ -lopencv_ml \ -lopencv_photo \ -lopencv_shape \ -lopencv_stitching \ -lopencv_superres \ -lopencv_ts \ -lopencv_video \ -lopencv_videoio \ -lopencv_videostab 

So, I want to more accurately determine the angle on my chessboard. But when I compile, I get this error:

 Undefined symbols for architecture x86_64: "cv::_InputArray::getMatVector(std::vector<cv::Mat, std::allocator<cv::Mat> >&) const", referenced from: vtable for cv::_InputOutputArray in calibrator.o "cv::_InputArray::getUMatVector(std::vector<cv::UMat, std::allocator<cv::UMat> >&) const", referenced from: vtable for cv::_InputOutputArray in calibrator.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Classification] Error 1 

I have been looking for an answer since a few days, and I am already blocked. Thanks to everyone for any path!

+3
source share
2 answers

I had the same problem last time with the same configurations (Mac OS 10.10.3, Qt 5.4.1, OpenCV 3.0). It seems that the clang compiler is not compatible with opencv 3.0.

Using an old version of opencv (e.g. 2.4.10) may solve the problem.

Good luck and good luck :)

0
source

This problem was first described here . This seems to be related to the version of the C ++ standard library that your compiler uses. Several workarounds have been discussed in this thread.

However , fooobar.com/questions/147327 / ... seems to fix the problem.

Google is your friend.

0
source

All Articles