0
votes

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

3 Answers

2
votes

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
votes

You forgot to add this as header:

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

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