From 711089b451ea8eae4d93da18f1e6bed5c5fbf30e Mon Sep 17 00:00:00 2001 From: Messier Date: Thu, 5 Sep 2019 17:03:02 +0800 Subject: [PATCH] refactor(*): add def:-DOUTPUT to util/base.h --- src/mynteye/api/camera_models/equidistant_camera.cc | 9 +++++++-- src/mynteye/api/camera_models/util/base.h | 1 + src/mynteye/api/processor/rectify_processor.cc | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mynteye/api/camera_models/equidistant_camera.cc b/src/mynteye/api/camera_models/equidistant_camera.cc index cec6a75..6f5d83a 100644 --- a/src/mynteye/api/camera_models/equidistant_camera.cc +++ b/src/mynteye/api/camera_models/equidistant_camera.cc @@ -455,7 +455,6 @@ void EquidistantCamera::initUndistortMap( cv::Mat EquidistantCamera::initUndistortRectifyMap( cv::Mat &map1, cv::Mat &map2, float fx, float fy, cv::Size imageSize, float cx, float cy, cv::Mat rmat) const { - std::cout <<"w0"; if (imageSize == cv::Size(0, 0)) { imageSize = cv::Size(mParameters.imageWidth(), mParameters.imageHeight()); } @@ -639,7 +638,9 @@ void EquidistantCamera::backprojectSymmetric( if (npow >= 9) { coeffs(9) = mParameters.k5(); } +#ifdef _DOUTPUT std::cout << std::endl << std::endl << "coeffs:" << coeffs; +#endif if (npow == 1) { theta = p_u_norm; } else { @@ -649,15 +650,19 @@ void EquidistantCamera::backprojectSymmetric( A.setZero(); A.block(1, 0, npow - 1, npow - 1).setIdentity(); A.col(npow - 1) = -coeffs.block(0, 0, npow, 1) / coeffs(npow); - std::cout << std::endl <<"A:" << A; +#ifdef _DOUTPUT + std::cout << std::endl <<"A:" << A; +#endif models::EigenSolver es(A); models::Matrix eigval(9, 2); eigval = es.eigenvalues(); // models::EigenSolver es(A); // models::MatrixXcd eigval(npow, 2); // eigval = es.eigenvalues(); +#ifdef _DOUTPUT std::cout << std::endl <<"eigval:" << eigval; +#endif std::vector thetas; for (int i = 0; i < eigval.rows(); ++i) { if (fabs(eigval(i, 1)) > tol) { // imag diff --git a/src/mynteye/api/camera_models/util/base.h b/src/mynteye/api/camera_models/util/base.h index 8d529aa..d30e70c 100644 --- a/src/mynteye/api/camera_models/util/base.h +++ b/src/mynteye/api/camera_models/util/base.h @@ -22,6 +22,7 @@ #include "mynteye/mynteye.h" +// #define _DOUTPUT MYNTEYE_BEGIN_NAMESPACE namespace models { diff --git a/src/mynteye/api/processor/rectify_processor.cc b/src/mynteye/api/processor/rectify_processor.cc index 230595e..242df4f 100644 --- a/src/mynteye/api/processor/rectify_processor.cc +++ b/src/mynteye/api/processor/rectify_processor.cc @@ -333,6 +333,7 @@ std::shared_ptr RectifyProcessor::stereoRectify( image_size1, &c_R, &c_t, &c_R1, &c_R2, &c_P1, &c_P2, &T_mul_f, &cx1_min_cx2); +#ifdef _DOUTPUT std::cout << "K1: " << K1 << std::endl; std::cout << "D1: " << D1 << std::endl; std::cout << "K2: " << K2 << std::endl; @@ -343,7 +344,7 @@ std::shared_ptr RectifyProcessor::stereoRectify( std::cout << "R2: " << R2 << std::endl; std::cout << "P1: " << P1 << std::endl; std::cout << "P2: " << P2 << std::endl; - +#endif R1 = rectifyrad(R1); R2 = rectifyrad(R2); @@ -404,7 +405,6 @@ void RectifyProcessor::InitParams( IntrinsicsEquidistant in_left, IntrinsicsEquidistant in_right, Extrinsics ex_right_to_left) { - LOG(INFO) <<"q1"; calib_model = CalibrationModel::KANNALA_BRANDT; in_left.ResizeIntrinsics(); in_right.ResizeIntrinsics();