Class LMSERadialDistortionEstimator
java.lang.Object
com.irurueta.ar.calibration.estimators.RadialDistortionEstimator
com.irurueta.ar.calibration.estimators.LMSERadialDistortionEstimator
This class defines an LMSE (the Least Mean Square Error) estimator of radial
distortion.
Equations to determine a RadialDistortion instance for a single point are
linear dependent, for that reason, at least 2 points are required for the
estimation.
Even though x and y equations are linear dependent, both equations are taken
into account in case that sampled data contains errors, so that an LMSE error
can be obtained.
-
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) solution is allowed if more correspondences than the minimum are provided.Fields inherited from class com.irurueta.ar.calibration.estimators.RadialDistortionEstimator
DEFAULT_ESTIMATOR_TYPE, DEFAULT_FOCAL_LENGTH, DEFAULT_NUM_K_PARAMS, DEFAULT_SKEW, distortedPoints, distortionCenter, horizontalFocalLength, kInv, listener, locked, MIN_K_PARAMS, numKParams, skew, undistortedPoints, verticalFocalLength
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor with listener.LMSERadialDistortionEstimator
(com.irurueta.geometry.Point2D distortionCenter) Constructor with distortion center.LMSERadialDistortionEstimator
(com.irurueta.geometry.Point2D distortionCenter, RadialDistortionEstimatorListener listener) Constructor with listener and distortion center.LMSERadialDistortionEstimator
(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints) Constructor.LMSERadialDistortionEstimator
(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, RadialDistortionEstimatorListener listener) Constructor.LMSERadialDistortionEstimator
(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter) Constructor with points and distortion center.LMSERadialDistortionEstimator
(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter, RadialDistortionEstimatorListener listener) Constructor -
Method Summary
Modifier and TypeMethodDescriptionestimate()
Estimates a radial distortion.getType()
Returns type of radial distortion estimator.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.Methods inherited from class com.irurueta.ar.calibration.estimators.RadialDistortionEstimator
arePointsAvailable, areValidPoints, create, create, getDistortedPoints, getDistortionCenter, getHorizontalFocalLength, getIntrinsic, getListener, getMinNumberOfMatchedPoints, getNumKParams, getSkew, getUndistortedPoints, getVerticalFocalLength, isLocked, isReady, setDistortionCenter, setHorizontalFocalLength, setIntrinsic, setIntrinsic, setListener, setNumKParams, setPoints, setSkew, setVerticalFocalLength
-
Field Details
-
DEFAULT_ALLOW_LMSE_SOLUTION
public static final boolean DEFAULT_ALLOW_LMSE_SOLUTIONIndicates if by default an LMSE (the Least Mean Square Error) solution 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
-
LMSERadialDistortionEstimator
public LMSERadialDistortionEstimator()Constructor. -
LMSERadialDistortionEstimator
Constructor with listener.- Parameters:
listener
- listener to be notified of events such as when estimation starts, ends or estimation progress changes.
-
LMSERadialDistortionEstimator
public LMSERadialDistortionEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints) Constructor.- Parameters:
distortedPoints
- list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.undistortedPoints
- list of undistorted points.- Throws:
IllegalArgumentException
- if provided lists of points don't have the same size.
-
LMSERadialDistortionEstimator
public LMSERadialDistortionEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, RadialDistortionEstimatorListener listener) Constructor.- Parameters:
distortedPoints
- list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.undistortedPoints
- list of undistorted points.listener
- listener to be notified of events such as when estimation starts, ends or estimation progress changes.- Throws:
IllegalArgumentException
- if provided lists of points don't have the same size.
-
LMSERadialDistortionEstimator
public LMSERadialDistortionEstimator(com.irurueta.geometry.Point2D distortionCenter) Constructor with distortion center.- Parameters:
distortionCenter
- Distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).
-
LMSERadialDistortionEstimator
public LMSERadialDistortionEstimator(com.irurueta.geometry.Point2D distortionCenter, RadialDistortionEstimatorListener listener) Constructor with listener and distortion center.- Parameters:
distortionCenter
- Distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).listener
- listener to be notified of events such as when estimation starts, ends or estimation progress changes.
-
LMSERadialDistortionEstimator
public LMSERadialDistortionEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter) Constructor with points and distortion center.- Parameters:
distortedPoints
- list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.undistortedPoints
- list of undistorted points.distortionCenter
- Distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).- Throws:
IllegalArgumentException
- if provided lists of points don't have the same size.
-
LMSERadialDistortionEstimator
public LMSERadialDistortionEstimator(List<com.irurueta.geometry.Point2D> distortedPoints, List<com.irurueta.geometry.Point2D> undistortedPoints, com.irurueta.geometry.Point2D distortionCenter, RadialDistortionEstimatorListener listener) Constructor- Parameters:
distortedPoints
- list of distorted points. Distorted points are obtained after radial distortion is applied to an undistorted point.undistortedPoints
- list of undistorted points.distortionCenter
- Distortion center. This is usually equal to the principal point of an estimated camera. If not set it is assumed to be at the origin of coordinates (0,0).listener
- listener to be notified of events such as when estimation starts, ends or estimation progress changes.- Throws:
IllegalArgumentException
- if provided lists of points don't have the same size.
-
-
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 6 first correspondences 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 6 first correspondences will be used.- Parameters:
allowed
- true if LMSE solution is allowed, false otherwise.- Throws:
com.irurueta.geometry.estimators.LockedException
- if estimator is locked.
-
estimate
public RadialDistortion estimate() throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, RadialDistortionEstimatorExceptionEstimates a radial distortion.- Specified by:
estimate
in classRadialDistortionEstimator
- Returns:
- estimated radial distortion.
- Throws:
com.irurueta.geometry.estimators.LockedException
- if estimator is loked.com.irurueta.geometry.estimators.NotReadyException
- if input has not yet been provided.RadialDistortionEstimatorException
- if an error occurs during estimation, usually because input data is not valid.
-
getType
Returns type of radial distortion estimator.- Specified by:
getType
in classRadialDistortionEstimator
- Returns:
- type of radial distortion estimator.
-