refactor(*): add def:-DOUTPUT to util/base.h

This commit is contained in:
Messier 2019-09-05 17:03:02 +08:00
parent 789a6f4a0e
commit 711089b451
3 changed files with 10 additions and 4 deletions

View File

@ -455,7 +455,6 @@ void EquidistantCamera::initUndistortMap(
cv::Mat EquidistantCamera::initUndistortRectifyMap( cv::Mat EquidistantCamera::initUndistortRectifyMap(
cv::Mat &map1, cv::Mat &map2, float fx, float fy, cv::Size imageSize, cv::Mat &map1, cv::Mat &map2, float fx, float fy, cv::Size imageSize,
float cx, float cy, cv::Mat rmat) const { float cx, float cy, cv::Mat rmat) const {
std::cout <<"w0";
if (imageSize == cv::Size(0, 0)) { if (imageSize == cv::Size(0, 0)) {
imageSize = cv::Size(mParameters.imageWidth(), mParameters.imageHeight()); imageSize = cv::Size(mParameters.imageWidth(), mParameters.imageHeight());
} }
@ -639,7 +638,9 @@ void EquidistantCamera::backprojectSymmetric(
if (npow >= 9) { if (npow >= 9) {
coeffs(9) = mParameters.k5(); coeffs(9) = mParameters.k5();
} }
#ifdef _DOUTPUT
std::cout << std::endl << std::endl << "coeffs:" << coeffs; std::cout << std::endl << std::endl << "coeffs:" << coeffs;
#endif
if (npow == 1) { if (npow == 1) {
theta = p_u_norm; theta = p_u_norm;
} else { } else {
@ -649,15 +650,19 @@ void EquidistantCamera::backprojectSymmetric(
A.setZero(); A.setZero();
A.block(1, 0, npow - 1, npow - 1).setIdentity(); A.block(1, 0, npow - 1, npow - 1).setIdentity();
A.col(npow - 1) = -coeffs.block(0, 0, npow, 1) / coeffs(npow); 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::EigenSolver es(A);
models::Matrix<double> eigval(9, 2); models::Matrix<double> eigval(9, 2);
eigval = es.eigenvalues(); eigval = es.eigenvalues();
// models::EigenSolver es(A); // models::EigenSolver es(A);
// models::MatrixXcd eigval(npow, 2); // models::MatrixXcd eigval(npow, 2);
// eigval = es.eigenvalues(); // eigval = es.eigenvalues();
#ifdef _DOUTPUT
std::cout << std::endl <<"eigval:" << eigval; std::cout << std::endl <<"eigval:" << eigval;
#endif
std::vector<double> thetas; std::vector<double> thetas;
for (int i = 0; i < eigval.rows(); ++i) { for (int i = 0; i < eigval.rows(); ++i) {
if (fabs(eigval(i, 1)) > tol) { // imag if (fabs(eigval(i, 1)) > tol) { // imag

View File

@ -22,6 +22,7 @@
#include "mynteye/mynteye.h" #include "mynteye/mynteye.h"
// #define _DOUTPUT
MYNTEYE_BEGIN_NAMESPACE MYNTEYE_BEGIN_NAMESPACE
namespace models { namespace models {

View File

@ -333,6 +333,7 @@ std::shared_ptr<struct CameraROSMsgInfoPair> RectifyProcessor::stereoRectify(
image_size1, &c_R, &c_t, &c_R1, &c_R2, &c_P1, &c_P2, &T_mul_f, image_size1, &c_R, &c_t, &c_R1, &c_R2, &c_P1, &c_P2, &T_mul_f,
&cx1_min_cx2); &cx1_min_cx2);
#ifdef _DOUTPUT
std::cout << "K1: " << K1 << std::endl; std::cout << "K1: " << K1 << std::endl;
std::cout << "D1: " << D1 << std::endl; std::cout << "D1: " << D1 << std::endl;
std::cout << "K2: " << K2 << std::endl; std::cout << "K2: " << K2 << std::endl;
@ -343,7 +344,7 @@ std::shared_ptr<struct CameraROSMsgInfoPair> RectifyProcessor::stereoRectify(
std::cout << "R2: " << R2 << std::endl; std::cout << "R2: " << R2 << std::endl;
std::cout << "P1: " << P1 << std::endl; std::cout << "P1: " << P1 << std::endl;
std::cout << "P2: " << P2 << std::endl; std::cout << "P2: " << P2 << std::endl;
#endif
R1 = rectifyrad(R1); R1 = rectifyrad(R1);
R2 = rectifyrad(R2); R2 = rectifyrad(R2);
@ -404,7 +405,6 @@ void RectifyProcessor::InitParams(
IntrinsicsEquidistant in_left, IntrinsicsEquidistant in_left,
IntrinsicsEquidistant in_right, IntrinsicsEquidistant in_right,
Extrinsics ex_right_to_left) { Extrinsics ex_right_to_left) {
LOG(INFO) <<"q1";
calib_model = CalibrationModel::KANNALA_BRANDT; calib_model = CalibrationModel::KANNALA_BRANDT;
in_left.ResizeIntrinsics(); in_left.ResizeIntrinsics();
in_right.ResizeIntrinsics(); in_right.ResizeIntrinsics();