Class RansacResult<T extends Primitive2d>

java.lang.Object
imagingbook.common.ransac.RansacResult<T>
Type Parameters:
T - generic primitive type
All Implemented Interfaces:
Comparable<RansacResult<T>>

public class RansacResult<T extends Primitive2d> extends Object implements Comparable<RansacResult<T>>

Represents a single detection result returned by an implementation of RansacDetector. Implements the Comparable interface for sorting by detection score. See Sec. 12.1 of [1] for additional details.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/11/19
  • Constructor Details

    • RansacResult

      public RansacResult(Pnt2d[] draw, T primitiveInit, T primitiveFinal, double score, Pnt2d[] inliers)
  • Method Details

    • getPrimitiveInit

      public T getPrimitiveInit()
      Returns the initial primitive (e.g., a circle) obtained from the minimum number of randomly drawn points.
      Returns:
      the initial primitive
    • getPrimitiveFinal

      public T getPrimitiveFinal()
      Returns the final primitive obtained after fitting numerically to the associated inlier points.
      Returns:
      the final primitive
    • getScore

      public double getScore()
      Returns the score (number of inliers) associated with this result.
      Returns:
      the score
    • getDraw

      public Pnt2d[] getDraw()
      Returns the randomly drawn points that lead to this result.
      Returns:
      array of points
    • getInliers

      public Pnt2d[] getInliers()
      Returns the set of inliers (points) associated with this result.
      Returns:
      array of points
    • compareTo

      public int compareTo(RansacResult<T> other)
      Specified by:
      compareTo in interface Comparable<T extends Primitive2d>