Class BatchPairwiseDistanceImpl

java.lang.Object
cz.fidentis.analyst.engines.face.batch.distance.impl.BatchPairwiseDistanceImpl
All Implemented Interfaces:
BatchDistance, BatchPairwiseDistance

public class BatchPairwiseDistanceImpl extends Object implements BatchPairwiseDistance
Pair-wise N:N distance measurement.
  • Constructor Details

    • BatchPairwiseDistanceImpl

      public BatchPairwiseDistanceImpl(HumanFace cropFace, int numFaces)
      Constructor.
      Parameters:
      cropFace - If not null, then only surfaces overlapping the gaugeFace are measured.
      numFaces - The number of faces to be measured (excluding the gauge face)
  • Method Details

    • measure

      public void measure(HumanFace face1, HumanFace face2, int face1Index, int face2Index)
      Description copied from interface: BatchPairwiseDistance
      Measure two faces in both directions.
      Specified by:
      measure in interface BatchPairwiseDistance
      Parameters:
      face1 - First face
      face2 - Second face
      face1Index - The index under which is the result of face1->face2 measurement stored
      face2Index - The index under which is the result of face2->face1 measurement stored
    • getDistSimilarities

      public double[][] getDistSimilarities()
      Description copied from interface: BatchDistance
      Returns computed 2D matrix of distance similarities or null
      Specified by:
      getDistSimilarities in interface BatchDistance
      Returns:
      computed 2D matrix of distance similarities or null
    • getDistDeviations

      public double[][] getDistDeviations()
      Description copied from interface: BatchDistance
      Returns computed 2D matrix of sample standard deviations or null
      Specified by:
      getDistDeviations in interface BatchDistance
      Returns:
      computed 2D matrix of sample standard deviations or null
    • setDistSimilarity

      protected void setDistSimilarity(int i, int j, double val)
    • setDistDeviation

      protected void setDistDeviation(int i, int j, double val)
    • measureAndStoreOneDirection

      protected void measureAndStoreOneDirection(HumanFace faceA, HumanFace faceB, int indexA, int indexB)
      Measures faceB towards faceA. Omits that parts of the faceB that do not overlap the crop face.
      Parameters:
      faceA - Face A
      faceB - Face B
      indexA - index of face A
      indexB - index of face B
    • setDistValues

      protected void setDistValues(int i, int j, MeshDistanceVisitor pairwiseVisitor, MeshDistanceVisitor meanFaceVisitor)
      Sets an average distance and a sample standard deviation but only considering vertices that are not copped either by the second face in the pairwise comparison or the mean face (if defined).
      Parameters:
      i - the first index
      j - the second index
      pairwiseVisitor - distance visitor
      meanFaceVisitor - mean face visitor