From 41c882d0a7b8ed1c52908375e166e29672fe7b86 Mon Sep 17 00:00:00 2001 From: TinyOh Date: Tue, 15 Jan 2019 14:05:11 +0800 Subject: [PATCH] fix(process): opencv2 and remove some useless include --- src/mynteye/api/processor/disparity_processor.cc | 11 ++++++++--- src/mynteye/api/processor/rectify_processor.h | 3 --- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mynteye/api/processor/disparity_processor.cc b/src/mynteye/api/processor/disparity_processor.cc index 4454eab..b209291 100644 --- a/src/mynteye/api/processor/disparity_processor.cc +++ b/src/mynteye/api/processor/disparity_processor.cc @@ -160,10 +160,15 @@ bool DisparityProcessor::OnProcess( // It contains disparity values scaled by 16. So, to get the floating-point // disparity map, // you need to divide each disp element by 16. - if (type_ == SGBM) { + if (type_ == DisparityProcessorType::SGBM) { (*sgbm_matcher)(input->first, input->second, disparity); - } else if (type_ == BM) { - (*bm_matcher)(input->first, input->second, disparity); +#ifdef WITH_BM_SOBEL_FILTER + } else if (type_ == DisparityProcessorType::BM) { + cv::Mat tmp1, tmp2; + cv::cvtColor(input->first, tmp1, CV_RGB2GRAY); + cv::cvtColor(input->second, tmp2, CV_RGB2GRAY); + (*bm_matcher)(tmp1, tmp2, disparity); +#endif } #else // compute() diff --git a/src/mynteye/api/processor/rectify_processor.h b/src/mynteye/api/processor/rectify_processor.h index 147bc1e..7ebe2d8 100644 --- a/src/mynteye/api/processor/rectify_processor.h +++ b/src/mynteye/api/processor/rectify_processor.h @@ -25,9 +25,6 @@ #include "mynteye/device/device.h" #include #include -#include -#include -#include #include #include #include