* Returns the PCA shape model of this Morphable Model.
...
...
@@ -58,21 +68,42 @@ public:
*
* @return The shape model.
*/
PcaModelgetShapeModel()const;
PcaModelgetShapeModel()const
{
returnshapeModel;
};
/**
* Returns the PCA color or albedo model of this Morphable Model.
* Returns the PCA color (albedo) model of this Morphable Model.
*
* @return The color model.
*/
PcaModelgetColorModel()const;
PcaModelgetColorModel()const
{
returncolorModel;
};
/**
* Returns the mean of the shape- and color model as a Mesh.
*
* @return An mesh instance of the mean of the Morphable Model.
*/
render::MeshgetMean()const;
render::MeshgetMean()const
{
assert(shapeModel.getDataDimension()==colorModel.getDataDimension());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.
assert(shapeModel.getDataDimension()==colorModel.getDataDimension());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.
assert(shapeModel.getDataDimension()==colorModel.getDataDimension());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.
mesh.colors[i]=cv::Vec3f(color.at<float>(i*3+0),color.at<float>(i*3+1),color.at<float>(i*3+2));// order in hdf5: RGB. Order in OCV: BGR. But order in vertex.color: RGB
mesh.colors[i]=Vec3f(color.at<float>(i*3+0),color.at<float>(i*3+1),color.at<float>(i*3+2));// order in hdf5: RGB. Order in OCV: BGR. But order in vertex.color: RGB
assert(shapeModel.getDataDimension()==colorModel.getDataDimension());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.
assert(shapeModel.getDataDimension()==colorModel.getDataDimension());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.
assert(shapeModel.getDataDimension()==colorModel.getDataDimension());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.