10#include <momentum/camera/camera.h>
29 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,
94 [[nodiscard]]
const std::vector<CameraVertexProjectionDataT<T>>&
getConstraints()
const {
SkeletonDerivativeT< float > skeletonDerivative_
double getGradient(const ModelParametersT< float > ¶ms, const SkeletonStateT< float > &state, const MeshStateT< float > &meshState, Eigen::Ref< Eigen::VectorX< float > > gradient) final
double getError(const ModelParametersT< float > ¶ms, const SkeletonStateT< float > &state, const MeshStateT< float > &meshState) final
std::vector< CameraVertexProjectionDataT< float > > constraints_
void setMaxThreads(size_t maxThreads)
Eigen::Transform< float, 3, Eigen::Affine > cameraOffset_
std::shared_ptr< const IntrinsicsModelT< float > > intrinsicsModel_
bool needsMesh() const final
double getJacobian(const ModelParametersT< float > ¶ms, const SkeletonStateT< float > &state, const MeshStateT< float > &meshState, Eigen::Ref< Eigen::MatrixX< float > > jacobian, Eigen::Ref< Eigen::VectorX< float > > residual, int &usedRows) final
CameraVertexProjectionErrorFunctionT(const Character &character, 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())
const Character * getCharacter() const final
For mesh-based error functions, get access to the underlying character.
std::optional< CameraIntrinsicsMapping< float > > intrinsicsMapping_
const std::vector< CameraVertexProjectionDataT< T > > & getConstraints() const
size_t getJacobianSize() const final
const Character & character_
size_t getNumConstraints() const
void setConstraints(std::vector< CameraVertexProjectionDataT< T > > constraints)
void addConstraint(const CameraVertexProjectionDataT< float > &constraint)
CameraVertexProjectionErrorFunctionT(const Character &character, 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)
ParameterTransformT< float > ParameterTransform
Eigen::Matrix< T, Dynamic, Dynamic > MatrixX
Dynamic-size, column-major dense matrix.
Vector< T, Dynamic > VectorX
Dynamic-size column vector. Common return type for solver residuals and parameter vectors.
constexpr size_t kInvalidIndex
Sentinel value indicating an invalid or unset size_t index.
Per-constraint data for CameraVertexProjectionErrorFunctionT.
Eigen::Vector2< float > target
A character model with skeletal structure, mesh, and optional components.
Represents the complete state of a model's mesh.
A vector of size numModelParams holding the values of all model parameters for a character.
Represents the complete state of a skeleton.