Class PointCorrespondencePinholeCameraRobustEstimator

java.lang.Object
com.irurueta.geometry.estimators.PinholeCameraRobustEstimator
com.irurueta.geometry.estimators.PointCorrespondencePinholeCameraRobustEstimator
Direct Known Subclasses:
DLTPointCorrespondencePinholeCameraRobustEstimator, EPnPPointCorrespondencePinholeCameraRobustEstimator, UPnPPointCorrespondencePinholeCameraRobustEstimator

public abstract class PointCorrespondencePinholeCameraRobustEstimator extends PinholeCameraRobustEstimator
This is an abstract class for algorithms to robustly find the best pinhole camera for collections of matched 3D/2D points. Implementations of this class should be able to detect and discard outliers in order to find the best solution.
  • Field Details

    • MIN_NUMBER_OF_POINT_CORRESPONDENCES

      public static final int MIN_NUMBER_OF_POINT_CORRESPONDENCES
      Minimum number of required point correspondences to estimate a pinhole camera.
      See Also:
    • DEFAULT_NORMALIZE_SUBSET_POINT_CORRESPONDENCES

      public static final boolean DEFAULT_NORMALIZE_SUBSET_POINT_CORRESPONDENCES
      Indicates if by default point correspondences for each picked subset of samples is normalized to increase the accuracy of the estimation.
      See Also:
    • DEFAULT_ROBUST_METHOD

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

      protected List<Point3D> points3D
      List of matched 3D points.
    • points2D

      protected List<Point2D> points2D
      List of matched 2D points.
    • normalizeSubsetPointCorrespondences

      protected boolean normalizeSubsetPointCorrespondences
      Indicates if each picked subset point correspondences are normalized to increase the accuracy of the estimation.
  • Constructor Details

    • PointCorrespondencePinholeCameraRobustEstimator

      protected PointCorrespondencePinholeCameraRobustEstimator()
      Constructor.
    • PointCorrespondencePinholeCameraRobustEstimator

      protected PointCorrespondencePinholeCameraRobustEstimator(List<Point3D> points3D, List<Point2D> points2D)
      Constructor with lists of points to be used to estimate a pinhole camera. Points in the lists located at the same position are considered to be matched. Hence, both lists must have the same size, and their size must be greater or equal than MIN_NUMBER_OF_POINT_CORRESPONDENCES (6 points).
      Parameters:
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • PointCorrespondencePinholeCameraRobustEstimator

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

      protected PointCorrespondencePinholeCameraRobustEstimator(PinholeCameraRobustEstimatorListener listener, List<Point3D> points3D, List<Point2D> points2D)
      Constructor with listener and lists of points to be used to estimate a pinhole camera. Points in the lists located at the same position are considered to be matched. Hence, both lists must have the same size, and their size must be greater or equal than MIN_NUMBER_OF_POINT_CORRESPONDENCES (6 points).
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
  • Method Details

    • getPoints3D

      public List<Point3D> getPoints3D()
      Returns list of 3D points to be used to estimate a pinhole camera. Each point in the list of 3D points must be matched with the corresponding 2D point in the list of projected 2D points located at the same position. Hence, both 2D and 3D points lists must have the same size, and their size must be greater or equal than MIN_NUMBER_OF_POINT_CORRESPONDENCES (6 points).
      Returns:
      list of 3D points to be used to estimate a pinhole camera.
    • getPoints2D

      public List<Point2D> getPoints2D()
      Returns list of 2D points ot be used to estimate a pinhole camera. Each point in the list of 2D points must be matched with the corresponding 3D point in the list of 3D points that can be projected into a 2D point using a pinhole camera. Hence, both 2D and 3D points lists must have the same size, and their size must be greater or equal than MIN_NUMBER_OF_POINT_CORRESPONDENCES (6 points).
      Returns:
      list of 2D points to be used to estimate a pinhole camera.
    • setPoints

      public final void setPoints(List<Point3D> points3D, List<Point2D> points2D) throws LockedException
      Sets lists of 3D/2D points to be used to estimate a pinhole camera. Points in the list located at the same position are considered to be matched. Hence, both lists must have the same size, and their size must be greater or equal than MIN_NUMBER_OF_POINT_CORRESPONDENCES.
      Parameters:
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
      LockedException - if estimator is locked because a computation is already in progress.
    • isReady

      public boolean isReady()
      Indicates if estimator is ready to start the pinhole camera estimation. This is true when input data (i.e. lists of 2D/3D matched points) are provided and a minimum of MIN_NUMBER_OF_POINT_CORRESPONDENCES are available.
      Returns:
      true if estimator is ready, false otherwise.
    • getQualityScores

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

      public void setQualityScores(double[] qualityScores) throws LockedException
      Sets quality scores corresponding to each pair of matched points. The larger the score value the better the quality of the matching. This implementation makes no action. Subclasses using quality scores must implement proper behaviour.
      Parameters:
      qualityScores - quality scores corresponding to each pair of matched points.
      Throws:
      LockedException - if robust estimator is locked because an estimation is already in progress.
      IllegalArgumentException - if provided quality scores length is smaller than MIN_NUMBER_OF_POINT_CORRESPONDENCES (i.e. 6 samples).
    • isNormalizeSubsetPointCorrespondences

      public boolean isNormalizeSubsetPointCorrespondences()
      Returns value indicating if each picked subset point correspondences are normalized to increase the accuracy of the estimation.
      Returns:
      true if each picked subset point correspondences are normalized, false otherwise.
    • setNormalizeSubsetPointCorrespondences

      public void setNormalizeSubsetPointCorrespondences(boolean normalizeSubsetPointCorrespondences) throws LockedException
      Sets value indicating if each picked subset point correspondences are normalized to increase the accuracy of the estimation.
      Parameters:
      normalizeSubsetPointCorrespondences - true if each picked subset point correspondences are normalized, false otherwise.
      Throws:
      LockedException - if robust estimator is locked because an estimation is already in progress.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided robust estimator method + DLT.
      Parameters:
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(List<Point3D> points3D, List<Point2D> points2D, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points and robust estimator method + DLT.
      Parameters:
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener and robust estimator method + DLT.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, List<Point3D> points3D, List<Point2D> points2D, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points and robust estimator method + DLT.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided quality scores and robust estimator method + DLT.
      Parameters:
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than required minimum size (6 samples).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points, quality scores and robust estimator method + DLT.
      Parameters:
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener and quality scores and robust estimator method + DLT.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores don't have the required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points, quality scores and robust estimator method + DLT.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraIntrinsicParameters intrinsic, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided robust estimator method + EPnP.
      Parameters:
      intrinsic - intrinsic parameters of camera to be estimated.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraIntrinsicParameters intrinsic, List<Point3D> points3D, List<Point2D> points2D, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points and robust estimator method + EPnP.
      Parameters:
      intrinsic - intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, PinholeCameraIntrinsicParameters intrinsic, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener and robust estimator method + EPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      intrinsic - intrinsic parameters of camera to be estimated.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, PinholeCameraIntrinsicParameters intrinsic, List<Point3D> points3D, List<Point2D> points2D, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points and robust estimator method + EPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      intrinsic - intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraIntrinsicParameters intrinsic, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided quality scores and robust estimator method + EPnP.
      Parameters:
      intrinsic - intrinsic parameters of camera to be estimated.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than required minimum size (6 samples).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraIntrinsicParameters intrinsic, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points, quality scores and robust estimator method + EPnP.
      Parameters:
      intrinsic - intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, PinholeCameraIntrinsicParameters intrinsic, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener and quality scores and a robust estimation method + EPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      intrinsic - intrinsic parameters of camera to be estimated.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores don't have the required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, PinholeCameraIntrinsicParameters intrinsic, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points, quality scores and robust estimator method + EPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      intrinsic - intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided robust estimator method + UPnP.
      Parameters:
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, List<Point3D> points3D, List<Point2D> points2D, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points and robust estimator method + UPnP.
      Parameters:
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener and robust method + UPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, List<Point3D> points3D, List<Point2D> points2D, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points and robust estimator method + UPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided quality scores and robust estimator method + UPnP.
      Parameters:
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than required minimum size (6 samples).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points, quality scores and robust estimator method + UPnP.
      Parameters:
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener and quality scores and robust method + UPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores don't have the required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points, quality scores and robust estimator method + UPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      method - method of a robust estimator algorithm to estimate the best pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      Creates a pinhole camera robust estimator based on point correspondences and using default robust estimator method + DLT.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(List<Point3D> points3D, List<Point2D> points2D)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points and default robust estimator method + DLT.
      Parameters:
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      Creates a pinhole camera robust estimator based on point correspondences and using provided listener and default robust estimator method + DLT.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points and default robust estimator method + DLT.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided quality scores and default robust estimator method + DLT.
      Parameters:
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than required minimum size (6 samples).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points, quality scores and default robust estimator method + DLT.
      Parameters:
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, quality scores and default robust estimator method + DLT.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores don't have the required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points, quality scores and default robust estimator method + DLT.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      Creates a pinhole camera robust estimator based on point correspondences and using default robust estimator method + EPnP.
      Parameters:
      intrinsic - intrinsic parameters of camera to be estimated.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points and default robust estimator method + EPnP.
      Parameters:
      intrinsic - intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      Creates a pinhole camera robust estimator based on point correspondences and using provided listener and default robust estimator method + EPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      intrinsic - intrinsic parameters of camera to be estimated.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points and default robust estimator method + EPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      intrinsic - intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraIntrinsicParameters intrinsic, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided quality scores and default robust estimator method + EPnP.
      Parameters:
      intrinsic - intrinsic parameters of camera to be estimated.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than required minimum size (6 samples).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraIntrinsicParameters intrinsic, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points, quality scores and default robust estimator method + EPnP.
      Parameters:
      intrinsic - intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, quality scores and default robust estimator method + EPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      intrinsic - intrinsic parameters of camera to be estimated.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores don't have the required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, PinholeCameraIntrinsicParameters intrinsic, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points, quality scores and default robust estimator method + EPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      intrinsic - intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint)
      Creates a pinhole camera robust estimator based on point correspondences and using default robust estimator method + UPnP.
      Parameters:
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, List<Point3D> points3D, List<Point2D> points2D)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points and default robust estimator method + EPnP.
      Parameters:
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener and default robust estimator method + EPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      Returns:
      an instance of a pinhole camera robust estimator.
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, List<Point3D> points3D, List<Point2D> points2D)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points and default robust estimator method + UPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided quality scores and default robust estimator method + UPnP.
      Parameters:
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than required minimum size (6 samples).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided 2D/3D points, quality scores and default robust estimator method + UPnP.
      Parameters:
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, quality scores and default robust estimator method + UPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided quality scores don't have the required minimum size (6 correspondences).
    • create

      public static PointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double skewness, double horizontalPrincipalPoint, double verticalPrincipalPoint, List<Point3D> points3D, List<Point2D> points2D, double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener, 2D/3D points, quality scores and default robust estimator method + UPnP.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      skewness - skewness value of intrinsic parameters of camera to be estimated.
      horizontalPrincipalPoint - horizontal principal point value of intrinsic parameters of camera to be estimated.
      verticalPrincipalPoint - vertical principal point value of intrinsic parameters of camera to be estimated.
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      qualityScores - quality scores corresponding to each pair of matched points.
      Returns:
      an instance of a pinhole camera robust estimator.
      Throws:
      IllegalArgumentException - if provided lists of points and quality scores don't have the same size or their size is smaller than required minimum size (6 correspondences).
    • attemptRefine

      protected PinholeCamera attemptRefine(PinholeCamera pinholeCamera, double weight)
      Attempts to refine provided camera.
      Parameters:
      pinholeCamera - camera to be refined.
      weight - weight for suggestion residual.
      Returns:
      refined camera or provided camera if anything fails.
    • internalSetPoints

      private void internalSetPoints(List<Point3D> points3D, List<Point2D> points2D)
      Internal method to set lists of points to be used to estimate a pinhole camera. This method does not check whether estimator is locked or not.
      Parameters:
      points3D - list of 3D points used to estimate a pinhole camera.
      points2D - list of corresponding projected 2D points used to estimate a pinhole camera.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size or their size is smaller than required minimum size (6 points).
    • attemptSlowRefine

      private PinholeCamera attemptSlowRefine(PinholeCamera pinholeCamera, double weight)
      Attempts to refine provided camera using a slow but more accurate and stable algorithm by first doing a Powell optimization and then obtaining covariance using Levenberg/Marquardt if needed.
      Parameters:
      pinholeCamera - camera to be refined.
      weight - weight for suggestion residual.
      Returns:
      refined camera or provided camera if anything fails.
    • attemptFastRefine

      private PinholeCamera attemptFastRefine(PinholeCamera pinholeCamera, double weight)
      Attempts to refine provided camera using a fast algorithm based on Levenberg/Marquardt.
      Parameters:
      pinholeCamera - camera to be refined.
      weight - weight for suggestion residual.
      Returns:
      refined camera or provided camera if anything fails.