From b4ddf5a81679c6d3f0f1f67fdfc2a22f4fc91f08 Mon Sep 17 00:00:00 2001 From: TinyOh Date: Wed, 16 Jan 2019 11:08:16 +0800 Subject: [PATCH] fix(synthetic): disable order --- src/mynteye/api/synthetic.cc | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/mynteye/api/synthetic.cc b/src/mynteye/api/synthetic.cc index ca695fa..e1329d0 100644 --- a/src/mynteye/api/synthetic.cc +++ b/src/mynteye/api/synthetic.cc @@ -534,13 +534,28 @@ void Synthetic::DisableStreamData(const Stream &stream, std::uint32_t depth) { } } break; case Stream::DISPARITY: { - if (IsStreamEnabledSynthetic(Stream::DISPARITY_NORMALIZED)) { - DisableStreamData(Stream::DISPARITY_NORMALIZED, depth + 1); + if (calib_model_ == CalibrationModel::PINHOLE) { + if (IsStreamEnabledSynthetic(Stream::DISPARITY_NORMALIZED)) { + DisableStreamData(Stream::DISPARITY_NORMALIZED, depth + 1); + } + if (IsStreamEnabledSynthetic(Stream::POINTS)) { + DisableStreamData(Stream::POINTS, depth + 1); + } + DeactivateProcessor(); +#ifdef WITH_CAM_MODELS + } else if (calib_model_ == CalibrationModel::KANNALA_BRANDT) { + if (IsStreamEnabledSynthetic(Stream::DISPARITY_NORMALIZED)) { + DisableStreamData(Stream::DISPARITY_NORMALIZED, depth + 1); + } + if (IsStreamEnabledSynthetic(Stream::DEPTH)) { + DisableStreamData(Stream::DEPTH, depth + 1); + } + DeactivateProcessor(); +#endif + } else { + LOG(ERROR) << "Unknow calib model type in device: " + << calib_model_; } - if (IsStreamEnabledSynthetic(Stream::POINTS)) { - DisableStreamData(Stream::POINTS, depth + 1); - } - DeactivateProcessor(); } break; case Stream::DISPARITY_NORMALIZED: { DeactivateProcessor(); @@ -565,7 +580,7 @@ void Synthetic::DisableStreamData(const Stream &stream, std::uint32_t depth) { DeactivateProcessor(); #ifdef WITH_CAM_MODELS } else if (calib_model_ == CalibrationModel::KANNALA_BRANDT) { - if (IsStreamEnabledSynthetic(Stream::DEPTH)) { + if (IsStreamEnabledSynthetic(Stream::POINTS)) { DisableStreamData(Stream::POINTS, depth + 1); } DeactivateProcessor();