From 7985a8ffe7abe207a0750542dc68517cab606e91 Mon Sep 17 00:00:00 2001 From: TinyOh Date: Mon, 14 Jan 2019 17:28:57 +0800 Subject: [PATCH] fix(calib models): use shared ptr value change instead of ptr change --- src/mynteye/api/processor/rectify_processor.cc | 14 +++++++++++--- src/mynteye/api/processor/rectify_processor.h | 4 ---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/mynteye/api/processor/rectify_processor.cc b/src/mynteye/api/processor/rectify_processor.cc index cf34e73..6a130bc 100644 --- a/src/mynteye/api/processor/rectify_processor.cc +++ b/src/mynteye/api/processor/rectify_processor.cc @@ -339,13 +339,21 @@ void RectifyProcessor::InitParams( generateCameraFromIntrinsicsEquidistant(in_left); camodocal::CameraPtr camera_odo_ptr_right = generateCameraFromIntrinsicsEquidistant(in_right); - calib_infos = - stereoRectify(camera_odo_ptr_left, + if (calib_infos) { + auto calib_info_tmp = stereoRectify(camera_odo_ptr_left, + camera_odo_ptr_right, + in_left, + in_right, + ex_right_to_left); + *calib_infos = *calib_info_tmp; + } else { + calib_infos = + stereoRectify(camera_odo_ptr_left, camera_odo_ptr_right, in_left, in_right, ex_right_to_left); - + } cv::Mat rect_R_l = cv::Mat::eye(3, 3, CV_32F), rect_R_r = cv::Mat::eye(3, 3, CV_32F); for (size_t i = 0; i < 3; i++) { diff --git a/src/mynteye/api/processor/rectify_processor.h b/src/mynteye/api/processor/rectify_processor.h index 5929dfc..147bc1e 100644 --- a/src/mynteye/api/processor/rectify_processor.h +++ b/src/mynteye/api/processor/rectify_processor.h @@ -23,11 +23,7 @@ #include "mynteye/types.h" #include "mynteye/api/processor.h" #include "mynteye/device/device.h" -#include -#include #include -#include -#include #include #include #include