fix(synthetic): disable order

This commit is contained in:
TinyOh 2019-01-16 11:08:16 +08:00
parent effa0ba2ad
commit b4ddf5a816

View File

@ -534,6 +534,7 @@ void Synthetic::DisableStreamData(const Stream &stream, std::uint32_t depth) {
} }
} break; } break;
case Stream::DISPARITY: { case Stream::DISPARITY: {
if (calib_model_ == CalibrationModel::PINHOLE) {
if (IsStreamEnabledSynthetic(Stream::DISPARITY_NORMALIZED)) { if (IsStreamEnabledSynthetic(Stream::DISPARITY_NORMALIZED)) {
DisableStreamData(Stream::DISPARITY_NORMALIZED, depth + 1); DisableStreamData(Stream::DISPARITY_NORMALIZED, depth + 1);
} }
@ -541,6 +542,20 @@ void Synthetic::DisableStreamData(const Stream &stream, std::uint32_t depth) {
DisableStreamData(Stream::POINTS, depth + 1); DisableStreamData(Stream::POINTS, depth + 1);
} }
DeactivateProcessor<DisparityProcessor>(); DeactivateProcessor<DisparityProcessor>();
#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<DisparityProcessor>();
#endif
} else {
LOG(ERROR) << "Unknow calib model type in device: "
<< calib_model_;
}
} break; } break;
case Stream::DISPARITY_NORMALIZED: { case Stream::DISPARITY_NORMALIZED: {
DeactivateProcessor<DisparityNormalizedProcessor>(); DeactivateProcessor<DisparityNormalizedProcessor>();
@ -565,7 +580,7 @@ void Synthetic::DisableStreamData(const Stream &stream, std::uint32_t depth) {
DeactivateProcessor<DepthProcessorOCV>(); DeactivateProcessor<DepthProcessorOCV>();
#ifdef WITH_CAM_MODELS #ifdef WITH_CAM_MODELS
} else if (calib_model_ == CalibrationModel::KANNALA_BRANDT) { } else if (calib_model_ == CalibrationModel::KANNALA_BRANDT) {
if (IsStreamEnabledSynthetic(Stream::DEPTH)) { if (IsStreamEnabledSynthetic(Stream::POINTS)) {
DisableStreamData(Stream::POINTS, depth + 1); DisableStreamData(Stream::POINTS, depth + 1);
} }
DeactivateProcessor<DepthProcessor>(); DeactivateProcessor<DepthProcessor>();