Class RadialDistortionRobustEstimator

java.lang.Object
com.irurueta.ar.calibration.estimators.RadialDistortionRobustEstimator
Direct Known Subclasses:
LMedSRadialDistortionRobustEstimator, MSACRadialDistortionRobustEstimator, PROMedSRadialDistortionRobustEstimator, PROSACRadialDistortionRobustEstimator, RANSACRadialDistortionRobustEstimator

public abstract class RadialDistortionRobustEstimator extends Object
This is an abstract class for algorithms to robustly find the best RadialDistortion for provided collections of matched distorted and undistorted 2D points. Implementations of this class should be able to detect and discard outliers in order to find the best solution
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double
    Amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%).
    static final double
    Constant defining default confidence of the estimated result, which is 99%.
    static final double
    Defines default focal length if none is defined.
    static final int
    Default maximum allowed number of iterations.
    static final int
    Default number of radial distortion parameters.
    static final float
    Default amount of progress variation before notifying a change in estimation progress.
    static final com.irurueta.numerical.robust.RobustEstimatorMethod
    Default robust estimator method when none is provided.
    static final double
    Defines default skewness if none is defined.
    protected List<com.irurueta.geometry.Point2D>
    List of distorted points (aka measured points).
    protected com.irurueta.geometry.Point2D
    Distortion center.
    protected double
    Horizontal focal length expressed in pixels.
    Listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    protected boolean
    Indicates if this estimator is locked because an estimation is being computed.
    static final double
    Maximum allowed confidence value.
    static final float
    Maximum allowed value for progress delta.
    protected int
    Maximum allowed number of iterations.
    static final double
    Minimum allowed confidence value.
    static final int
    Minimum allowed number of iterations.
    static final int
    Minimum number of radial distortion parameters.
    static final int
    Minimum number of required point correspondences to estimate a radial distortion.
    static final float
    Minimum allowed value for progress delta.
    protected int
    Number of radial distortion parameters to estimate.
    protected float
    Amount of progress variation before notifying a progress change during estimation.
    protected double
    Skew in pixels.
    protected List<com.irurueta.geometry.Point2D>
    List of undistorted points (aka ideal points).
    protected double
    Vertical focal length expressed in pixels.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
    protected
    Constructor.
    protected
    RadialDistortionRobustEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints)
    Constructor.
    protected
    RadialDistortionRobustEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, RadialDistortionRobustEstimatorListener listener)
    Constructor.
    protected
    RadialDistortionRobustEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter)
    Constructor.
    protected
    RadialDistortionRobustEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter, RadialDistortionRobustEstimatorListener listener)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates if lists of corresponding points have already been provided and are available for retrieval.
    static boolean
    areValidPoints(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints)
    Indicates if lists of corresponding distorted and undistorted points are valid.
    Creates a radial distortion robust estimator using default robust method.
    create(com.irurueta.numerical.robust.RobustEstimatorMethod method)
    Creates a radial distortion robust estimator using provided robust method.
    create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints)
    Creates a radial distortion robust estimator using provided distorted and undistorted points assuming that distortion center is at origin of coordinates and using default robust estimation method.
    create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, double[] qualityScores)
    Creates a radial distortion robust estimator using provided distorted and undistorted points assuming that distortion center is at origin of coordinates and using default robust estimation method.
    create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, double[] qualityScores, com.irurueta.geometry.Point2D distortionCenter)
    Creates a radial distortion robust estimator using provided distorted and undistorted points, as well as the distortion center using the default robust estimation method.
    create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, double[] qualityScores, com.irurueta.geometry.Point2D distortionCenter, com.irurueta.numerical.robust.RobustEstimatorMethod method)
    Creates a radial distortion robust estimator using provided distorted and undistorted points, as well as the distortion center.
    create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
    Creates a radial distortion robust estimator using provided distorted and undistorted points and assuming that distortion center is at origin of coordinates.
    create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter)
    Creates a radial distortion robust estimator using provided distorted and undistorted points, as well as the distortion center using the default robust estimation method.
    create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter, com.irurueta.numerical.robust.RobustEstimatorMethod method)
    Creates a radial distortion robust estimator using provided distorted and undistorted points, as well as the distortion center.
    create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.numerical.robust.RobustEstimatorMethod method)
    Creates a radial distortion robust estimator using provided distorted and undistorted points and assuming that distortion center is at origin of coordinates.
    Estimates a radial distortion using a robust estimator and the best set of matched 2D points found using the robust estimator.
    double
    Returns amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%).
    List<com.irurueta.geometry.Point2D>
    Returns list of distorted points.
    com.irurueta.geometry.Point2D
    Returns distortion center.
    double
    Returns horizontal focal length expressed in pixels.
    com.irurueta.geometry.PinholeCameraIntrinsicParameters
    Returns pinhole camera intrinsic parameters associated to this estimator.
    Returns reference to listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    int
    Returns maximum allowed number of iterations.
    abstract com.irurueta.numerical.robust.RobustEstimatorMethod
    Returns method being used for robust estimation.
    int
    Returns number of radial distortion parameters to estimate.
    float
    Returns amount of progress variation before notifying a progress change during estimation.
    double[]
    Returns quality scores corresponding to each point.
    double
    Returns skew expressed in pixels.
    List<com.irurueta.geometry.Point2D>
    Returns list of undistorted points.
    double
    Returns vertical focal length expressed in pixels.
    private void
    internalSetPoints(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints)
    Sets list of corresponding distorted and undistorted points.
    boolean
    Indicates whether listener has been provided and is available for retrieval.
    boolean
    Indicates if this instance is locked because estimation is being computed.
    boolean
    Indicates if this estimator is ready to start th estimation.
    void
    setConfidence(double confidence)
    Sets amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%).
    void
    setDistortionCenter(com.irurueta.geometry.Point2D distortionCenter)
    Sets distortion center.
    void
    setHorizontalFocalLength(double horizontalFocalLength)
    Sets horizontal focal length expressed in pixels.
    void
    setIntrinsic(com.irurueta.geometry.PinholeCameraIntrinsicParameters intrinsic)
    Sets intrinsic parameters for this estimator from pinhole camera intrinsic parameters.
    void
    setIntrinsic(com.irurueta.geometry.Point2D distortionCenter, double horizontalFocalLength, double verticalFocalLength, double skew)
    Sets intrinsic parameters for this estimator.
    void
    Sets listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    void
    setMaxIterations(int maxIterations)
    Sets maximum allowed number of iterations.
    void
    setNumKParams(int numKParams)
    Sets number of radial distortion parameters to estimate.
    void
    setPoints(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints)
    Sets list of corresponding distorted and undistorted points.
    void
    setProgressDelta(float progressDelta)
    Sets amount of progress variation before notifying a progress change during estimation.
    void
    setQualityScores(double[] qualityScores)
    Sets quality scores corresponding to each point.
    void
    setSkew(double skew)
    Sets skew expressed in pixels.
    void
    setVerticalFocalLength(double verticalFocalLength)
    Sets vertical focal length expressed in pixels.

    Methods inherited from class java.lang.Object

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

    • DEFAULT_ROBUST_METHOD

      public static final com.irurueta.numerical.robust.RobustEstimatorMethod DEFAULT_ROBUST_METHOD
      Default robust estimator method when none is provided.
    • DEFAULT_PROGRESS_DELTA

      public static final float DEFAULT_PROGRESS_DELTA
      Default amount of progress variation before notifying a change in estimation progress. By default, this is set to 5%.
      See Also:
    • MIN_PROGRESS_DELTA

      public static final float MIN_PROGRESS_DELTA
      Minimum allowed value for progress delta.
      See Also:
    • MAX_PROGRESS_DELTA

      public static final float MAX_PROGRESS_DELTA
      Maximum allowed value for progress delta.
      See Also:
    • DEFAULT_CONFIDENCE

      public static final double DEFAULT_CONFIDENCE
      Constant defining default confidence of the estimated result, which is 99%. This means that with a probability of 99% estimation will be accurate because chosen sub-samples will be inliers.
      See Also:
    • DEFAULT_MAX_ITERATIONS

      public static final int DEFAULT_MAX_ITERATIONS
      Default maximum allowed number of iterations.
      See Also:
    • MIN_CONFIDENCE

      public static final double MIN_CONFIDENCE
      Minimum allowed confidence value.
      See Also:
    • MAX_CONFIDENCE

      public static final double MAX_CONFIDENCE
      Maximum allowed confidence value.
      See Also:
    • MIN_ITERATIONS

      public static final int MIN_ITERATIONS
      Minimum allowed number of iterations.
      See Also:
    • MIN_NUMBER_OF_POINTS

      public static final int MIN_NUMBER_OF_POINTS
      Minimum number of required point correspondences to estimate a radial distortion.
      See Also:
    • DEFAULT_NUM_K_PARAMS

      public static final int DEFAULT_NUM_K_PARAMS
      Default number of radial distortion parameters.
      See Also:
    • MIN_K_PARAMS

      public static final int MIN_K_PARAMS
      Minimum number of radial distortion parameters.
      See Also:
    • DEFAULT_FOCAL_LENGTH

      public static final double DEFAULT_FOCAL_LENGTH
      Defines default focal length if none is defined.
      See Also:
    • DEFAULT_SKEW

      public static final double DEFAULT_SKEW
      Defines default skewness if none is defined.
      See Also:
    • distortedPoints

      protected List<com.irurueta.geometry.Point2D> distortedPoints
      List of distorted points (aka measured points).
    • undistortedPoints

      protected List<com.irurueta.geometry.Point2D> undistortedPoints
      List of undistorted points (aka ideal points).
    • distortionCenter

      protected com.irurueta.geometry.Point2D distortionCenter
      Distortion center.
    • horizontalFocalLength

      protected double horizontalFocalLength
      Horizontal focal length expressed in pixels.
    • verticalFocalLength

      protected double verticalFocalLength
      Vertical focal length expressed in pixels.
    • skew

      protected double skew
      Skew in pixels.
    • numKParams

      protected int numKParams
      Number of radial distortion parameters to estimate.
    • listener

      Listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    • locked

      protected volatile boolean locked
      Indicates if this estimator is locked because an estimation is being computed.
    • progressDelta

      protected float progressDelta
      Amount of progress variation before notifying a progress change during estimation.
    • confidence

      protected double confidence
      Amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%). The amount of confidence indicates the probability that the estimated result is correct. Usually this value will be close to 1.0, but not exactly 1.0.
    • maxIterations

      protected int maxIterations
      Maximum allowed number of iterations. When the maximum number of iterations is exceeded, result will not be available, however an approximate result will be available for retrieval.
  • Constructor Details

    • RadialDistortionRobustEstimator

      protected RadialDistortionRobustEstimator()
      Constructor.
    • RadialDistortionRobustEstimator

      protected RadialDistortionRobustEstimator(RadialDistortionRobustEstimatorListener listener)
      Constructor.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    • RadialDistortionRobustEstimator

      protected RadialDistortionRobustEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints)
      Constructor.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than MIN_NUMBER_OF_POINTS.
    • RadialDistortionRobustEstimator

      protected RadialDistortionRobustEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, RadialDistortionRobustEstimatorListener listener)
      Constructor.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than MIN_NUMBER_OF_POINTS.
    • RadialDistortionRobustEstimator

      protected RadialDistortionRobustEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter)
      Constructor.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      distortionCenter - radial distortion center. If null it is assumed to be the origin of coordinates, otherwise this is typically equal to the camera principal point.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than MIN_NUMBER_OF_POINTS.
    • RadialDistortionRobustEstimator

      protected RadialDistortionRobustEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter, RadialDistortionRobustEstimatorListener listener)
      Constructor.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      distortionCenter - radial distortion center. If null it is assumed to be the origin of coordinates, otherwise this is typically equal to the camera principal point.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than MIN_NUMBER_OF_POINTS.
  • Method Details

    • getListener

      Returns reference to listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Returns:
      listener to be notified of events.
    • setListener

      public void setListener(RadialDistortionRobustEstimatorListener listener) throws com.irurueta.geometry.estimators.LockedException
      Sets listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Parameters:
      listener - listener to be notified of events.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if robust estimator is locked.
    • isListenerAvailable

      public boolean isListenerAvailable()
      Indicates whether listener has been provided and is available for retrieval.
      Returns:
      true if available, false otherwise.
    • isLocked

      public boolean isLocked()
      Indicates if this instance is locked because estimation is being computed.
      Returns:
      true if locked, false otherwise.
    • getProgressDelta

      public float getProgressDelta()
      Returns amount of progress variation before notifying a progress change during estimation.
      Returns:
      amount of progress variation before notifying a progress change during estimation.
    • setProgressDelta

      public void setProgressDelta(float progressDelta) throws com.irurueta.geometry.estimators.LockedException
      Sets amount of progress variation before notifying a progress change during estimation.
      Parameters:
      progressDelta - amount of progress variation before notifying a progress change during estimation.
      Throws:
      IllegalArgumentException - if progress delta is less than zero or greater than 1.
      com.irurueta.geometry.estimators.LockedException - if this estimator is locked because an estimation is being computed.
    • getConfidence

      public double getConfidence()
      Returns amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%). The amount of confidence indicates the probability that the estimated result is correct. Usually this value will be close to 1.0, but not exactly 1.0.
      Returns:
      amount of confidence as a value between 0.0 and 1.0.
    • setConfidence

      public void setConfidence(double confidence) throws com.irurueta.geometry.estimators.LockedException
      Sets amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%). The amount of confidence indicates the probability that the estimated result is correct. Usually this value will be close to 1.0, but not exactly 1.0.
      Parameters:
      confidence - confidence to be set as a value between 0.0 and 1.0.
      Throws:
      IllegalArgumentException - if provided value is not between 0.0 and 1.0.
      com.irurueta.geometry.estimators.LockedException - if this estimator is locked because an estimator is being computed.
    • getMaxIterations

      public int getMaxIterations()
      Returns maximum allowed number of iterations. If maximum allowed number of iterations is achieved without converging to a result when calling estimate(), a RobustEstimatorException will be raised.
      Returns:
      maximum allowed number of iterations.
    • setMaxIterations

      public void setMaxIterations(int maxIterations) throws com.irurueta.geometry.estimators.LockedException
      Sets maximum allowed number of iterations. When the maximum number of iterations is exceeded, result will not be available, however an approximate result will be available for retrieval
      Parameters:
      maxIterations - maximum allowed number of iterations to be set.
      Throws:
      IllegalArgumentException - if provided value is less than 1.
      com.irurueta.geometry.estimators.LockedException - if this estimator is locked because an estimation is being computed.
    • setPoints

      public void setPoints(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints) throws com.irurueta.geometry.estimators.LockedException
      Sets list of corresponding distorted and undistorted points.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
      IllegalArgumentException - if provided lists of points don't have the same size.
    • getDistortedPoints

      public List<com.irurueta.geometry.Point2D> getDistortedPoints()
      Returns list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      Returns:
      list of distorted points.
    • getUndistortedPoints

      public List<com.irurueta.geometry.Point2D> getUndistortedPoints()
      Returns list of undistorted points.
      Returns:
      list of undistorted points.
    • getDistortionCenter

      public com.irurueta.geometry.Point2D getDistortionCenter()
      Returns distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).
      Returns:
      distortion center or null.
    • setDistortionCenter

      public void setDistortionCenter(com.irurueta.geometry.Point2D distortionCenter) throws com.irurueta.geometry.estimators.LockedException
      Sets distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).
      Parameters:
      distortionCenter - distortion center, or null if set at origin of coordinates.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getHorizontalFocalLength

      public double getHorizontalFocalLength()
      Returns horizontal focal length expressed in pixels.
      Returns:
      horizontal focal length expressed in pixels.
    • setHorizontalFocalLength

      public void setHorizontalFocalLength(double horizontalFocalLength) throws com.irurueta.geometry.estimators.LockedException
      Sets horizontal focal length expressed in pixels.
      Parameters:
      horizontalFocalLength - horizontal focal length expressed in pixels.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getVerticalFocalLength

      public double getVerticalFocalLength()
      Returns vertical focal length expressed in pixels.
      Returns:
      vertical focal length expressed in pixels.
    • setVerticalFocalLength

      public void setVerticalFocalLength(double verticalFocalLength) throws com.irurueta.geometry.estimators.LockedException
      Sets vertical focal length expressed in pixels.
      Parameters:
      verticalFocalLength - vertical focal length expressed in pixels.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getSkew

      public double getSkew()
      Returns skew expressed in pixels.
      Returns:
      skew expressed in pixels.
    • setSkew

      public void setSkew(double skew) throws com.irurueta.geometry.estimators.LockedException
      Sets skew expressed in pixels.
      Parameters:
      skew - skew expressed in pixels.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getIntrinsic

      public com.irurueta.geometry.PinholeCameraIntrinsicParameters getIntrinsic()
      Returns pinhole camera intrinsic parameters associated to this estimator.
      Returns:
      pinhole camera intrinsic parameters associated to this estimator.
    • setIntrinsic

      public void setIntrinsic(com.irurueta.geometry.PinholeCameraIntrinsicParameters intrinsic) throws com.irurueta.geometry.estimators.LockedException
      Sets intrinsic parameters for this estimator from pinhole camera intrinsic parameters.
      Parameters:
      intrinsic - intrinsic parameters.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • setIntrinsic

      public void setIntrinsic(com.irurueta.geometry.Point2D distortionCenter, double horizontalFocalLength, double verticalFocalLength, double skew) throws com.irurueta.geometry.estimators.LockedException
      Sets intrinsic parameters for this estimator.
      Parameters:
      distortionCenter - distortion center.
      horizontalFocalLength - horizontal focal length in pixels.
      verticalFocalLength - vertical focal length in pixels.
      skew - skew in pixels.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getNumKParams

      public int getNumKParams()
      Returns number of radial distortion parameters to estimate.
      Returns:
      number of radial distortion parameters to estimate.
    • setNumKParams

      public void setNumKParams(int numKParams) throws com.irurueta.geometry.estimators.LockedException
      Sets number of radial distortion parameters to estimate.
      Parameters:
      numKParams - number of radial distortion parameters to estimate.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
      IllegalArgumentException - if number of parameters is less than 1.
    • arePointsAvailable

      public boolean arePointsAvailable()
      Indicates if lists of corresponding points have already been provided and are available for retrieval.
      Returns:
      true if available, false otherwise.
    • isReady

      public boolean isReady()
      Indicates if this estimator is ready to start th estimation. This is true when lists of points are provided, having equal size and at least 2 points.
      Returns:
      true if estimator is ready, false otherwise.
    • getQualityScores

      public double[] getQualityScores()
      Returns quality scores corresponding to each point. The larger the score value the better the quality of the point measure. This implementation always returns null. Subclasses using quality scores must implement proper behaviour.
      Returns:
      quality scores corresponding to each point.
    • setQualityScores

      public void setQualityScores(double[] qualityScores) throws com.irurueta.geometry.estimators.LockedException
      Sets quality scores corresponding to each point. The larger the score value the better the quality of the point sample. This implementation makes no action. Subclasses using quality scores must implement proper behaviour.
      Parameters:
      qualityScores - quality scores corresponding to each sampled point.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if robust estimator is locked because an estimation is already in progress.
      IllegalArgumentException - if provided quality scores length is smaller than MINIMUM_SIZE (i.e. 3 samples).
    • estimate

      public abstract RadialDistortion estimate() throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, com.irurueta.numerical.robust.RobustEstimatorException
      Estimates a radial distortion using a robust estimator and the best set of matched 2D points found using the robust estimator.
      Returns:
      a radial distortion.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if robust estimator is locked because an estimation is already in progress.
      com.irurueta.geometry.estimators.NotReadyException - if provided input data is not enough to start the estimation.
      com.irurueta.numerical.robust.RobustEstimatorException - if estimation fails for any reason (i.e. numerical instability, no solution available, etc).
    • getMethod

      public abstract com.irurueta.numerical.robust.RobustEstimatorMethod getMethod()
      Returns method being used for robust estimation.
      Returns:
      method being used for robust estimation.
    • create

      public static RadialDistortionRobustEstimator create(com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a radial distortion robust estimator using provided robust method.
      Parameters:
      method - method of a robust estimator algorithm to estimate the best radial distortion.
      Returns:
      an instance of a radial distortion robust estimator.
    • create

      public static RadialDistortionRobustEstimator create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, double[] qualityScores, com.irurueta.geometry.Point2D distortionCenter, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a radial distortion robust estimator using provided distorted and undistorted points, as well as the distortion center. If no distortion center is provided, it is assumed to be at the origin of coordinates.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      qualityScores - quality scores corresponding to each point.
      distortionCenter - Distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).
      method - method of a robust estimator algorithm to estimate the best radial distortion.
      Returns:
      an instance of a radial distortion robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • create

      public static RadialDistortionRobustEstimator create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a radial distortion robust estimator using provided distorted and undistorted points, as well as the distortion center. If no distortion center is provided, it is assumed to be at the origin of coordinates.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      distortionCenter - Distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).
      method - method of a robust estimator algorithm to estimate the best radial distortion.
      Returns:
      an instance of a radial distortion robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • create

      public static RadialDistortionRobustEstimator create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a radial distortion robust estimator using provided distorted and undistorted points and assuming that distortion center is at origin of coordinates.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      qualityScores - quality scores corresponding to each point.
      method - method of a robust estimator algorithm to estimate the best radial distortion.
      Returns:
      an instance of a radial distortion robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • create

      public static RadialDistortionRobustEstimator create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a radial distortion robust estimator using provided distorted and undistorted points and assuming that distortion center is at origin of coordinates.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      method - method of a robust estimator algorithm to estimate the best radial distortion.
      Returns:
      an instance of a radial distortion robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • create

      public static RadialDistortionRobustEstimator create()
      Creates a radial distortion robust estimator using default robust method.
      Returns:
      an instance of a radial distortion robust estimator.
    • create

      public static RadialDistortionRobustEstimator create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, double[] qualityScores)
      Creates a radial distortion robust estimator using provided distorted and undistorted points assuming that distortion center is at origin of coordinates and using default robust estimation method.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      qualityScores - quality scores corresponding to each point
      Returns:
      an instance of a radial distortion robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • create

      public static RadialDistortionRobustEstimator create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints)
      Creates a radial distortion robust estimator using provided distorted and undistorted points assuming that distortion center is at origin of coordinates and using default robust estimation method.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      Returns:
      an instance of a radial distortion robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • create

      public static RadialDistortionRobustEstimator create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, double[] qualityScores, com.irurueta.geometry.Point2D distortionCenter)
      Creates a radial distortion robust estimator using provided distorted and undistorted points, as well as the distortion center using the default robust estimation method. If no distortion center is provided, it is assumed to be at the origin of coordinates.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      qualityScores - quality scores corresponding to each point.
      distortionCenter - Distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).
      Returns:
      an instance of a radial distortion robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • create

      public static RadialDistortionRobustEstimator create(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter)
      Creates a radial distortion robust estimator using provided distorted and undistorted points, as well as the distortion center using the default robust estimation method. If no distortion center is provided, it is assumed to be at the origin of coordinates.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      distortionCenter - Distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).
      Returns:
      an instance of a radial distortion robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • areValidPoints

      public static boolean areValidPoints(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints)
      Indicates if lists of corresponding distorted and undistorted points are valid. Lists are considered valid if they have the same number of points and both have more than the required minimum of correspondences (which is 2).
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      Returns:
      true if lists of points are valid, false otherwise.
    • internalSetPoints

      private void internalSetPoints(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints)
      Sets list of corresponding distorted and undistorted points. This method does not check whether estimator is locked.
      Parameters:
      distortedPoints - list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.
      undistortedPoints - list of undistorted points.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.