|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Cached mapping between intrinsic parameters and model parameter indices. More...
#include <camera_intrinsics_parameters.h>
Public Member Functions | |
| CameraIntrinsicsMapping (const ParameterTransform ¶mTransform, const IntrinsicsModelT< T > &intrinsicsModel) | |
| Build the mapping from a parameter transform and intrinsics model. | |
| bool | hasActiveParams () const |
| Are any intrinsic parameters being optimized? | |
| const IntrinsicsModelT< T > & | updateIntrinsics (const ModelParametersT< T > &modelParams) |
| Update the mutable intrinsics model from current model parameters. | |
| void | addGradient (const Eigen::Matrix< T, 3, Eigen::Dynamic > &J_intrinsics, const Eigen::Vector2< T > &residual, T weight, Eigen::Ref< Eigen::VectorX< T > > gradient) const |
| Accumulate intrinsics Jacobian contributions into the gradient vector. | |
| void | addJacobian (const Eigen::Matrix< T, 3, Eigen::Dynamic > &J_intrinsics, T weight, Eigen::Index rowOffset, Eigen::Ref< Eigen::MatrixX< T > > jacobian) const |
| Accumulate intrinsics Jacobian contributions into the Jacobian matrix. | |
Public Attributes | |
| std::vector< Eigen::Index > | modelParamIndices |
| For each intrinsic parameter i, the model parameter index, or -1 if absent. | |
| std::shared_ptr< IntrinsicsModelT< T > > | mutableIntrinsics |
| Mutable clone of the intrinsics model, updated each iteration via updateIntrinsics(). | |
Cached mapping between intrinsic parameters and model parameter indices.
This struct is constructed once (at error function setup time) and caches the index mapping so that solve-time operations avoid string comparisons. It also holds a mutable clone of the intrinsics model that can be updated from model parameters each iteration.
Definition at line 95 of file camera_intrinsics_parameters.h.
| momentum::CameraIntrinsicsMapping< T >::CameraIntrinsicsMapping | ( | const ParameterTransform & | paramTransform, |
| const IntrinsicsModelT< T > & | intrinsicsModel ) |
Build the mapping from a parameter transform and intrinsics model.
The intrinsics model must have a non-empty name.
Definition at line 160 of file camera_intrinsics_parameters.cpp.
References momentum::kTiedFocalLengthSuffix, modelParamIndices, and mutableIntrinsics.
| void momentum::CameraIntrinsicsMapping< T >::addGradient | ( | const Eigen::Matrix< T, 3, Eigen::Dynamic > & | J_intrinsics, |
| const Eigen::Vector2< T > & | residual, | ||
| T | weight, | ||
| Eigen::Ref< Eigen::VectorX< T > > | gradient ) const |
Accumulate intrinsics Jacobian contributions into the gradient vector.
| J_intrinsics | The 3xN intrinsics Jacobian from projectIntrinsicsJacobian() |
| residual | The 2D residual (projected - target) |
| weight | Combined weight (2 * constraint_weight * error_function_weight) |
| gradient | The gradient vector to accumulate into |
Definition at line 206 of file camera_intrinsics_parameters.cpp.
References modelParamIndices.
| void momentum::CameraIntrinsicsMapping< T >::addJacobian | ( | const Eigen::Matrix< T, 3, Eigen::Dynamic > & | J_intrinsics, |
| T | weight, | ||
| Eigen::Index | rowOffset, | ||
| Eigen::Ref< Eigen::MatrixX< T > > | jacobian ) const |
Accumulate intrinsics Jacobian contributions into the Jacobian matrix.
| J_intrinsics | The 3xN intrinsics Jacobian from projectIntrinsicsJacobian() |
| weight | Combined weight (sqrt(constraint_weight * error_function_weight)) |
| rowOffset | Row offset into the Jacobian matrix (2 * constraint_index) |
| jacobian | The Jacobian matrix to accumulate into |
Definition at line 221 of file camera_intrinsics_parameters.cpp.
References modelParamIndices.
|
nodiscard |
Are any intrinsic parameters being optimized?
Definition at line 182 of file camera_intrinsics_parameters.cpp.
References modelParamIndices.
| const IntrinsicsModelT< T > & momentum::CameraIntrinsicsMapping< T >::updateIntrinsics | ( | const ModelParametersT< T > & | modelParams | ) |
Update the mutable intrinsics model from current model parameters.
Only modifies parameters that have active mappings; others retain their current values. Returns a reference to the updated model.
Definition at line 192 of file camera_intrinsics_parameters.cpp.
References modelParamIndices, mutableIntrinsics, and momentum::EigenStrongType< Derived, EigenType >::size().
| std::vector<Eigen::Index> momentum::CameraIntrinsicsMapping< T >::modelParamIndices |
For each intrinsic parameter i, the model parameter index, or -1 if absent.
Definition at line 97 of file camera_intrinsics_parameters.h.
Referenced by addGradient(), addJacobian(), CameraIntrinsicsMapping(), hasActiveParams(), and updateIntrinsics().
| std::shared_ptr<IntrinsicsModelT<T> > momentum::CameraIntrinsicsMapping< T >::mutableIntrinsics |
Mutable clone of the intrinsics model, updated each iteration via updateIntrinsics().
Definition at line 100 of file camera_intrinsics_parameters.h.
Referenced by CameraIntrinsicsMapping(), and updateIntrinsics().