a class for bundle adjustment with fixed intrinsic parameters. More...
#include <vpgl_ba_fixed_k_lsqr.h>

Public Types | |
| enum | UseGradient |
| enum | UseWeights |
Public Member Functions | |
| vpgl_ba_fixed_k_lsqr (std::vector< vpgl_calibration_matrix< double > > K, const std::vector< vgl_point_2d< double > > &image_points, const std::vector< std::vector< bool > > &mask) | |
| Constructor. More... | |
| vpgl_ba_fixed_k_lsqr (std::vector< vpgl_calibration_matrix< double > > K, const std::vector< vgl_point_2d< double > > &image_points, const std::vector< vnl_matrix< double > > &inv_covars, const std::vector< std::vector< bool > > &mask) | |
| Constructor. More... | |
| ~vpgl_ba_fixed_k_lsqr () override=default | |
| void | jac_Aij (unsigned int i, unsigned int j, vnl_double_3x4 const &Pi, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Aij) override |
| compute the Jacobian Aij. More... | |
| void | jac_Bij (unsigned int i, unsigned int j, vnl_double_3x4 const &Pi, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Bij) override |
| compute the Jacobian Bij. More... | |
| void | jac_Cij (unsigned int i, unsigned int j, vnl_double_3x4 const &Pi, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Cij) override |
| compute the Jacobian Cij. More... | |
| vgl_homg_point_3d< double > | param_to_point (int j, const double *bj, const vnl_vector< double > &c) const override |
| construct the More... | |
| vnl_vector_fixed< double, 4 > | param_to_pt_vector (int j, const double *bj, const vnl_vector< double > &c) const override |
| construct the More... | |
| vpgl_perspective_camera< double > | param_to_cam (int i, const double *ai, const vnl_vector< double > &c) const override |
| construct the More... | |
| vnl_double_3x4 | param_to_cam_matrix (int i, const double *ai, const vnl_vector< double > &c) const override |
| compute a 3x4 camera matrix of camera More... | |
| void | f (vnl_vector< double > const &a, vnl_vector< double > const &b, vnl_vector< double > const &c, vnl_vector< double > &e) override |
| Compute all the reprojection errors. More... | |
| void | fij (int i, int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_vector< double > &fij) override |
| Compute the residuals from the ith component of a, the jth component of b, and all of c. More... | |
| void | jac_blocks (vnl_vector< double > const &a, vnl_vector< double > const &b, vnl_vector< double > const &c, std::vector< vnl_matrix< double > > &A, std::vector< vnl_matrix< double > > &B, std::vector< vnl_matrix< double > > &C) override |
| Compute the sparse Jacobian in block form. More... | |
| virtual void | jac_Aij (unsigned int i, unsigned int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Aij) |
| virtual void | jac_Aij (unsigned int i, unsigned int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Aij) |
| virtual void | jac_Bij (unsigned int i, unsigned int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Bij) |
| virtual void | jac_Bij (unsigned int i, unsigned int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Bij) |
| virtual void | jac_Cij (unsigned int i, unsigned int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Cij) |
| virtual void | jac_Cij (unsigned int i, unsigned int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Cij) |
| void | compute_weight_ij (int i, int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_vector< double > const &fij, double &weight) override |
| Use an M-estimator to compute weights. More... | |
| void | set_residual_scale (double scale) |
| set the residual scale for the robust estimation. More... | |
| vgl_homg_point_3d< double > | param_to_point (int j, const vnl_vector< double > &b, const vnl_vector< double > &c) const |
| construct the More... | |
| vnl_vector_fixed< double, 4 > | param_to_pt_vector (int j, const vnl_vector< double > &b, const vnl_vector< double > &c) const |
| construct the More... | |
| vpgl_perspective_camera< double > | param_to_cam (int i, const vnl_vector< double > &a, const vnl_vector< double > &c) const |
| construct the More... | |
| vnl_double_3x4 | param_to_cam_matrix (int i, const vnl_vector< double > &a, const vnl_vector< double > &c) const |
| construct the More... | |
| void | reset () |
| reset the weights. More... | |
| void | throw_failure () |
| void | clear_failure () |
| virtual void | fd_jac_blocks (vnl_vector< double > const &a, vnl_vector< double > const &b, vnl_vector< double > const &c, std::vector< vnl_matrix< double > > &A, std::vector< vnl_matrix< double > > &B, std::vector< vnl_matrix< double > > &C, double stepsize) |
| virtual void | compute_weights (vnl_vector< double > const &a, vnl_vector< double > const &b, vnl_vector< double > const &c, vnl_vector< double > const &f, vnl_vector< double > &weights) |
| virtual void | apply_weights (vnl_vector< double > const &weights, vnl_vector< double > &f) |
| virtual void | apply_weights (vnl_vector< double > const &weights, std::vector< vnl_matrix< double > > &A, std::vector< vnl_matrix< double > > &B, std::vector< vnl_matrix< double > > &C) |
| void | fd_jac_Aij (int i, int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Aij, double stepsize) |
| void | fd_jac_Bij (int i, int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Bij, double stepsize) |
| void | fd_jac_Cij (int i, int j, vnl_vector< double > const &ai, vnl_vector< double > const &bj, vnl_vector< double > const &c, vnl_matrix< double > &Cij, double stepsize) |
| virtual void | apply_weight_ij (int i, int j, double const &weight, vnl_vector< double > &fij) |
| virtual void | apply_weight_ij (int i, int j, double const &weight, vnl_matrix< double > &Aij, vnl_matrix< double > &Bij, vnl_matrix< double > &Cij) |
| virtual void | trace (int iteration, vnl_vector< double > const &a, vnl_vector< double > const &b, vnl_vector< double > const &c, vnl_vector< double > const &e) |
| unsigned int | number_of_params_a (int i) const |
| unsigned int | number_of_params_b (int j) const |
| unsigned int | number_of_params_c () const |
| unsigned int | number_of_residuals (int k) const |
| unsigned int | number_of_residuals (int i, int j) const |
| unsigned int | index_a (int i) const |
| unsigned int | index_b (int j) const |
| unsigned int | index_e (int k) const |
| unsigned int | number_of_a () const |
| unsigned int | number_of_b () const |
| unsigned int | number_of_e () const |
| bool | has_gradient () const |
| bool | has_weights () const |
| const vnl_crs_index & | residual_indices () const |
Static Public Member Functions | |
| static vnl_vector< double > | create_param_vector (const std::vector< vpgl_perspective_camera< double > > &cameras) |
Create the parameter vector a from a vector of cameras. More... | |
| static vnl_vector< double > | create_param_vector (const std::vector< vgl_point_3d< double > > &world_points) |
Create the parameter vector b from a vector of 3D points. More... | |
| static vnl_double_3x3 | rod_to_matrix (vnl_vector< double > const &r) |
| Fast conversion of rotation from Rodrigues vector to matrix. More... | |
| static void | jac_inhomg_3d_point (vnl_double_3x4 const &P, vnl_vector< double > const &pt, vnl_matrix< double > &J) |
| compute the 2x3 Jacobian of camera projection with respect to point location df/dpt where $f(pt) = P*pt$. More... | |
| static void | jac_camera_center (vnl_double_3x3 const &M, vnl_vector< double > const &C, vnl_vector< double > const &pt, vnl_matrix< double > &J) |
| compute the 2x3 Jacobian of camera projection with respect to camera center df/dC where $f(C) = [M | -M*C]*pt$. More... | |
| static void | jac_camera_rotation (vnl_double_3x3 const &K, vnl_vector< double > const &C, vnl_vector< double > const &r, vnl_vector< double > const &pt, vnl_matrix< double > &J) |
| compute the 2x3 Jacobian of camera projection with respect to camera rotation df/dr where $f(r) = K*rod_to_matrix(r)*[I | -C]*pt$. More... | |
Public Attributes | |
| no_gradient | |
| use_gradient | |
| no_weights | |
| use_weights | |
| bool | failure |
Protected Attributes | |
| std::vector< vpgl_calibration_matrix< double > > | K_ |
| The fixed internal camera calibration. More... | |
| std::vector< vnl_double_3x3 > | Km_ |
| The fixed internal camera calibration in matrix form. More... | |
| std::vector< vgl_point_2d< double > > | image_points_ |
| The corresponding points in the image. More... | |
| std::vector< vnl_matrix< double > > | factored_inv_covars_ |
| The Cholesky factored inverse covariances for each image point. More... | |
| bool | use_covars_ |
| Flag to enable covariance weighted errors. More... | |
| double | scale2_ |
| The square of the scale of the robust estimator. More... | |
| int | iteration_count_ |
| vnl_crs_index | residual_indices_ |
| std::vector< unsigned int > | indices_a_ |
| std::vector< unsigned int > | indices_b_ |
| unsigned int | num_params_c_ |
| std::vector< unsigned int > | indices_e_ |
| bool | use_gradient_ |
| bool | use_weights_ |
a class for bundle adjustment with fixed intrinsic parameters.
Definition at line 18 of file vpgl_ba_fixed_k_lsqr.h.
| vpgl_ba_fixed_k_lsqr::vpgl_ba_fixed_k_lsqr | ( | std::vector< vpgl_calibration_matrix< double > > | K, |
| const std::vector< vgl_point_2d< double > > & | image_points, | ||
| const std::vector< std::vector< bool > > & | mask | ||
| ) |
Constructor.
Definition at line 14 of file vpgl_ba_fixed_k_lsqr.cxx.
| vpgl_ba_fixed_k_lsqr::vpgl_ba_fixed_k_lsqr | ( | std::vector< vpgl_calibration_matrix< double > > | K, |
| const std::vector< vgl_point_2d< double > > & | image_points, | ||
| const std::vector< vnl_matrix< double > > & | inv_covars, | ||
| const std::vector< std::vector< bool > > & | mask | ||
| ) |
Constructor.
Each image point is assigned an inverse covariance (error projector) matrix
Definition at line 29 of file vpgl_ba_fixed_k_lsqr.cxx.
|
overridedefault |
|
overridevirtualinherited |
Use an M-estimator to compute weights.
Reimplemented from vnl_sparse_lst_sqr_function.
Definition at line 199 of file vpgl_bundle_adjust_lsqr.cxx.
|
static |
Create the parameter vector a from a vector of cameras.
Definition at line 138 of file vpgl_ba_fixed_k_lsqr.cxx.
|
static |
Create the parameter vector b from a vector of 3D points.
Definition at line 160 of file vpgl_ba_fixed_k_lsqr.cxx.
|
overridevirtualinherited |
Compute all the reprojection errors.
Given the parameter vectors a, b, and c, compute the vector of residuals e. e has been sized appropriately before the call. The parameters in for each camera are in a. The 3D point parameters are in b. Global parameters are in c.
Given the parameter vectors a, b, and c, compute the vector of residuals e. e has been sized appropriately before the call. The parameters in a for each camera are {wx, wy, wz, tx, ty, tz} where w is the Rodrigues vector of the rotation and t is the translation. The parameters in b for each 3D point are {px, py, pz} the non-homogeneous position.
Construct the ith camera.
Reimplemented from vnl_sparse_lst_sqr_function.
Definition at line 88 of file vpgl_bundle_adjust_lsqr.cxx.
|
overridevirtualinherited |
Compute the residuals from the ith component of a, the jth component of b, and all of c.
Compute the residuals from the ith component of a and the jth component of b.
This function is not normally used because f() has a self-contained efficient implementation. It is used for finite-differencing if the gradient is marked as unavailable
This is not normally used because f() has a self-contained efficient implementation It is used for finite-differencing if the gradient is marked as unavailable
Construct the ith camera.
Reimplemented from vnl_sparse_lst_sqr_function.
Definition at line 129 of file vpgl_bundle_adjust_lsqr.cxx.
|
overridevirtual |
compute the Jacobian Aij.
Implements vpgl_bundle_adjust_lsqr.
Definition at line 42 of file vpgl_ba_fixed_k_lsqr.cxx.
|
inherited |
|
overridevirtual |
compute the Jacobian Bij.
Implements vpgl_bundle_adjust_lsqr.
Definition at line 68 of file vpgl_ba_fixed_k_lsqr.cxx.
|
inherited |
|
overridevirtualinherited |
Compute the sparse Jacobian in block form.
Construct the ith camera.
Reimplemented from vnl_sparse_lst_sqr_function.
Definition at line 159 of file vpgl_bundle_adjust_lsqr.cxx.
|
staticinherited |
compute the 2x3 Jacobian of camera projection with respect to camera center df/dC where $f(C) = [M | -M*C]*pt$.
Definition at line 250 of file vpgl_bundle_adjust_lsqr.cxx.
|
staticinherited |
compute the 2x3 Jacobian of camera projection with respect to camera rotation df/dr where $f(r) = K*rod_to_matrix(r)*[I | -C]*pt$.
Here r is a Rodrigues vector, K is an upper triangular calibration matrix
Definition at line 266 of file vpgl_bundle_adjust_lsqr.cxx.
|
overridevirtual |
compute the Jacobian Cij.
Implements vpgl_bundle_adjust_lsqr.
Definition at line 80 of file vpgl_ba_fixed_k_lsqr.cxx.
|
inherited |
|
staticinherited |
compute the 2x3 Jacobian of camera projection with respect to point location df/dpt where $f(pt) = P*pt$.
Definition at line 218 of file vpgl_bundle_adjust_lsqr.cxx.
|
overridevirtual |
construct the
| i-th | perspective camera from a pointer to the i-th parameters of |
| a | and parameters |
| c. |
Implements vpgl_bundle_adjust_lsqr.
Definition at line 111 of file vpgl_ba_fixed_k_lsqr.cxx.
|
inlineinherited |
construct the
| i-th | perspective camera from parameter vector |
| a. |
Definition at line 162 of file vpgl_bundle_adjust_lsqr.h.
|
overridevirtual |
compute a 3x4 camera matrix of camera
| i | from a pointer to the i-th parameters of |
| a | and parameters |
| c. |
Implements vpgl_bundle_adjust_lsqr.
Definition at line 122 of file vpgl_ba_fixed_k_lsqr.cxx.
|
inlineinherited |
construct the
| i-th | perspective camera matrix from parameter vectors |
| a | and |
| c. |
Definition at line 176 of file vpgl_bundle_adjust_lsqr.h.
|
overridevirtual |
construct the
| j-th | perspective camera from a pointer to the j-th parameters of |
| b | and parameters |
| c. |
Implements vpgl_bundle_adjust_lsqr.
Definition at line 93 of file vpgl_ba_fixed_k_lsqr.cxx.
|
inlineinherited |
construct the
| j-th | 3D point from parameter vector |
| b | and |
| c. |
Definition at line 132 of file vpgl_bundle_adjust_lsqr.h.
|
overridevirtual |
construct the
| j-th | perspective camera from a pointer to the j-th parameters of |
| b | and parameters |
| c. |
Implements vpgl_bundle_adjust_lsqr.
Definition at line 102 of file vpgl_ba_fixed_k_lsqr.cxx.
|
inlineinherited |
construct the
| j-th | 3D point from parameter vector |
| b | and |
| c. |
Definition at line 147 of file vpgl_bundle_adjust_lsqr.h.
|
inlineinherited |
reset the weights.
Definition at line 189 of file vpgl_bundle_adjust_lsqr.h.
|
staticinherited |
Fast conversion of rotation from Rodrigues vector to matrix.
Definition at line 360 of file vpgl_bundle_adjust_lsqr.cxx.
|
inlineinherited |
set the residual scale for the robust estimation.
Definition at line 127 of file vpgl_bundle_adjust_lsqr.h.
|
protectedinherited |
The Cholesky factored inverse covariances for each image point.
Definition at line 225 of file vpgl_bundle_adjust_lsqr.h.
|
protectedinherited |
The corresponding points in the image.
Definition at line 223 of file vpgl_bundle_adjust_lsqr.h.
|
protectedinherited |
Definition at line 231 of file vpgl_bundle_adjust_lsqr.h.
|
protected |
The fixed internal camera calibration.
Definition at line 105 of file vpgl_ba_fixed_k_lsqr.h.
|
protected |
The fixed internal camera calibration in matrix form.
Definition at line 107 of file vpgl_ba_fixed_k_lsqr.h.
|
protectedinherited |
The square of the scale of the robust estimator.
Definition at line 229 of file vpgl_bundle_adjust_lsqr.h.
|
protectedinherited |
Flag to enable covariance weighted errors.
Definition at line 227 of file vpgl_bundle_adjust_lsqr.h.
1.8.15