Main MRPT website > C++ reference for MRPT 1.9.9
chessboard_stereo_camera_calib_internal.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #ifndef MRPT_VISION_INTERNAL_STEREO_CALIB_H
11 #define MRPT_VISION_INTERNAL_STEREO_CALIB_H
12 
14 #include <mrpt/poses/CPose3D.h>
15 #include <mrpt/math/geometry.h>
16 
17 namespace mrpt
18 {
19 namespace vision
20 {
21 // State of the Lev-Marq optimization:
22 struct lm_stat_t
23 {
25  const std::vector<size_t>& valid_image_pair_indices;
26  const std::vector<mrpt::math::TPoint3D>& obj_points;
27 
28  // State being optimized:
29  // N*left_cam_pose + right2left_pose + left_cam_params + right_cam_params
31  left_cam_poses; // Poses of the origin of coordinates of the pattern
32  // wrt the left camera
35  right_cam_params; // [fx fy cx cy k1 k2 k3 t1 t2]
36 
37  // Ctor
39  const TCalibrationStereoImageList& _images,
40  const std::vector<size_t>& _valid_image_pair_indices,
41  const std::vector<mrpt::math::TPoint3D>& _obj_points)
42  : images(_images),
43  valid_image_pair_indices(_valid_image_pair_indices),
44  obj_points(_obj_points)
45  {
46  left_cam_poses.assign(
47  images.size(), mrpt::poses::CPose3D(0, 0, 1, 0, 0, 0)); // Initial
48  }
49 
50  // Swap:
51  void swap(lm_stat_t& o)
52  {
54  std::swap(right2left_pose, o.right2left_pose);
55  std::swap(left_cam_params, o.left_cam_params);
56  std::swap(right_cam_params, o.right_cam_params);
57  }
58 };
59 
60 /** Data associated to *each observation* in the Lev-Marq. model */
62 {
63  /** [u_l v_l u_r v_r]: left/right camera pixels */
64  Eigen::Matrix<double, 4, 1> predicted_obs;
65  /** = predicted_obs - observations */
66  Eigen::Matrix<double, 4, 1> residual;
67  /** Jacobian. 4=the two predicted pixels; 30=Read below for the meaning of
68  * these 30 variables */
69  Eigen::Matrix<double, 4, 30> J;
70 };
71 
73  std::vector<mrpt::aligned_std_vector<TResidJacobElement>>;
74 
75 // Auxiliary functions for the Lev-Marq algorithm:
77  const lm_stat_t& lm_stat, TResidualJacobianList& res_jac,
78  bool use_robust_kernel, double kernel_param);
80  const TResidualJacobianList& res_jac, const std::vector<size_t>& var_indxs,
81  Eigen::VectorXd& minus_g, Eigen::MatrixXd& H);
82 void add_lm_increment(
83  const Eigen::VectorXd& eps, const std::vector<size_t>& var_indxs,
84  lm_stat_t& new_lm_stat);
85 } // namespace vision
86 } // namespace mrpt
87 
88 #endif // MRPT_VISION_INTERNAL_STEREO_CALIB_H
mrpt::vision::lm_stat_t::right_cam_params
mrpt::math::CArrayDouble< 9 > right_cam_params
Definition: chessboard_stereo_camera_calib_internal.h:35
mrpt::vision::TResidualJacobianList
std::vector< mrpt::aligned_std_vector< TResidJacobElement > > TResidualJacobianList
Definition: chessboard_stereo_camera_calib_internal.h:73
mrpt::vision::recompute_errors_and_Jacobians
double recompute_errors_and_Jacobians(const lm_stat_t &lm_stat, TResidualJacobianList &res_jac, bool use_robust_kernel, double kernel_param)
Definition: chessboard_stereo_camera_calib.cpp:1046
geometry.h
mrpt::vision::lm_stat_t::left_cam_params
mrpt::math::CArrayDouble< 9 > left_cam_params
Definition: chessboard_stereo_camera_calib_internal.h:34
mrpt::vision::TResidJacobElement
Data associated to each observation in the Lev-Marq.
Definition: chessboard_stereo_camera_calib_internal.h:61
mrpt::vision::lm_stat_t::lm_stat_t
lm_stat_t(const TCalibrationStereoImageList &_images, const std::vector< size_t > &_valid_image_pair_indices, const std::vector< mrpt::math::TPoint3D > &_obj_points)
Definition: chessboard_stereo_camera_calib_internal.h:38
mrpt::vision::lm_stat_t::images
const TCalibrationStereoImageList & images
Definition: chessboard_stereo_camera_calib_internal.h:24
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::vision::lm_stat_t
Definition: chessboard_stereo_camera_calib_internal.h:22
mrpt::vision::lm_stat_t::valid_image_pair_indices
const std::vector< size_t > & valid_image_pair_indices
Definition: chessboard_stereo_camera_calib_internal.h:25
chessboard_camera_calib.h
mrpt::vision::TResidJacobElement::predicted_obs
Eigen::Matrix< double, 4, 1 > predicted_obs
[u_l v_l u_r v_r]: left/right camera pixels
Definition: chessboard_stereo_camera_calib_internal.h:64
mrpt::aligned_std_vector
std::vector< T, mrpt::aligned_allocator_cpp11< T > > aligned_std_vector
Definition: aligned_std_vector.h:15
eps
const double eps
Definition: distributions_unittest.cpp:19
mrpt::vision::lm_stat_t::right2left_pose
mrpt::poses::CPose3D right2left_pose
Definition: chessboard_stereo_camera_calib_internal.h:33
mrpt::vision::lm_stat_t::obj_points
const std::vector< mrpt::math::TPoint3D > & obj_points
Definition: chessboard_stereo_camera_calib_internal.h:26
mrpt::vision::lm_stat_t::left_cam_poses
mrpt::aligned_std_vector< mrpt::poses::CPose3D > left_cam_poses
Definition: chessboard_stereo_camera_calib_internal.h:31
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
mrpt::math::CArrayNumeric
CArrayNumeric is an array for numeric types supporting several mathematical operations (actually,...
Definition: CArrayNumeric.h:25
CPose3D.h
mrpt::vision::build_linear_system
void build_linear_system(const TResidualJacobianList &res_jac, const std::vector< size_t > &var_indxs, Eigen::VectorXd &minus_g, Eigen::MatrixXd &H)
Definition: chessboard_stereo_camera_calib.cpp:754
mrpt::vision::add_lm_increment
void add_lm_increment(const Eigen::VectorXd &eps, const std::vector< size_t > &var_indxs, lm_stat_t &new_lm_stat)
Definition: chessboard_stereo_camera_calib.cpp:868
mrpt::vision::TCalibrationStereoImageList
std::vector< TImageStereoCalibData > TCalibrationStereoImageList
A list of images, used in checkerBoardStereoCalibration.
Definition: chessboard_stereo_camera_calib.h:137
mrpt::vision::TResidJacobElement::residual
Eigen::Matrix< double, 4, 1 > residual
= predicted_obs - observations
Definition: chessboard_stereo_camera_calib_internal.h:66
mrpt::vision::TResidJacobElement::J
Eigen::Matrix< double, 4, 30 > J
Jacobian.
Definition: chessboard_stereo_camera_calib_internal.h:69
mrpt::vision::lm_stat_t::swap
void swap(lm_stat_t &o)
Definition: chessboard_stereo_camera_calib_internal.h:51



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST