2012-07-25 64 views
0

我在OpenCV 2.4.2上有這個錯誤。錯誤:'calcOpticalFlowPyrLK'不是'cv'的成員 - OpenCV 2.4.2

我使用這行代碼:

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

而且在編譯的時候就顯示了這個錯誤:

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

這是結果,如果我用pkg配置

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 

對不起,我還是一個新手,當涉及到Linux環境,所以我不知道我錯了什麼地方。

回答

2

對不起,愚蠢的錯誤。 我忘了把它添加爲標題:

#include <opencv2/video/tracking.hpp>