0

I have some problem with new calcOpticalFlowPyrLK function on opencv 2.4.2. This is my old function and parameters :

calcOpticalFlowPyrLK(prevImg, currentImg, prevPts, nextPts, status, err, Size(15,15),3, TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 100, 0.02),OPTFLOW_USE_INITIAL_FLOW,0.0001);

It works with OpenCV 2.4.1 but now i try to use it on OpenCV 2.4.2 .It gives this error:

/src/NaturalFeatureRecognition/OpticalFlowTracker.cpp:164: error: undefined reference to 'cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::Size_<int>, int, cv::TermCriteria, int, double)'

3 Answers 3

2

Make sure that you linked all OpenCV libraries in project settings - I don't think that prototype of this function was changed in new OpenCV version.

2
  • 1
    you are right thank you , i forgot "opencv_video" and now it works.
    – Pekaziz
    Jul 16, 2012 at 13:05
  • @Astor thanks. I got it already, it seems my error is missing header and not the linked library.
    – IBG
    Jul 25, 2012 at 10:44
2

You forgot to add this as header:

#include <opencv2/video/tracking.hpp>
0

In my case(Opencv2.4.8 +QT) i had to add the path to the libopencv_video248.dll.a in the pro-file of my project: LIBS += C:\\Opencv2.4.8\\install\\x64\\mingw\\lib\\libopencv_video248.dll.a

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.