Class ProcrustesImpl

java.lang.Object
cz.fidentis.analyst.engines.landmarks.impl.ProcrustesImpl

public class ProcrustesImpl extends Object
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 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 be null.
      transformedFaceFPs - Feature points of a face to be transformed (superimposed). Must not be null.
      scale - Whether to scale the face as well
      Throws:
      IllegalArgumentException - if there are not at least three common feature points in the faces
    • movePoint

      public static <T extends IPosition> void movePoint(T point, javax.vecmath.Vector3d vector)
      Moves point by given vector value.
      Type Parameters:
      T - Type of 3D point
      Parameters:
      point - A 3D point to be moved
      vector - A movement vector
    • scalePointDistance

      public static <T extends IPosition> T scalePointDistance(T point, double scaleFactor)
      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 scaled
      scaleFactor - Scale factor
      Returns:
      point with recalculated values
    • rotateVertex

      public static <T extends IPosition> void rotateVertex(T v, org.ejml.simple.SimpleMatrix matrix)
      Rotates vertex v by simulating matrix multiplication with given matrix
      Parameters:
      v - is vertex than is going to be rotated
      matrix - is rotation matrix