A static utility class for aligning two 2D polygons using the RANSAC algorithm. This version is optimized for correctness and includes a proper least-squares refinement step.
RANSACPointAlignment
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| AlignPolygons | 1 | Aligns a source polygon to a target polygon using RANSAC. |
| AlignPolygons | 2 | Aligns a source polygon to a target polygon using RANSAC. |
| MakeAlignment | 1 | Aligns a source polygon to a target polygon using RANSAC. |
| ComputeAffineFrom3Pairs | 1 | Computes an affine transform from exactly three point pairs. |
| RefineTransformWithLeastSquares | 1 | Refines the transformation using all inliers with a least-squares fit for an affine transform. |
| SolveLeastSquaresAffine | 1 | Solves the least-squares problem for affine transformation parameters. |
| MakeHungarianAssignment | 1 |
03 Members
``0(), ``0(), Func(Of ``0, Double()), Int32, Double)Aligns a source polygon to a target polygon using RANSAC.
| Name | Type | Description |
|---|---|---|
sourcePoly | ``0() | The polygon to be transformed. |
targetPoly | ``0() | The polygon to align to. |
iterations | Func(Of ``0, Double()) | The number of RANSAC iterations. |
distanceThreshold | Int32 | The distance threshold to consider a point an inlier. |
The best-fit Transform object.
Polygon2D, Polygon2D, Int32, Double)Aligns a source polygon to a target polygon using RANSAC.
| Name | Type | Description |
|---|---|---|
sourcePoly | Polygon2D | The polygon to be transformed. |
targetPoly | Polygon2D | The polygon to align to. |
iterations | Int32 | The number of RANSAC iterations. |
distanceThreshold | Double | The distance threshold to consider a point an inlier. |
The best-fit Transform object.
ValueTuple(Of PointF, PointF)(), Int32, Double)Aligns a source polygon to a target polygon using RANSAC.
| Name | Type | Description |
|---|---|---|
iterations | ValueTuple(Of PointF, PointF)() | The number of RANSAC iterations. |
distanceThreshold | Int32 | The distance threshold to consider a point an inlier. |
The best-fit Transform object.
PointF, PointF, PointF, PointF, PointF, PointF)Computes an affine transform from exactly three point pairs.
ValueTuple(Of PointF, PointF)(), AffineTransform, Double)Refines the transformation using all inliers with a least-squares fit for an affine transform.
ValueTuple(Of PointF, PointF)(), Double, Double, Double, Double, Double, Double)Solves the least-squares problem for affine transformation parameters. This function is unchanged from your original, as it was mathematically correct.
Polygon2D, Polygon2D, AffineTransform)T(), T(), Func(Of T, Double()), Int32, Double)