Class DualAbsoluteQuadricRobustEstimator

java.lang.Object
com.irurueta.ar.calibration.estimators.DualAbsoluteQuadricRobustEstimator
Direct Known Subclasses:
LMedSDualAbsoluteQuadricRobustEstimator, MSACDualAbsoluteQuadricRobustEstimator, PROMedSDualAbsoluteQuadricRobustEstimator, PROSACDualAbsoluteQuadricRobustEstimator, RANSACDualAbsoluteQuadricRobustEstimator

public abstract class DualAbsoluteQuadricRobustEstimator extends Object
This is an abstract class for algorithms to robustly find the best DualAbsoluteQuadric (DAQ) for provided collection of cameras. 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 List<com.irurueta.geometry.PinholeCamera>
    Cameras to estimate dual absolute quadric (DAQ).
    protected double
    Amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%).
    Internal non-robust estimator of DAQ.
    static final double
    Constant defining default confidence of the estimated result, which is 99%.
    static final int
    Default maximum allowed number of iterations.
    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.
    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 float
    Minimum allowed value for progress delta.
    protected float
    Amount of progress variation before notifying a progress change during estimation.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
    protected
    Constructor.
    protected
    DualAbsoluteQuadricRobustEstimator(List<com.irurueta.geometry.PinholeCamera> cameras)
    Constructor.
    protected
    DualAbsoluteQuadricRobustEstimator(List<com.irurueta.geometry.PinholeCamera> cameras, DualAbsoluteQuadricRobustEstimatorListener listener)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether current constraints are enough to start the estimation.
    Creates a dual absolute quadric robust estimator using default method.
    create(com.irurueta.numerical.robust.RobustEstimatorMethod method)
    Creates a dual absolute quadric robust estimator using provided method.
    create(List<com.irurueta.geometry.PinholeCamera> cameras)
    Creates a dual absolute quadric robust estimator using provided cameras.
    create(List<com.irurueta.geometry.PinholeCamera> cameras, double[] qualityScores)
    Creates a dual absolute quadric robust estimator using provided cameras.
    create(List<com.irurueta.geometry.PinholeCamera> cameras, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
    Creates a dual absolute quadric robust estimator using provided cameras.
    create(List<com.irurueta.geometry.PinholeCamera> cameras, com.irurueta.numerical.robust.RobustEstimatorMethod method)
    Creates a dual absolute quadric robust estimator using provided cameras.
    Estimates the Dual Absolute Quadric using provided cameras.
    List<com.irurueta.geometry.PinholeCamera>
    Obtains the list of cameras used to estimate the Dual Absolute Quadric (DAQ).
    double
    Returns amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%).
    double
    Returns threshold to determine whether estimated Dual Absolute Quadric (DAQ) has rank 3 or not when validation is enabled.
    double
    Returns aspect ratio of focal distances (i.e. vertical focal distance divided by horizontal focal distance).
    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 minimum number of required cameras needed to estimate the Dual Absolute Quadric (DAQ).
    float
    Returns amount of progress variation before notifying a progress change during estimation.
    double[]
    Returns quality scores corresponding to each camera.
    private void
    internalSetCameras(List<com.irurueta.geometry.PinholeCamera> cameras)
    Sets list of cameras.
    boolean
    Indicates whether enforced singularity will be validated by checking that determinant of estimated Dual Absolute Quadric (DAQ) is below a certain threshold.
    boolean
    Returns boolean indicating whether aspect ratio of focal distances (i.e.
    boolean
    Indicates whether listener has been provided and is available for retrieval.
    boolean
    Indicates whether this instance is locked.
    boolean
    Returns boolean indicating whether principal point is assumed to be at origin of coordinates or not.
    boolean
    Returns value indicating whether required data has been provided so that DAQ estimation can start.
    boolean
    Indicates whether a singular DAQ is enforced or not.
    boolean
    Returns boolean indicating whether camera skewness is assumed to be zero or not.
    protected double
    residual(DualAbsoluteQuadric daq, com.irurueta.geometry.PinholeCamera camera)
    Computes the residual between a dual absolute quadric (DAQ) and a pinhole camera.
    private double
    residual1stRowEqualTo2ndRow(DualAbsoluteQuadric daq, double p11, double p21, double p12, double p22, double p13, double p23, double p14, double p24)
    Computes residual for the equation p1T*daq*p1 = r^2*p2T*daq*p2.
    private double
    residual2ndRowAnd1stRow(DualAbsoluteQuadric daq, double p11, double p21, double p12, double p22, double p13, double p23, double p14, double p24)
    Computes residual for the equation p2T*daq*p1.
    private double
    residual3rdRowAnd1stRow(DualAbsoluteQuadric daq, double p11, double p31, double p12, double p32, double p13, double p33, double p14, double p34)
    Computes residual for the equation p3T*daq*p1.
    private double
    residual3rdRowAnd2ndRow(DualAbsoluteQuadric daq, double p21, double p31, double p22, double p32, double p23, double p33, double p24, double p34)
    Computes residual for the equation p3T*daq*p2.
    final void
    setCameras(List<com.irurueta.geometry.PinholeCamera> cameras)
    Sets the list of cameras used to estimate the Dual Absolute Quadric (DAQ).
    void
    setConfidence(double confidence)
    Sets amount of confidence expressed as a value between 0.0 and 1.0 (which is equivalent to 100%).
    void
    setDeterminantThreshold(double determinantThreshold)
    Sets threshold to determine whether estimated Dual Absolute Quadric (DAQ) has rank 3 or not when validation is enabled.
    void
    setEnforcedSingularityValidated(boolean validateEnforcedSingularity)
    Specifies whether enforced singularity will be validated by checking that determinant of estimated Dual Absolute Quadric (DAQ) is below a certain threshold.
    void
    setFocalDistanceAspectRatio(double focalDistanceAspectRatio)
    Sets aspect ratio of focal distances (i.e. vertical focal distance divided by horizontal focal distance).
    void
    setFocalDistanceAspectRatioKnown(boolean focalDistanceAspectRatioKnown)
    Sets value indicating whether aspect ratio of focal distances (i.e.
    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
    setPrincipalPointAtOrigin(boolean principalPointAtOrigin)
    Sets boolean indicating whether principal point is assumed to be at origin of coordinates or not.
    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 camera.
    void
    setSingularityEnforced(boolean singularityEnforced)
    Specifies whether a singular DAQ is enforced or not.
    void
    setZeroSkewness(boolean zeroSkewness)
    Sets boolean indicating whether camera skewness is assumed to be zero or not.

    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:
    • cameras

      protected List<com.irurueta.geometry.PinholeCamera> cameras
      Cameras to estimate dual absolute quadric (DAQ).
    • daqEstimator

      protected final LMSEDualAbsoluteQuadricEstimator daqEstimator
      Internal non-robust estimator of DAQ.
    • listener

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

      protected 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

    • DualAbsoluteQuadricRobustEstimator

      protected DualAbsoluteQuadricRobustEstimator()
      Constructor.
    • DualAbsoluteQuadricRobustEstimator

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

      protected DualAbsoluteQuadricRobustEstimator(List<com.irurueta.geometry.PinholeCamera> cameras)
      Constructor.
      Parameters:
      cameras - list of cameras used to estimate the dual absolute quadric (DAQ), which can be used to obtain pinhole camera intrinsic parameters.
      Throws:
      IllegalArgumentException - if not enough cameras are provided for default settings. Hence, at least 2 cameras must be provided.
    • DualAbsoluteQuadricRobustEstimator

      protected DualAbsoluteQuadricRobustEstimator(List<com.irurueta.geometry.PinholeCamera> cameras, DualAbsoluteQuadricRobustEstimatorListener listener)
      Constructor.
      Parameters:
      cameras - list of cameras used to estimate the dual absolute quadric (DAQ), which can be used to obtain pinhole camera intrinsic parameters.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if not enough cameras are provided for default settings. Hence, at least 2 cameras must be provided.
  • Method Details

    • isZeroSkewness

      public boolean isZeroSkewness()
      Returns boolean indicating whether camera skewness is assumed to be zero or not. Skewness determines whether LCD sensor cells are properly aligned or not, where zero indicates perfect alignment. Typically, skewness is a value equal or very close to zero.
      Returns:
      true if camera skewness is assumed to be zero, otherwise camera skewness is estimated.
    • setZeroSkewness

      public void setZeroSkewness(boolean zeroSkewness) throws com.irurueta.geometry.estimators.LockedException
      Sets boolean indicating whether camera skewness is assumed to be zero or not. Skewness determines whether LCD sensor cells are properly aligned or not, where zero indicates perfect alignment. Typically, skewness is a value equal or very close to zero.
      Parameters:
      zeroSkewness - true if camera skewness is assumed to be zero, otherwise camera skewness is estimated.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • isPrincipalPointAtOrigin

      public boolean isPrincipalPointAtOrigin()
      Returns boolean indicating whether principal point is assumed to be at origin of coordinates or not. Typically principal point is located at image center (origin of coordinates), and usually matches the center of radial distortion if it is taken into account.
      Returns:
      true if principal point is assumed to be at origin of coordinates, false if principal point must be estimated
    • setPrincipalPointAtOrigin

      public void setPrincipalPointAtOrigin(boolean principalPointAtOrigin) throws com.irurueta.geometry.estimators.LockedException
      Sets boolean indicating whether principal point is assumed to be at origin of coordinates or not. Typically principal point is located at image center (origin of coordinates), and usually matches the center of radial distortion if it is taken into account.
      Parameters:
      principalPointAtOrigin - true if principal point is assumed to be at origin of coordinates, false if principal point must be estimated.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • isFocalDistanceAspectRatioKnown

      public boolean isFocalDistanceAspectRatioKnown()
      Returns boolean indicating whether aspect ratio of focal distances (i.e. vertical focal distance divided by horizontal focal distance) is known or not. Notice that focal distance aspect ratio is not related to image size aspect ratio. Typically, LCD sensor cells are square and hence aspect ratio of focal distances is known and equal to 1. This value is only taken into account if skewness is assumed to be zero, otherwise it is ignored.
      Returns:
      true if focal distance aspect ratio is known, false otherwise.
    • setFocalDistanceAspectRatioKnown

      public void setFocalDistanceAspectRatioKnown(boolean focalDistanceAspectRatioKnown) throws com.irurueta.geometry.estimators.LockedException
      Sets value indicating whether aspect ratio of focal distances (i.e. vertical focal distance divided by horizontal focal distance) is known or not. Notice that focal distance aspect ratio is not related to image size aspect ratio. Typically, LCD sensor cells are square and hence aspect ratio of focal distances is known and equal to 1. This value is only taken into account if skewness is assumed to be zero, otherwise it is ignored.
      Parameters:
      focalDistanceAspectRatioKnown - true if focal distance aspect ratio is known, false otherwise.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getFocalDistanceAspectRatio

      public double getFocalDistanceAspectRatio()
      Returns aspect ratio of focal distances (i.e. vertical focal distance divided by horizontal focal distance). This value is only taken into account if skewness is assumed to be zero and focal distance aspect ratio is marked as known, otherwise it is ignored. By default, this is 1.0, since it is taken into account that typically LCD sensor cells are square and hence aspect ratio focal distances is known and equal to 1. Notice that focal distance aspect ratio is not related to image size aspect ratio. Notice that a negative aspect ratio indicates that vertical axis is reversed. This can be useful in some situations where image vertical coordinates are reversed respect to the physical world (i.e. in computer graphics typically image vertical coordinates go downwards, while in physical world they go upwards).
      Returns:
      aspect ratio of focal distances.
    • setFocalDistanceAspectRatio

      public void setFocalDistanceAspectRatio(double focalDistanceAspectRatio) throws com.irurueta.geometry.estimators.LockedException
      Sets aspect ratio of focal distances (i.e. vertical focal distance divided by horizontal focal distance). This value is only taken into account if skewness is assumed to be zero and focal distance aspect ratio is marked as known, otherwise it is ignored. By default, this is 1.0, since it is taken into account that typically LCD sensor cells are square and hence aspect ratio focal distances is known and equal to 1. Notice that focal distance aspect ratio is not related to image size aspect ratio Notice that a negative aspect ratio indicates that vertical axis is reversed. This can be useful in some situations where image vertical coordinates are reversed respect to the physical world (i.e. in computer graphics typically image vertical coordinates go downwards, while in physical world they go upwards).
      Parameters:
      focalDistanceAspectRatio - aspect ratio of focal distances to be set.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
      IllegalArgumentException - if focal distance aspect ratio is too close to zero, as it might produce numerical instabilities.
    • isSingularityEnforced

      public boolean isSingularityEnforced()
      Indicates whether a singular DAQ is enforced or not. Dual Absolute Quadric is singular (has rank 3) in any projective space, however, due to noise in samples, estimated DAQ might not be fully singular.
      Returns:
      true when singular DAQ is enforced, false otherwise.
    • setSingularityEnforced

      public void setSingularityEnforced(boolean singularityEnforced) throws com.irurueta.geometry.estimators.LockedException
      Specifies whether a singular DAQ is enforced or not. Dual Absolute Quadric is singular (has rank 3) in any projective space, however, due to noise in samples, estimated DAQ might not be fully singular.
      Parameters:
      singularityEnforced - true when singular DAQ is enforced, false otherwise.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • isEnforcedSingularityValidated

      public boolean isEnforcedSingularityValidated()
      Indicates whether enforced singularity will be validated by checking that determinant of estimated Dual Absolute Quadric (DAQ) is below a certain threshold.
      Returns:
      true if enforced singularity is validated, false otherwise.
    • setEnforcedSingularityValidated

      public void setEnforcedSingularityValidated(boolean validateEnforcedSingularity) throws com.irurueta.geometry.estimators.LockedException
      Specifies whether enforced singularity will be validated by checking that determinant of estimated Dual Absolute Quadric (DAQ) is below a certain threshold.
      Parameters:
      validateEnforcedSingularity - true if enforced singularity is validated, false otherwise.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getDeterminantThreshold

      public double getDeterminantThreshold()
      Returns threshold to determine whether estimated Dual Absolute Quadric (DAQ) has rank 3 or not when validation is enabled.
      Returns:
      threshold to determine whether estimated DAQ has rank 3 or not.
    • setDeterminantThreshold

      public void setDeterminantThreshold(double determinantThreshold) throws com.irurueta.geometry.estimators.LockedException
      Sets threshold to determine whether estimated Dual Absolute Quadric (DAQ) has rank 3 or not when validation is enabled.
      Parameters:
      determinantThreshold - threshold to determine whether estimated DAQ has rank 3 or not.
      Throws:
      IllegalArgumentException - if provided value is zero or negative.
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • 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(DualAbsoluteQuadricRobustEstimatorListener 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 whether this instance is locked.
      Returns:
      true if this estimator is busy estimating the Dual Absolute Quadric, 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.
    • getCameras

      public List<com.irurueta.geometry.PinholeCamera> getCameras()
      Obtains the list of cameras used to estimate the Dual Absolute Quadric (DAQ).
      Returns:
      list of cameras to estimate the DAQ.
    • setCameras

      public final void setCameras(List<com.irurueta.geometry.PinholeCamera> cameras) throws com.irurueta.geometry.estimators.LockedException
      Sets the list of cameras used to estimate the Dual Absolute Quadric (DAQ).
      Parameters:
      cameras - list of cameras used to estimate the DAQ.
      Throws:
      IllegalArgumentException - if list is null.
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getMinNumberOfRequiredCameras

      public int getMinNumberOfRequiredCameras()
      Returns minimum number of required cameras needed to estimate the Dual Absolute Quadric (DAQ). At least 8 equations are needed to solve the DAQ For each imposed constraint, one less equation is required. Depending on the number of constraints more or less cameras will be required. If zero skewness is enforced, a solution is available with 8 cameras. If zero skewness and focal distance aspect ratio is known, then a solution is available with 4 cameras. If principal point is located at origin, then a solution is available with 4 cameras. If zero skewness and principal point at origin are enforced, then a solution is available with 3 cameras If zero skewness is enforced, focal distance aspect ratio is known and principal point is at origin, then a solution is available with 2 cameras. NOTE: minimum number of cameras considers only the cameras providing additional information. If a camera is equivalent to another one or does not provide additional information (such as a camera at the origin with no rotation), then more cameras will be needed.
      Returns:
      minimum number of required cameras needed to estimate the Dual Absolute Quadric (DAQ) or -1 if constraints configurations is not valid.
    • areValidConstraints

      public boolean areValidConstraints()
      Indicates whether current constraints are enough to start the estimation. In order to obtain a linear solution for the DAQ estimation, we need at least the principal point at origin constraint.
      Returns:
      true if constraints are valid, false otherwise.
    • isReady

      public boolean isReady()
      Returns value indicating whether required data has been provided so that DAQ estimation can start. If true, estimator is ready to compute the DAQ, otherwise more data needs to be provided.
      Returns:
      true if estimator is ready, false otherwise.
    • getQualityScores

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

      public void setQualityScores(double[] qualityScores) throws com.irurueta.geometry.estimators.LockedException
      Sets quality scores corresponding to each camera. The larger the score value the better the quality of the camera. This implementation makes no action. Subclasses using quality scores must implement proper behaviour.
      Parameters:
      qualityScores - quality scores corresponding to each camera.
      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 required number of cameras.
    • estimate

      public abstract DualAbsoluteQuadric estimate() throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, com.irurueta.numerical.robust.RobustEstimatorException
      Estimates the Dual Absolute Quadric using provided cameras.
      Returns:
      estimated Dual Absolute Quadric (DAQ).
      Throws:
      com.irurueta.geometry.estimators.LockedException - if robust estimator is locked.
      com.irurueta.geometry.estimators.NotReadyException - if no valid input data has already been provided.
      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 DualAbsoluteQuadricRobustEstimator create(com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a dual absolute quadric robust estimator using provided method.
      Parameters:
      method - method of a robust estimator algorithm to estimate best DAQ.
      Returns:
      an instance of a dual absolute quadric robust estimator.
    • create

      public static DualAbsoluteQuadricRobustEstimator create(List<com.irurueta.geometry.PinholeCamera> cameras, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a dual absolute quadric robust estimator using provided cameras.
      Parameters:
      cameras - list of cameras.
      qualityScores - quality scores corresponding to each camera.
      method - method of a robust estimator algorithm to estimate best DAQ.
      Returns:
      an instance of a dual absolute quadric robust estimator.
      Throws:
      IllegalArgumentException - if provided list of cameras and quality scores don't have the same size or size is too short.
    • create

      public static DualAbsoluteQuadricRobustEstimator create(List<com.irurueta.geometry.PinholeCamera> cameras, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a dual absolute quadric robust estimator using provided cameras.
      Parameters:
      cameras - list of cameras.
      method - method of a robust estimator algorithm to estimate best DAQ.
      Returns:
      an instance of a dual absolute quadric robust estimator.
      Throws:
      IllegalArgumentException - if provided list of cameras is too short.
    • create

      public static DualAbsoluteQuadricRobustEstimator create()
      Creates a dual absolute quadric robust estimator using default method.
      Returns:
      an instance of a dual absolute quadric robust estimator.
    • create

      public static DualAbsoluteQuadricRobustEstimator create(List<com.irurueta.geometry.PinholeCamera> cameras, double[] qualityScores)
      Creates a dual absolute quadric robust estimator using provided cameras.
      Parameters:
      cameras - list of cameras.
      qualityScores - quality scores corresponding to each camera.
      Returns:
      an instance of a dual absolute quadric robust estimator.
      Throws:
      IllegalArgumentException - if provided list of cameras and quality scores don't have the same size or size is too short.
    • create

      public static DualAbsoluteQuadricRobustEstimator create(List<com.irurueta.geometry.PinholeCamera> cameras)
      Creates a dual absolute quadric robust estimator using provided cameras.
      Parameters:
      cameras - list of cameras.
      Returns:
      an instance of a dual absolute quadric robust estimator.
      Throws:
      IllegalArgumentException - if provided list of cameras is too short.
    • residual

      protected double residual(DualAbsoluteQuadric daq, com.irurueta.geometry.PinholeCamera camera)
      Computes the residual between a dual absolute quadric (DAQ) and a pinhole camera.
      Parameters:
      daq - a dual absolute quadric (DAQ).
      camera - a camera.
      Returns:
      residual.
    • residual2ndRowAnd1stRow

      private double residual2ndRowAnd1stRow(DualAbsoluteQuadric daq, double p11, double p21, double p12, double p22, double p13, double p23, double p14, double p24)
      Computes residual for the equation p2T*daq*p1.
      Parameters:
      daq - estimated DAQ.
      p11 - element (1,1) of camera matrix.
      p21 - element (2,1) of camera matrix.
      p12 - element (1,2) of camera matrix.
      p22 - element (2,2) of camera matrix.
      p13 - element (1,3) of camera matrix.
      p23 - element (2,3) of camera matrix.
      p14 - element (1,4) of camera matrix.
      p24 - element (2,4) of camera matrix.
      Returns:
      obtained residual (ideally should be zero).
    • residual3rdRowAnd1stRow

      private double residual3rdRowAnd1stRow(DualAbsoluteQuadric daq, double p11, double p31, double p12, double p32, double p13, double p33, double p14, double p34)
      Computes residual for the equation p3T*daq*p1.
      Parameters:
      daq - estimated DAQ.
      p11 - element (1,1) of camera matrix.
      p31 - element (3,1) of camera matrix.
      p12 - element (1,2) of camera matrix.
      p32 - element (3,2) of camera matrix.
      p13 - element (1,3) of camera matrix.
      p33 - element (3,3) of camera matrix.
      p14 - element (1,4) of camera matrix.
      p34 - element (3,4) of camera matrix.
      Returns:
      obtained residual (ideally should be zero).
    • residual3rdRowAnd2ndRow

      private double residual3rdRowAnd2ndRow(DualAbsoluteQuadric daq, double p21, double p31, double p22, double p32, double p23, double p33, double p24, double p34)
      Computes residual for the equation p3T*daq*p2.
      Parameters:
      daq - estimated DAQ.
      p21 - element (2,1) of camera matrix.
      p31 - element (3,1) of camera matrix.
      p22 - element (2,2) of camera matrix.
      p32 - element (3,2) of camera matrix.
      p23 - element (2,3) of camera matrix.
      p33 - element (3,3) of camera matrix.
      p24 - element (2,4) of camera matrix.
      p34 - element (3,4) of camera matrix.
      Returns:
      obtained residual (ideally should be zero).
    • residual1stRowEqualTo2ndRow

      private double residual1stRowEqualTo2ndRow(DualAbsoluteQuadric daq, double p11, double p21, double p12, double p22, double p13, double p23, double p14, double p24)
      Computes residual for the equation p1T*daq*p1 = r^2*p2T*daq*p2.
      Parameters:
      daq - estimated DAQ.
      p11 - element (1,1) of camera matrix.
      p21 - element (2,1) of camera matrix.
      p12 - element (1,2) of camera matrix.
      p22 - element (2,2) of camera matrix.
      p13 - element (1,3) of camera matrix.
      p23 - element (2,3) of camera matrix.
      p14 - element (1,4) of camera matrix.
      p24 - element (2,4) of camera matrix.
      Returns:
      obtained residual (ideally should be zero).
    • internalSetCameras

      private void internalSetCameras(List<com.irurueta.geometry.PinholeCamera> cameras)
      Sets list of cameras. This method does not check whether estimator is locked.
      Parameters:
      cameras - list of cameras to estimate DAQ.
      Throws:
      IllegalArgumentException - if provided list of cameras is null or too small.