When I want to call calcOpticalFlowFarneback( ) to caculate the dense optical flow, then the compiler show me an error:
undefined reference to `cv::calcOpticalFlowFarneback. The reason for this error is project not include related libraries(for this case, include the video module, so need include
opencv_video ).
My solution for this: at first include opencv.hpp in the io.hpp:
#include <opencv2/opencv.hpp>
And also I need modify the MakeFile, at there(add the red part!):
LIBRARIES += pthread \
glog gflags protobuf leveldb snappy \
lmdb \
boost_system \
hdf5_hl hdf5 \
opencv_core opencv_highgui opencv_imgproc opencv_gpu opencv_video opencv_objdetect
Ok, let's re-compile the project we will find that there no error occurs!