eos 1.4.0
|
#include <ceres_nonlinear.hpp>
Public Member Functions | |
VertexColorCost (const eos::morphablemodel::PcaModel &shape_model, const eos::morphablemodel::Blendshapes &blendshapes, const eos::morphablemodel::PcaModel &color_model, int num_shape_coeffs, int num_blendshape_coeffs, int num_color_coeffs, int vertex_id, const eos::core::Image3u &image) | |
template<typename T > | |
bool | operator() (const T *const camera_rotation, const T *const camera_translation, const T *const camera_intrinsics, const T *const shape_coeffs, const T *const blendshape_coeffs, const T *const color_coeffs, T *residual) const |
Static Public Member Functions | |
template<int num_shape_coeffs, int num_blendshape_coeffs, int num_color_coeffs> | |
static ceres::CostFunction * | Create (const eos::morphablemodel::PcaModel &shape_model, const eos::morphablemodel::Blendshapes &blendshapes, const eos::morphablemodel::PcaModel &color_model, int vertex_id, const eos::core::Image3u &image) |
Image error cost function (at vertex locations).
Measures the RGB image error between a particular vertex point of the 3D model at its projected location and the observed input image. Models the cost for 1 vertex. The residual is 3-dim, [r, g, b]. Its input params are cam, shape-coeffs, BS-coeffs and colour coeffs. This projects the vertex locations - so not a full rendering pass.
|
inline |
Constructs a new cost function object for a particular vertex id that measures the RGB image error between the estimated model point and the observed input image.
Warning: Don't put in temporaries for shape_model
, blendshapes
and color_model
. We don't make a copy, we store a reference to what is given to the function.
[in] | shape_model | A PCA 3D shape model. Do not use a temporary. |
[in] | blendshapes | A set of 3D blendshapes. Do not use a temporary. |
[in] | color_model | A PCA 3D color model. Do not use a temporary. |
[in] | num_shape_coeffs | Number of shape coefficients that are being optimised for. |
[in] | num_blendshape_coeffs | Number of blendshape coefficients that are being optimised for. |
[in] | num_color_coeffs | Number of colour coefficients that are being optimised for. |
[in] | vertex_id | Vertex id of the 3D model that should be projected and measured. |
[in] | image | The observed image. |
|
inlinestatic |
Factory to hide the construction of the CostFunction object from the client code.
The number of parameters are given as template arguments, so that we can use Ceres' fixed-size constructor.
|
inline |
Image cost function implementation.
Measures the image pixel error between the given model vertex projected to 2D and the observed input image.
Todo: We should deal with visibility! Don't evaluate when the vertex is self-occluded.
[in] | camera_rotation | A set of camera rotation parameters, parameterised as an Eigen::Quaternion. |
[in] | camera_translation | Camera translation parameters: [t_x t_y t_z]. |
[in] | camera_intrinsics | Camera intrinsics, containing the field of view (fov_y). |
[in] | shape_coeffs | A set of PCA shape coefficients. |
[in] | blendshape_coeffs | A set of blendshape coefficients. |
[in] | color_coeffs | A set of PCA colour (albedo) coefficients. |
[in] | residual | An array of the resulting residuals. |