Question

I'm having this error on OpenCV 2.4.2 about this.

I'm using this line of code:

 cv::calcOpticalFlowPyrLK(prev, next, prev_pts, next_pts, status, error);

And on compile time it shows this error:

testopticalflow.cpp:75:4: error: ‘calcOpticalFlowPyrLK’ is not a member of ‘cv’

This is the result if I use pkg-config

pkg-config opencv --libs
/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so  

Sorry I'm still a newbie when it comes to Linux environment so I have no idea where I went wrong.

Was it helpful?

Solution

Sorry, stupid mistake. I forgot to add this as header:

#include <opencv2/video/tracking.hpp>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top