Add DisparityStereoSGBM module
This commit is contained in:
1 parent
42f42fb1a1
commit
1b013e43f8
8 files changed
+223
-12
No files matched your search
@@ -34,8 +34,8 @@ DisparityStereoBM::DisparityStereoBM()
|
||||
/* Module Definition */
|
||||
m_iModuleAPI = MODULE_API_2;
|
||||
m_iModuleType = FRAME_PROCESSING_MODULE;
|
||||
m_pchModuleCategory = "Disparity";
|
||||
m_pchModuleName = "BlockMatching";
|
||||
m_pchModuleCategory = "Stereo";
|
||||
m_pchModuleName = "Disparity-BM";
|
||||
m_pchModuleTooltip = "Measure the disparity between two images using the Stereo BM method (OpenCV)";
|
||||
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
|
||||
m_uiModuleRequirements = MODULE_REQUIRES_SKIP_WHILE_PLAY | MODULE_REQUIRES_NEW_WINDOW | MODULE_REQUIRES_OPTIONS;
|
||||
@@ -56,6 +56,7 @@ Bool DisparityStereoBM::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
{
|
||||
m_uiBlockSize++;
|
||||
}
|
||||
m_uiNumberOfDisparities = ( ( apcFrameList[0]->getWidth() / 8 ) + 15 ) & -16;
|
||||
#if( CV_MAJOR_VERSION == 2)
|
||||
m_cStereoBM.state->preFilterCap = 31;
|
||||
m_cStereoBM.state->SADWindowSize = 9;
|
||||
@@ -66,13 +67,13 @@ Bool DisparityStereoBM::create( std::vector<PlaYUVerFrame*> apcFrameList )
|
||||
m_cStereoBM.state->speckleRange = 32;
|
||||
m_cStereoBM.state->disp12MaxDiff = 1;
|
||||
m_cStereoBM.state->SADWindowSize = m_uiBlockSize;
|
||||
m_cStereoBM.state->numberOfDisparities = ( ( ( apcFrameList[0]->getWidth() / 8 ) + 15 ) & -16 );
|
||||
m_cStereoBM.state->numberOfDisparities = m_uiNumberOfDisparities;
|
||||
#else
|
||||
m_cStereoBM = cv::StereoBM::create( 16, m_uiBlockSize );
|
||||
m_cStereoBM->setPreFilterCap( 31 );
|
||||
m_cStereoBM->setBlockSize( m_uiBlockSize );
|
||||
m_cStereoBM->setMinDisparity( 0 );
|
||||
m_cStereoBM->setNumDisparities( ( ( ( apcFrameList[0]->getWidth() / 8 ) + 15 ) & -16 ) );
|
||||
m_cStereoBM->setNumDisparities( m_uiNumberOfDisparities );
|
||||
m_cStereoBM->setTextureThreshold( 10 );
|
||||
m_cStereoBM->setUniquenessRatio( 15 );
|
||||
m_cStereoBM->setSpeckleWindowSize( 100 );
|
||||
|
||||
Reference in new issue
Block a user