Class ProcrustesAlignment

java.lang.Object
micycle.pgs.commons.ProcrustesAlignment

public class ProcrustesAlignment extends Object
The ProcrustesAlignment class provides methods for performing ProcrustesAlignment analysis, which is a technique for aligning and comparing geometric shapes. ProcrustesAlignment analysis aims to find the best transformation (translation, rotation, and scaling) that minimizes the differences between corresponding points of two shapes.

This class is particularly useful in shape matching and analysis tasks where the only permitted deformation modes are uniform scaling, rotation, and translation. It is commonly used in various fields such as computer vision, image processing, pattern recognition, and bioinformatics.

Author:
Michael Carleton
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[]
    transform(org.locationtech.jts.geom.Polygon referencePolygon, org.locationtech.jts.geom.Polygon transformPolygon)
    Performs ProcrustesAlignment Analysis to align two polygons.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • transform

      public static double[] transform(org.locationtech.jts.geom.Polygon referencePolygon, org.locationtech.jts.geom.Polygon transformPolygon)
      Performs ProcrustesAlignment Analysis to align two polygons.

      Finds the optimal scaling, translation and rotation to best align transformPolygon with respect to referencePolygon.

      Note: the polygons should have the same number of vertices.

      Parameters:
      referencePolygon - the first polygon
      transformPolygon - the polygon to transform/align
      Returns:
      an array having 4 values: the optimal translation (x, y), scale, and rotation angle (radians, clockwise) to best align the transform polygon to the reference polygon.