Package micycle.pgs.commons
Class ProcrustesAlignment
java.lang.Object
micycle.pgs.commons.ProcrustesAlignment
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 TypeMethodDescriptionstatic double[]
transform
(org.locationtech.jts.geom.Polygon referencePolygon, org.locationtech.jts.geom.Polygon transformPolygon) Performs ProcrustesAlignment Analysis to align two polygons.
-
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 toreferencePolygon
.Note: the polygons should have the same number of vertices.
- Parameters:
referencePolygon
- the first polygontransformPolygon
- 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.
-