10#include <momentum/camera/camera.h>
28 Eigen::Vector3<T>
offset = Eigen::Vector3<T>::Zero();
30 Eigen::Vector2<T>
target = Eigen::Vector2<T>::Zero();
51 std::shared_ptr<
const IntrinsicsModelT<T>> intrinsicsModel,
53 const Eigen::Transform<T, 3, Eigen::Affine>& cameraOffset =
54 Eigen::Transform<T, 3, Eigen::Affine>::Identity());
60 const CameraT<T>& camera,
71 Eigen::Ref<Eigen::VectorX<T>> gradient)
final;
76 Eigen::Ref<Eigen::MatrixX<T>> jacobian,
77 Eigen::Ref<Eigen::VectorX<T>> residual,
91 [[nodiscard]]
const std::vector<ProjectionConstraintT<T>>&
getConstraints()
const {
99 [[nodiscard]]
bool empty()
const {
std::vector< ProjectionConstraintT< float > > constraints_
double getError(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState) final
double getJacobian(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::MatrixX< T > > jacobian, Eigen::Ref< Eigen::VectorX< T > > residual, int &usedRows) final
void addConstraint(const ProjectionConstraintT< float > &constraint)
const std::vector< ProjectionConstraintT< T > > & getConstraints() const
void setConstraints(std::vector< ProjectionConstraintT< T > > constraints)
CameraProjectionErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt, std::shared_ptr< const IntrinsicsModelT< T > > intrinsicsModel, size_t cameraParent, const Eigen::Transform< T, 3, Eigen::Affine > &cameraOffset=Eigen::Transform< T, 3, Eigen::Affine >::Identity())
SkeletonDerivativeT< float > skeletonDerivative_
std::shared_ptr< const IntrinsicsModelT< float > > intrinsicsModel_
size_t getJacobianSize() const final
std::optional< CameraIntrinsicsMapping< float > > intrinsicsMapping_
Eigen::Transform< float, 3, Eigen::Affine > cameraOffset_
size_t getNumConstraints() const
double getGradient(const ModelParametersT< T > ¶ms, const SkeletonStateT< T > &state, const MeshStateT< T > &meshState, Eigen::Ref< Eigen::VectorX< T > > gradient) final
CameraProjectionErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt, const CameraT< T > &camera, size_t cameraParent=kInvalidIndex)
Convenience constructor that extracts intrinsics and extrinsics from a Camera.
Shared utility for derivative computation in error functions.
SkeletonErrorFunctionT(const Skeleton &skel, const ParameterTransform &pt)
SkeletonT< float > Skeleton
ParameterTransformT< float > ParameterTransform
constexpr size_t kInvalidIndex
Sentinel value indicating an invalid or unset size_t index.
Represents the complete state of a model's mesh.
A vector of size numModelParams holding the values of all model parameters for a character.
Per-constraint data for CameraProjectionErrorFunctionT.
Eigen::Vector3< float > offset
Eigen::Vector2< float > target
Represents the complete state of a skeleton.