There added parallel realization of vertical passes for MODE_HH4.

pull/8660/head
Pyotr Chekmaryov 8 years ago
parent 106413a3ea
commit 20036b82d3
  1. 3
      modules/calib3d/include/opencv2/calib3d.hpp
  2. 1084
      modules/calib3d/src/stereosgbm.cpp
  3. 25
      modules/calib3d/test/test_stereomatching.cpp

@ -1810,7 +1810,8 @@ public:
MODE_SGBM = 0,
MODE_HH = 1,
MODE_SGBM_3WAY = 2,
MODE_HH4 = 3
MODE_HH4 = 3,
MODE_HH4_OLD = 4
};
CV_WRAP virtual int getPreFilterCap() const = 0;

File diff suppressed because it is too large Load Diff

@ -797,20 +797,23 @@ TEST(Calib3d_StereoSGBMPar, idontknowhowtotesthere)
// int mode)
Mat leftImg = imread("/home/q/Work/GitVault/opencv_extra/testdata/cv/stereomatching/datasets/teddy/im2.png");
Mat rightImg = imread("/home/q/Work/GitVault/opencv_extra/testdata/cv/stereomatching/datasets/teddy/im6.png");
Mat leftDisp_old, leftDisp_new;
{
Mat leftDisp;
Ptr<StereoSGBM> sgbm = StereoSGBM::create( 0, 48, 3, 90, 360, 1, 63, 10, 100, 32, StereoSGBM::MODE_HH);
sgbm->compute( leftImg, rightImg, leftDisp );
CV_Assert( leftDisp.type() == CV_16SC1 );
leftDisp/=8;
imwrite( "/home/q/Work/GitVault/modehh.jpg", leftDisp);
Ptr<StereoSGBM> sgbm = StereoSGBM::create( 0, 48, 3, 90, 360, 1, 63, 10, 100, 32, StereoSGBM::MODE_HH4);
sgbm->compute( leftImg, rightImg, leftDisp_new );
CV_Assert( leftDisp_new.type() == CV_16SC1 );
// leftDisp/=8;
// imwrite( "/home/q/Work/GitVault/modehh4_new.jpg", leftDisp);
}
{
Mat leftDisp;
Ptr<StereoSGBM> sgbm = StereoSGBM::create( 0, 48, 3, 90, 360, 1, 63, 10, 100, 32, StereoSGBM::MODE_HH4);
sgbm->compute( leftImg, rightImg, leftDisp );
CV_Assert( leftDisp.type() == CV_16SC1 );
leftDisp/=8;
imwrite( "/home/q/Work/GitVault/modehh4.jpg", leftDisp);
Ptr<StereoSGBM> sgbm = StereoSGBM::create( 0, 48, 3, 90, 360, 1, 63, 10, 100, 32, StereoSGBM::MODE_HH4_OLD);
sgbm->compute( leftImg, rightImg, leftDisp_old );
CV_Assert( leftDisp_old.type() == CV_16SC1 );
// leftDisp/=8;
// imwrite( "/home/q/Work/GitVault/modehh4_old.jpg", leftDisp);
}
Mat diff;
absdiff(leftDisp_old,leftDisp_new,diff);
CV_Assert( countNonZero(diff)==0);
}

Loading…
Cancel
Save