Class ProcrustesImpl
java.lang.Object
cz.fidentis.analyst.engines.landmarks.impl.ProcrustesImpl
Procrustes superimposition algorithm
that computes transformation of faces from their feature points.
This class doesn't transform any face. Only a transformation matrix is computed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PrTransformation
getTransformation
(Collection<Landmark> staticFaceFPs, Collection<Landmark> transformedFaceFPs, boolean scale) Computes and return transformation that registers feature points from the second face to feature points of the first face.static <T extends IPosition>
voidmovePoint
(T point, javax.vecmath.Vector3d vector) Moves point by given vector value.static <T extends IPosition>
voidrotateVertex
(T v, org.ejml.simple.SimpleMatrix matrix) Rotates vertex v by simulating matrix multiplication with given matrixstatic <T extends IPosition>
TscalePointDistance
(T point, double scaleFactor) Scales position of given point by multiplying its coordinates with given scaleFactor.
-
Constructor Details
-
ProcrustesImpl
public ProcrustesImpl()
-
-
Method Details
-
getTransformation
public static PrTransformation getTransformation(Collection<Landmark> staticFaceFPs, Collection<Landmark> transformedFaceFPs, boolean scale) Computes and return transformation that registers feature points from the second face to feature points of the first face.- Parameters:
staticFaceFPs
- Feature points of a face towards which the superimposition is performed. Must not benull
.transformedFaceFPs
- Feature points of a face to be transformed (superimposed). Must not benull
.scale
- Whether to scale the face as well- Throws:
IllegalArgumentException
- if there are not at least three common feature points in the faces
-
movePoint
Moves point by given vector value.- Type Parameters:
T
- Type of 3D point- Parameters:
point
- A 3D point to be movedvector
- A movement vector
-
scalePointDistance
Scales position of given point by multiplying its coordinates with given scaleFactor.- Type Parameters:
T
- Type of the 3D point- Parameters:
point
- A 3D point to be scaledscaleFactor
- Scale factor- Returns:
- point with recalculated values
-
rotateVertex
Rotates vertex v by simulating matrix multiplication with given matrix- Parameters:
v
- is vertex than is going to be rotatedmatrix
- is rotation matrix
-