Enable OpenCV4 compability

This commit is contained in:
JFilipe
2019-02-25 18:09:43 +00:00
parent b20d5aef49
commit 2eec03b23f
5 changed files with 22 additions and 3 deletions
+7
View File
@@ -23,6 +23,9 @@
*/
#include "MeasureOpticalFlowDualTVL1.h"
#if CV_MAJOR_VERSION >= 4
#include <opencv2/optflow.hpp>
#endif
using cv::Mat;
using cv::Mat_;
@@ -61,7 +64,11 @@ bool MeasureOpticalFlowDualTVL1::create( std::vector<CalypFrame*> apcFrameList )
return false;
m_iStep = 16;
#if CV_MAJOR_VERSION >= 4
m_cTvl1 = cv::optflow::createOptFlow_DualTVL1();
#else
m_cTvl1 = cv::createOptFlow_DualTVL1();
#endif
m_pcOutputFrame = new CalypFrame( apcFrameList[0]->getWidth(), apcFrameList[0]->getHeight(), CLP_GRAY );
return true;