From 58464510f69e7d793b690876a57f618acb797164 Mon Sep 17 00:00:00 2001 From: TinyOh Date: Mon, 28 Jan 2019 11:11:20 +0800 Subject: [PATCH] fix(disparity): opencv2.0 logic --- src/mynteye/api/processor/disparity_processor.cc | 5 +++-- wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mynteye/api/processor/disparity_processor.cc b/src/mynteye/api/processor/disparity_processor.cc index 7816789..b2e86e2 100644 --- a/src/mynteye/api/processor/disparity_processor.cc +++ b/src/mynteye/api/processor/disparity_processor.cc @@ -46,7 +46,7 @@ DisparityProcessor::DisparityProcessor(DisparityComputingMethod type, 100, // speckleWindowSize 32, // speckleRange false)); // fullDP - LOG(ERROR) << "not supported in opencv 2.x"; + LOG(ERROR) << "BM not supported in opencv 2.x, use sgbm"; // int bmWinSize = 3; // // StereoBM // // https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#stereobm-stereobm @@ -130,7 +130,8 @@ bool DisparityProcessor::OnProcess( if (type_ == DisparityComputingMethod::SGBM) { (*sgbm_matcher)(input->first, input->second, disparity); } else if (type_ == DisparityComputingMethod::BM) { - LOG(ERROR) << "not supported in opencv 2.x"; + // LOG(ERROR) << "not supported in opencv 2.x"; + (*sgbm_matcher)(input->first, input->second, disparity); // cv::Mat tmp1, tmp2; // cv::cvtColor(input->first, tmp1, CV_RGB2GRAY); // cv::cvtColor(input->second, tmp2, CV_RGB2GRAY); diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch index 8a571db..4eae1e0 100644 --- a/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch +++ b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch @@ -59,7 +59,7 @@ - +