Package com.irurueta.ar.sfm
Class LMSEHomogeneousSinglePoint3DTriangulator
java.lang.Object
com.irurueta.ar.sfm.SinglePoint3DTriangulator
com.irurueta.ar.sfm.LMSEHomogeneousSinglePoint3DTriangulator
Triangulates matched 2D points into a single 3D one by using 2D point
correspondences on different views along with the corresponding cameras on
each of those views by finding an LMSE solution to homogeneous systems of
equations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Indicates if an LMSE (the Least Mean Square Error) solution is allowed if more correspondences than the minimum are provided.static final boolean
Indicates if by default an LMSE (the Least Mean Square Error) is allowed if more correspondences than the minimum are provided.Fields inherited from class com.irurueta.ar.sfm.SinglePoint3DTriangulator
cameras, DEFAULT_TYPE, listener, locked, MIN_REQUIRED_VIEWS, points2D
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.LMSEHomogeneousSinglePoint3DTriangulator
(List<com.irurueta.geometry.Point2D> points2D, List<com.irurueta.geometry.PinholeCamera> cameras) Constructor.LMSEHomogeneousSinglePoint3DTriangulator
(List<com.irurueta.geometry.Point2D> points2D, List<com.irurueta.geometry.PinholeCamera> cameras, SinglePoint3DTriangulatorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetType()
Returns type of triangulator.boolean
Indicates if an LMSE (the Least Mean Square Error) solution is allowed if more correspondences than the minimum are provided.void
setLMSESolutionAllowed
(boolean allowed) Specifies if an LMSE (the Least Mean Square Error) solution is allowed if more correspondences than the minimum are provided.protected void
triangulate
(List<com.irurueta.geometry.Point2D> points2D, List<com.irurueta.geometry.PinholeCamera> cameras, com.irurueta.geometry.Point3D result) Internal method to triangulate provided matched 2D points being projected by each corresponding camera into a single 3D point.Methods inherited from class com.irurueta.ar.sfm.SinglePoint3DTriangulator
areValidPointsAndCameras, create, create, create, create, create, create, create, create, create, create, create, create, getCameras, getListener, getPoints2D, isLocked, isReady, setListener, setPointsAndCameras, triangulate, triangulate
-
Field Details
-
DEFAULT_ALLOW_LMSE_SOLUTION
public static final boolean DEFAULT_ALLOW_LMSE_SOLUTIONIndicates if by default an LMSE (the Least Mean Square Error) is allowed if more correspondences than the minimum are provided.- See Also:
-
allowLMSESolution
private boolean allowLMSESolutionIndicates if an LMSE (the Least Mean Square Error) solution is allowed if more correspondences than the minimum are provided. If false, the exceeding correspondences will be ignored and only the 6 first correspondences will be used.
-
-
Constructor Details
-
LMSEHomogeneousSinglePoint3DTriangulator
public LMSEHomogeneousSinglePoint3DTriangulator()Constructor. -
LMSEHomogeneousSinglePoint3DTriangulator
public LMSEHomogeneousSinglePoint3DTriangulator(List<com.irurueta.geometry.Point2D> points2D, List<com.irurueta.geometry.PinholeCamera> cameras) Constructor.- Parameters:
points2D
- list of matched 2D points on each view. Each point in the list is assumed to be projected by the corresponding camera in the list.cameras
- camera for each view where 2D points are represented.- 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.
-
LMSEHomogeneousSinglePoint3DTriangulator
Constructor.- Parameters:
listener
- listener to notify events generated by instances of this class.
-
LMSEHomogeneousSinglePoint3DTriangulator
public LMSEHomogeneousSinglePoint3DTriangulator(List<com.irurueta.geometry.Point2D> points2D, List<com.irurueta.geometry.PinholeCamera> cameras, SinglePoint3DTriangulatorListener listener) Constructor.- Parameters:
points2D
- list of matched 2D points on each view. Each point in the list is assumed to be projected by the corresponding camera in the list.cameras
- cameras for each view where 2D points are represented.listener
- listener to notify events generated by instances of this class.- 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
-
isLMSESolutionAllowed
public boolean isLMSESolutionAllowed()Indicates if an LMSE (the Least Mean Square Error) solution is allowed if more correspondences than the minimum are provided. If false, the exceeding correspondences will be ignored and only the 2 first matches corresponding to the first 2 views will be used.- Returns:
- true if LMSE solution is allowed, false otherwise.
-
setLMSESolutionAllowed
public void setLMSESolutionAllowed(boolean allowed) throws com.irurueta.geometry.estimators.LockedException Specifies if an LMSE (the Least Mean Square Error) solution is allowed if more correspondences than the minimum are provided. If false, the exceeding correspondences will be ignored and only the 2 first matches corresponding to the first 2 views will be used.- Parameters:
allowed
- true if LMSE solution is allowed, false otherwise.- Throws:
com.irurueta.geometry.estimators.LockedException
- if estimator is locked.
-
getType
Returns type of triangulator.- Specified by:
getType
in classSinglePoint3DTriangulator
- Returns:
- type of triangulator.
-
triangulate
protected void triangulate(List<com.irurueta.geometry.Point2D> points2D, List<com.irurueta.geometry.PinholeCamera> cameras, com.irurueta.geometry.Point3D result) throws Point3DTriangulationException Internal method to triangulate 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 is found. This method does not check whether instance is locked or ready.- Specified by:
triangulate
in classSinglePoint3DTriangulator
- Parameters:
points2D
- 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.result
- instance where triangulated 3D point is stored.- Throws:
Point3DTriangulationException
- if triangulation fails for some other reason (i.e. degenerate geometry, numerical instabilities, etc.).
-