From c8dbeeff222fb7e48a54d6c1de0a0c74736c3073 Mon Sep 17 00:00:00 2001 From: Osenberg Date: Fri, 11 Jan 2019 23:22:37 +0800 Subject: [PATCH] fix(device.cc): get img params bug --- src/mynteye/device/device.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mynteye/device/device.cc b/src/mynteye/device/device.cc index 372d62e..62b0cf6 100644 --- a/src/mynteye/device/device.cc +++ b/src/mynteye/device/device.cc @@ -640,7 +640,13 @@ void Device::UpdateStreamIntrinsics( for (auto &¶ms : all_img_params_) { auto &&img_res = params.first; auto &&img_params = params.second; - if (img_params.ok && img_res == request.GetResolution()) { + bool ok = false; + if (capability == Capabilities::STEREO_COLOR) { + ok = img_params.ok && img_res.width == request.GetResolution().width / 2; + } else if (capability == Capabilities::STEREO) { + ok = img_params.ok && img_res == request.GetResolution(); + } + if (ok) { SetIntrinsics(Stream::LEFT, img_params.in_left); SetIntrinsics(Stream::RIGHT, img_params.in_right); SetExtrinsics(Stream::LEFT, Stream::RIGHT, img_params.ex_right_to_left);