Enable OpenCV4 compability

This commit is contained in:
JFilipe committed 2019-02-25 18:09:43 +00:00
1 parent b20d5aef49
commit 2eec03b23f
5 files changed
+22 -3

No files matched your search

+2 -2
View File
@@ -58,7 +58,7 @@ bool DisparityStereoSGBM::create( std::vector<CalypFrame*> apcFrameList )
}
m_uiNumberOfDisparities = ( ( apcFrameList[0]->getWidth() / 8 ) + 15 ) & -16;
int cn = apcFrameList[0]->getNumberChannels();
#if( CV_MAJOR_VERSION == 3 )
#if( CV_MAJOR_VERSION >= 3 )
m_cStereoMatch = cv::StereoSGBM::create( 0, 16, m_uiBlockSize );
m_cStereoMatch->setPreFilterCap( 63 );
@@ -99,7 +99,7 @@ CalypFrame* DisparityStereoSGBM::process( std::vector<CalypFrame*> apcFrameList
return m_pcDisparityFrame;
}
cv::Mat disparityImage, disparityImage8;
#if( CV_MAJOR_VERSION == 3 )
#if( CV_MAJOR_VERSION >= 3 )
m_cStereoMatch->compute( leftImage, rightImage, disparityImage );
#else
m_cStereoMatch( leftImage, rightImage, disparityImage );
+1 -1
View File
@@ -60,7 +60,7 @@ private:
bool m_bUseHH;
int m_uiNumberOfDisparities;
unsigned int m_uiBlockSize;
#if( CV_MAJOR_VERSION == 3 )
#if( CV_MAJOR_VERSION >= 3 )
cv::Ptr<cv::StereoSGBM> m_cStereoMatch;
#else
cv::StereoSGBM m_cStereoMatch;
+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;
+4
View File
@@ -166,7 +166,11 @@ bool OpticalFlowDualTVL1::create( std::vector<CalypFrame*> apcFrameList )
bool bRet = commonCreate( apcFrameList );
if( !bRet )
return bRet;
#if CV_MAJOR_VERSION >= 4
m_cOpticalFlow = cv::optflow::createOptFlow_DualTVL1();
#else
m_cOpticalFlow = cv::createOptFlow_DualTVL1();
#endif
return bRet;
}