Class UPnPPointCorrespondencePinholeCameraRobustEstimator

Direct Known Subclasses:
LMedSUPnPPointCorrespondencePinholeCameraRobustEstimator, MSACUPnPPointCorrespondencePinholeCameraRobustEstimator, PROMedSUPnPPointCorrespondencePinholeCameraRobustEstimator, PROSACUPnPPointCorrespondencePinholeCameraRobustEstimator, RANSACUPnPPointCorrespondencePinholeCameraRobustEstimator

public abstract class UPnPPointCorrespondencePinholeCameraRobustEstimator extends PointCorrespondencePinholeCameraRobustEstimator
Base abstract class for algorithms to robustly find the best pinhole camera for collections of matched 3D/2D points using UPnP (Uncalibrated Perspective-n-Point) algorithm. Implementations of this class should be able to detect and discard outliers in order to find the best solution.
  • Field Details

    • planarConfigurationAllowed

      protected boolean planarConfigurationAllowed
      Indicates whether planar configuration is checked to determine whether point correspondences are in such configuration and find a specific solution for such case.
    • nullspaceDimension2Allowed

      protected boolean nullspaceDimension2Allowed
      Indicates whether the case where a dimension 2 null-space is allowed. When allowed, additional constraints are taken into account to ensure equality of scales so that less point correspondences are required. Enabling this parameter is usually ok.
    • planarThreshold

      protected double planarThreshold
      Threshold to determine whether 3D matched points are in a planar configuration. Points are considered to be laying in a plane when the smallest singular value of their covariance matrix has a value much smaller than the largest one as many times as this value.
    • skewness

      protected double skewness
      Skewness value of intrinsic parameters to be used on estimated camera.
    • horizontalPrincipalPoint

      protected double horizontalPrincipalPoint
      Horizontal coordinate of principal point on intrinsic parameters to be used on estimated camera.
    • verticalPrincipalPoint

      protected double verticalPrincipalPoint
      Vertical coordinate of principal point on intrinsic parameters to be used on estimated camera.
  • Constructor Details

    • UPnPPointCorrespondencePinholeCameraRobustEstimator

      protected UPnPPointCorrespondencePinholeCameraRobustEstimator()
      Constructor.
    • UPnPPointCorrespondencePinholeCameraRobustEstimator

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

      protected UPnPPointCorrespondencePinholeCameraRobustEstimator(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).
    • UPnPPointCorrespondencePinholeCameraRobustEstimator

      protected UPnPPointCorrespondencePinholeCameraRobustEstimator(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

    • isPlanarConfigurationAllowed

      public boolean isPlanarConfigurationAllowed()
      Indicates whether planar configuration is checked to determine whether point correspondences are in such configuration and find a specific solution for such case.
      Returns:
      true to allow specific solutions for planar configurations, false to always find a solution assuming the general case.
    • setPlanarConfigurationAllowed

      public void setPlanarConfigurationAllowed(boolean planarConfigurationAllowed) throws LockedException
      Specifies whether planar configuration is checked to determine whether point correspondences are in such configuration and find a specific solution for such case.
      Parameters:
      planarConfigurationAllowed - true to allow specific solutions for planar configurations, false to always find a solution assuming the general case.
      Throws:
      LockedException - if estimator is locked.
    • isNullspaceDimension2Allowed

      public boolean isNullspaceDimension2Allowed()
      Indicates whether the case where a dimension 2 null-space is allowed. When allowed, additional constraints are taken into account to ensure equality of scales so that less point correspondences are required. Enabling this parameter is usually ok.
      Returns:
      true to allow 2-dimensional null-space, false otherwise.
    • setNullspaceDimension2Allowed

      public void setNullspaceDimension2Allowed(boolean nullspaceDimension2Allowed) throws LockedException
      Specifies whether the case where a dimension 2 null-space is allowed. When allowed, additional constraints are taken into account to ensure equality of scales so that less point correspondences are required. Enabling this parameter is usually ok.
      Parameters:
      nullspaceDimension2Allowed - true to allow 2-dimensional null-space, false otherwise.
      Throws:
      LockedException - if estimator is locked.
    • getPlanarThreshold

      public double getPlanarThreshold()
      Gets threshold to determine whether 3D matched points are in a planar configuration. Points are considered to be laying in a plane when the smallest singular value of their covariance matrix has a value much smaller than the largest one as many times as this value.
      Returns:
      threshold to determine whether 3D matched points are in a planar configuration.
    • setPlanarThreshold

      public void setPlanarThreshold(double planarThreshold) throws LockedException
      Sets threshold to determine whether 3D matched points are in a planar configuration. Points are considered to be laying in a plane when the smallest singular value of their covariance matrix has a value much smaller than the largest one as many times as this value.
      Parameters:
      planarThreshold - threshold to determine whether 3D matched points are in a planar configuration.
      Throws:
      IllegalArgumentException - if provided threshold is negative.
      LockedException - if estimator is locked.
    • getSkewness

      public double getSkewness()
      Gets skewness value of intrinsic parameters to be used on estimated camera.
      Returns:
      skewness value of intrinsic parameters to be used on estimated camera.
    • setSkewness

      public void setSkewness(double skewness) throws LockedException
      Sets skewness value of intrinsic parameters to be used on estimated camera.
      Parameters:
      skewness - skewness value of intrinsic parameters to be used on estimated camera.
      Throws:
      LockedException - if estimator is locked.
    • getHorizontalPrincipalPoint

      public double getHorizontalPrincipalPoint()
      Gets horizontal coordinate of principal point on intrinsic parameters to be used on estimated camera.
      Returns:
      horizontal coordinate of principal point.
    • setHorizontalPrincipalPoint

      public void setHorizontalPrincipalPoint(double horizontalPrincipalPoint) throws LockedException
      Sets horizontal coordinate of principal point on intrinsic parameters to be used on estimated camera.
      Parameters:
      horizontalPrincipalPoint - horizontal coordinate of principal point.
      Throws:
      LockedException - if estimator is locked.
    • getVerticalPrincipalPoint

      public double getVerticalPrincipalPoint()
      Gets vertical coordinate of principal point on intrinsic parameters to be used on estimated camera.
      Returns:
      vertical coordinate of principal point.
    • setVerticalPrincipalPoint

      public void setVerticalPrincipalPoint(double verticalPrincipalPoint) throws LockedException
      Sets vertical coordinate of principal point on intrinsic parameters to be used on estimated camera.
      Parameters:
      verticalPrincipalPoint - vertical coordinate of principal point.
      Throws:
      LockedException - if estimator is locked.
    • isNormalizeSubsetPointCorrespondences

      public boolean isNormalizeSubsetPointCorrespondences()
      Returns value indicating if each picked subset point correspondences are normalized to increase the accuracy of the estimation.
      Overrides:
      isNormalizeSubsetPointCorrespondences in class PointCorrespondencePinholeCameraRobustEstimator
      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.
      Overrides:
      setNormalizeSubsetPointCorrespondences in class PointCorrespondencePinholeCameraRobustEstimator
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator create(com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided robust estimator method.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, com.irurueta.numerical.robust.RobustEstimatorMethod method)
      Creates a pinhole camera robust estimator based on point correspondences and using provided listener.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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

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

      public static UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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.
      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.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator create(double[] qualityScores)
      Creates a pinhole camera robust estimator based on point correspondences and using provided quality scores and default robust estimator method.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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 UPnPPointCorrespondencePinholeCameraRobustEstimator 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.
      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).