Package com.irurueta.ar.sfm
Class RANSACRobustSinglePoint3DTriangulator
java.lang.Object
com.irurueta.ar.sfm.RobustSinglePoint3DTriangulator
com.irurueta.ar.sfm.RANSACRobustSinglePoint3DTriangulator
Robustly triangulates 3D points from matched 2D points and their.
corresponding cameras on several views using RANSAC algorithm.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
Constant defining default threshold to determine whether samples are inliers or not.static final double
Minimum value that can be set as threshold.private double
Threshold to determine whether samples are inliers or not when testing possible estimation solutions.Fields inherited from class com.irurueta.ar.sfm.RobustSinglePoint3DTriangulator
cameras, confidence, DEFAULT_CONFIDENCE, DEFAULT_MAX_ITERATIONS, DEFAULT_PROGRESS_DELTA, DEFAULT_ROBUST_METHOD, DEFAULT_USE_HOMOGENEOUS_SOLUTION, listener, locked, MAX_CONFIDENCE, MAX_PROGRESS_DELTA, maxIterations, MIN_CONFIDENCE, MIN_ITERATIONS, MIN_PROGRESS_DELTA, MIN_REQUIRED_VIEWS, points2D, progressDelta, useHomogeneousSolution
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.RANSACRobustSinglePoint3DTriangulator
(List<com.irurueta.geometry.Point2D> points, List<com.irurueta.geometry.PinholeCamera> cameras) Constructor.RANSACRobustSinglePoint3DTriangulator
(List<com.irurueta.geometry.Point2D> points, List<com.irurueta.geometry.PinholeCamera> cameras, RobustSinglePoint3DTriangulatorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.irurueta.numerical.robust.RobustEstimatorMethod
Returns method being used for robust estimation.double
Returns threshold to determine whether points are inliers or not when testing possible estimation solutions.void
setThreshold
(double threshold) Sets threshold to determine whether points are inliers or not when testing possible estimation solutions.com.irurueta.geometry.Point3D
Triangulates provided matched 2D points being projected by each corresponding camera into a single 3D point.Methods inherited from class com.irurueta.ar.sfm.RobustSinglePoint3DTriangulator
create, create, create, create, create, create, getCameras, getConfidence, getListener, getMaxIterations, getPoints2D, getProgressDelta, getQualityScores, isListenerAvailable, isLocked, isReady, isUseHomogeneousSolution, setConfidence, setListener, setMaxIterations, setPointsAndCameras, setProgressDelta, setQualityScores, setUseHomogeneousSolution
-
Field Details
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLDConstant defining default threshold to determine whether samples are inliers or not. By default, 1.0 is considered a good value for cases where 2D point measures are done on pixels, since typically the minimum resolution is 1 pixel.- See Also:
-
MIN_THRESHOLD
public static final double MIN_THRESHOLDMinimum value that can be set as threshold. Threshold must be strictly greater than 0.0.- See Also:
-
threshold
private double thresholdThreshold to determine whether samples are inliers or not when testing possible estimation solutions. The threshold refers to the amount of projection error (i.e. distance of projected solution using each camera).
-
-
Constructor Details
-
RANSACRobustSinglePoint3DTriangulator
public RANSACRobustSinglePoint3DTriangulator()Constructor. -
RANSACRobustSinglePoint3DTriangulator
Constructor.- Parameters:
listener
- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
-
RANSACRobustSinglePoint3DTriangulator
public RANSACRobustSinglePoint3DTriangulator(List<com.irurueta.geometry.Point2D> points, List<com.irurueta.geometry.PinholeCamera> cameras) Constructor.- Parameters:
points
- Matched 2D points. Each point in the list is assumed to be projected by the corresponding camera in the list.cameras
- List of cameras associated to the matched 2D point on the same position as the camera on the list.- Throws:
IllegalArgumentException
- if provided lists don't have the same length or their length is less than 2 views, which is the minimum required to compute triangulation.
-
RANSACRobustSinglePoint3DTriangulator
public RANSACRobustSinglePoint3DTriangulator(List<com.irurueta.geometry.Point2D> points, List<com.irurueta.geometry.PinholeCamera> cameras, RobustSinglePoint3DTriangulatorListener listener) Constructor.- Parameters:
points
- Matched 2D points. Each point in the list is assumed to be projected by the corresponding camera in the list.cameras
- List of cameras associated to the matched 2D point on the same position as the camera on the list.listener
- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.- Throws:
IllegalArgumentException
- if provided lists don't have the same length or their length is less than 2 views, which is the minimum required to compute triangulation.
-
-
Method Details
-
getThreshold
public double getThreshold()Returns threshold to determine whether points are inliers or not when testing possible estimation solutions. The threshold refers to the amount of error (i.e. Euclidean distance) a possible solution has on projected 2D points.- Returns:
- threshold to determine whether points are inliers or not when testing possible estimation solutions.
-
setThreshold
public void setThreshold(double threshold) throws com.irurueta.geometry.estimators.LockedException Sets threshold to determine whether points are inliers or not when testing possible estimation solutions. The threshold refers to the amount of error (i.e. Euclidean distance) a possible solution has on projected 2D points.- Parameters:
threshold
- threshold to be set.- Throws:
IllegalArgumentException
- if provided value is equal or less than zero.com.irurueta.geometry.estimators.LockedException
- if robust estimator is locked because an estimation is already in progress.
-
triangulate
public com.irurueta.geometry.Point3D triangulate() throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, com.irurueta.numerical.robust.RobustEstimatorExceptionTriangulates provided matched 2D points being projected by each corresponding camera into a single 3D point. At least 2 matched 2D points and their corresponding 2 cameras are required to compute triangulation. If more views are provided, an averaged solution can be found.- Specified by:
triangulate
in classRobustSinglePoint3DTriangulator
- Returns:
- computed triangulated 3D point.
- Throws:
com.irurueta.geometry.estimators.LockedException
- if this instance is locked.com.irurueta.geometry.estimators.NotReadyException
- if lists of points and cameras don't have the same length or less than 2 views are provided.com.irurueta.numerical.robust.RobustEstimatorException
- if estimation fails for any reason (i.e. numerical instability, no solution available, etc).
-
getMethod
public com.irurueta.numerical.robust.RobustEstimatorMethod getMethod()Returns method being used for robust estimation.- Specified by:
getMethod
in classRobustSinglePoint3DTriangulator
- Returns:
- method being used for robust estimation.
-