Package com.irurueta.geometry.estimators
Class LinePlaneCorrespondencePinholeCameraRobustEstimator
java.lang.Object
com.irurueta.geometry.estimators.PinholeCameraRobustEstimator
com.irurueta.geometry.estimators.LinePlaneCorrespondencePinholeCameraRobustEstimator
- Direct Known Subclasses:
DLTLinePlaneCorrespondencePinholeCameraRobustEstimator
public abstract class LinePlaneCorrespondencePinholeCameraRobustEstimator
extends PinholeCameraRobustEstimator
This is an abstract class for algorithms to robustly find the best pinhole
camera for collections of matched lines and planes.
Implementations of this class should be able to detect and discard outliers
in order to find the best solution.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.irurueta.numerical.robust.RobustEstimatorMethodDefault robust estimator method when none is provided.List of matched lines.static final intMinimum number of required line/plane correspondences to estimate a camera.List of matched planes.private final PlanePlane to be reused when computing residuals.Fields inherited from class com.irurueta.geometry.estimators.PinholeCameraRobustEstimator
confidence, covariance, DEFAULT_CONFIDENCE, DEFAULT_KEEP_COVARIANCE, DEFAULT_MAX_ITERATIONS, DEFAULT_PROGRESS_DELTA, DEFAULT_REFINE_RESULT, DEFAULT_SUGGEST_ASPECT_RATIO_ENABLED, DEFAULT_SUGGEST_CENTER_ENABLED, DEFAULT_SUGGEST_HORIZONTAL_FOCAL_LENGTH_ENABLED, DEFAULT_SUGGEST_PRINCIPAL_POINT_ENABLED, DEFAULT_SUGGEST_ROTATION_ENABLED, DEFAULT_SUGGEST_SKEWNESS_VALUE_ENABLED, DEFAULT_SUGGEST_VERTICAL_FOCAL_LENGTH_ENABLED, DEFAULT_SUGGESTED_ASPECT_RATIO_VALUE, DEFAULT_SUGGESTED_SKEWNESS_VALUE, DEFAULT_USE_FAST_REFINEMENT, inliersData, keepCovariance, listener, locked, MAX_CONFIDENCE, MAX_PROGRESS_DELTA, maxIterations, MIN_CONFIDENCE, MIN_ITERATIONS, MIN_PROGRESS_DELTA, progressDelta, refineResult, suggestAspectRatioEnabled, suggestCenterEnabled, suggestedAspectRatioValue, suggestedCenterValue, suggestedHorizontalFocalLengthValue, suggestedPrincipalPointValue, suggestedRotationValue, suggestedSkewnessValue, suggestedVerticalFocalLengthValue, suggestHorizontalFocalLengthEnabled, suggestPrincipalPointEnabled, suggestRotationEnabled, suggestSkewnessValueEnabled, suggestVerticalFocalLengthEnabled, useFastRefinement -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedConstructor with listener.protectedLinePlaneCorrespondencePinholeCameraRobustEstimator(PinholeCameraRobustEstimatorListener listener, List<Plane> planes, List<Line2D> lines) Constructor with listener and lists of matched planes and 2D lines to estimate a pinhole camera.protectedLinePlaneCorrespondencePinholeCameraRobustEstimator(List<Plane> planes, List<Line2D> lines) Constructor with lists of matched planes and 2D lines to estimate a pinhole camera. -
Method Summary
Modifier and TypeMethodDescriptionprivate PinholeCameraattemptFastRefine(PinholeCamera pinholeCamera, double weight) Attempts to refine provided camera using a fast algorithm based on Levenberg/Marquardt.protected PinholeCameraattemptRefine(PinholeCamera pinholeCamera, double weight) Attempt sto refine provided camera.private PinholeCameraattemptSlowRefine(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.create()Creates a pinhole camera robust estimator based on plane/line correspondences and using default robust estimator method.create(double[] qualityScores) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided quality scores and default robust estimator method.create(double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided quality scores and robust estimator method.create(PinholeCameraRobustEstimatorListener listener) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener and default estimator method.create(PinholeCameraRobustEstimatorListener listener, double[] qualityScores) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, quality scores and default robust estimator method.create(PinholeCameraRobustEstimatorListener listener, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, quality scores and robust estimator method.create(PinholeCameraRobustEstimatorListener listener, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener and robust estimator method.Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, planes and lines, and default robust estimator method.create(PinholeCameraRobustEstimatorListener listener, List<Plane> planes, List<Line2D> lines, double[] qualityScores) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, planes and lines, and default robust estimator method.create(PinholeCameraRobustEstimatorListener listener, List<Plane> planes, List<Line2D> lines, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, planes and lines, and robust estimator method.create(PinholeCameraRobustEstimatorListener listener, List<Plane> planes, List<Line2D> lines, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, planes and lines, and robust estimator method.create(com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided robust estimator method.Creates a pinhole camera robust estimator based on plane/line correspondences and using provided planes and lines and default robust estimator method.Creates a pinhole camera robust estimator based on plane/line correspondences and using provided planes and lines, quality scores and default robust estimator method.create(List<Plane> planes, List<Line2D> lines, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided planes and lines, quality scores and provided robust estimator method.create(List<Plane> planes, List<Line2D> lines, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided planes and lines and provided robust estimator method.getLines()Returns list of 2D lines to be used to estimate a pinhole camera.Returns list of 3D planes to be used to estimate a pinhole camera.double[]Returns quality scores corresponding to each pair of matched samples (plane and line).private voidinternalSetLinesAndPlanes(List<Plane> planes, List<Line2D> lines) Internal method to set lists of planes and lines to be used to estimate a pinhole camera.booleanisReady()Indicates if estimator is ready to start the pinhole camera estimation.final voidsetLinesAndPlanes(List<Plane> planes, List<Line2D> lines) Sets list of matched 3D planes and 2D lines to be used to estimate a pinhole camera.voidsetQualityScores(double[] qualityScores) Sets quality scores corresponding to each pair of matched points.protected doublesingleBackprojectionResidual(PinholeCamera pinholeCamera, Line2D line, Plane plane) Back-projection residual/error for a single line using provided camera.Methods inherited from class com.irurueta.geometry.estimators.PinholeCameraRobustEstimator
createFromPlanesAndLines, createFromPlanesAndLines, createFromPlanesAndLines, createFromPlanesAndLines, createFromPlanesAndLines, createFromPlanesAndLines, createFromPlanesAndLines, createFromPlanesAndLines, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, createFromPoints, estimate, getConfidence, getCovariance, getInliersData, getListener, getMaxIterations, getMethod, getProgressDelta, getRefinementStandardDeviation, getSuggestedAspectRatioValue, getSuggestedCenterValue, getSuggestedHorizontalFocalLengthValue, getSuggestedPrincipalPointValue, getSuggestedRotationValue, getSuggestedSkewnessValue, getSuggestedVerticalFocalLengthValue, hasSuggestions, isCovarianceKept, isFastRefinementUsed, isListenerAvailable, isLocked, isResultRefined, isSuggestAspectRatioEnabled, isSuggestCenterEnabled, isSuggestHorizontalFocalLengthEnabled, isSuggestPrincipalPointEnabled, isSuggestRotationEnabled, isSuggestSkewnessValueEnabled, isSuggestVerticalFocalLengthEnabled, setConfidence, setCovarianceKept, setFastRefinementUsed, setListener, setMaxIterations, setProgressDelta, setResultRefined, setSuggestAspectRatioEnabled, setSuggestCenterEnabled, setSuggestedAspectRatioValue, setSuggestedCenterValue, setSuggestedHorizontalFocalLengthValue, setSuggestedPrincipalPointValue, setSuggestedRotationValue, setSuggestedSkewnessValue, setSuggestedVerticalFocalLengthValue, setSuggestHorizontalFocalLengthEnabled, setSuggestPrincipalPointEnabled, setSuggestRotationEnabled, setSuggestSkewnessValueEnabled, setSuggestVerticalFocalLengthEnabled
-
Field Details
-
MIN_NUMBER_OF_LINE_PLANE_CORRESPONDENCES
public static final int MIN_NUMBER_OF_LINE_PLANE_CORRESPONDENCESMinimum number of required line/plane correspondences to estimate a camera.- See Also:
-
DEFAULT_ROBUST_METHOD
public static final com.irurueta.numerical.robust.RobustEstimatorMethod DEFAULT_ROBUST_METHODDefault robust estimator method when none is provided. -
planes
List of matched planes. -
lines
List of matched lines. -
residualTestPlane
Plane to be reused when computing residuals.
-
-
Constructor Details
-
LinePlaneCorrespondencePinholeCameraRobustEstimator
protected LinePlaneCorrespondencePinholeCameraRobustEstimator()Constructor. -
LinePlaneCorrespondencePinholeCameraRobustEstimator
protected LinePlaneCorrespondencePinholeCameraRobustEstimator(List<Plane> planes, List<Line2D> lines) Constructor with lists of matched planes and 2D lines to estimate a pinhole camera. Points and lines 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_LINE_PLANE_CORRESPONDENCES (4 matches).- Parameters:
planes- list of planes used to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.- Throws:
IllegalArgumentException- if provided lists don't have the same size or their size is smaller than required minimum size (4 matches).
-
LinePlaneCorrespondencePinholeCameraRobustEstimator
protected LinePlaneCorrespondencePinholeCameraRobustEstimator(PinholeCameraRobustEstimatorListener listener) Constructor with listener.- Parameters:
listener- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
-
LinePlaneCorrespondencePinholeCameraRobustEstimator
protected LinePlaneCorrespondencePinholeCameraRobustEstimator(PinholeCameraRobustEstimatorListener listener, List<Plane> planes, List<Line2D> lines) Constructor with listener and lists of matched planes and 2D lines to estimate a pinhole camera. Points and lines 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_LINE_PLANE_CORRESPONDENCES (4 matches).- Parameters:
listener- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.planes- list of planes used to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.- Throws:
IllegalArgumentException- if provided lists don't have the same size or their size is smaller than required minimum size (4 matches).
-
-
Method Details
-
getPlanes
Returns list of 3D planes to be used to estimate a pinhole camera. Each plane in the list of 3D planes must be matched with a corresponding 2D line resulting from the projection of the 3D plane through the camera to be estimated. Matched lines and planes must be located on the same position in the lists, hence, both lists must have the same size, and their size must be greater or equal than MIN_NUMBER_OF_LINE_PLANE_CORRESPONDENCES.- Returns:
- list of 3D planes to be used to estimate a pinhole camera.
-
getLines
Returns list of 2D lines to be used to estimate a pinhole camera. Each line in the list is the result of the projection of a matched.- Returns:
- list of 2D lines to be used to estimate a pinhole camera.
-
setLinesAndPlanes
Sets list of matched 3D planes and 2D lines to be used to estimate a pinhole camera. Each plane in the list of 3D planes must be matched with a corresponding 2D line resulting from the projection of the 3D plane through the camera to be estimated. Matched lines and planes must be located on the same position in the lists, hence, both lists must have the same size, and their size must be greater or equal than MIN_NUMBER_OF_LINE_PLANE_CORRESPONDENCES.- Parameters:
planes- 3D planes to be used to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.- Throws:
IllegalArgumentException- if provided lists don't have the same size or their size is smaller than required minimum size (4 matches).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 matched planes and lines) are provided as a minimum of MIN_NUMBER_OF_LINE_PLANE_CORRESPONDENCES are available.- Returns:
- true if estimator is ready, false otherwise.
-
getQualityScores
public double[] getQualityScores()Returns quality scores corresponding to each pair of matched samples (plane and line). 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
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_LINE_PLANE_CORRESPONDENCES (i.e. 4 samples).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line 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 LinePlaneCorrespondencePinholeCameraRobustEstimator create(List<Plane> planes, List<Line2D> lines, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided planes and lines and provided robust estimator method.- Parameters:
planes- list of 3D planes to estimate a pinhole camera.lines- list of corresponding projected 2D lines 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 planes and lines don't have the same size or their size is smaller than required minimum size (4 correspondences).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener and robust estimator method.- 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 LinePlaneCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, List<Plane> planes, List<Line2D> lines, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, planes and lines, and robust estimator method.- Parameters:
listener- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.planes- list of 3D planes to estimate a pinhole camera.lines- list of corresponding projected 2D lines 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 planes and lines don't have the same size or their size is smaller than required minimum size (4 correspondences).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided quality scores and robust estimator method.- Parameters:
qualityScores- quality scores corresponding to each pair of matched planes/lines.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 (4 samples).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(List<Plane> planes, List<Line2D> lines, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided planes and lines, quality scores and provided robust estimator method.- Parameters:
planes- list of 3D planes to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.qualityScores- quality scores corresponding to each pair of matched planes/lines.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 planes and lines or quality scores don't have the same size or their size is smaller than required minimum size (4 correspondences).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, 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.qualityScores- quality scores corresponding to each pair of matched planes/lines.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 (4 samples).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, List<Plane> planes, List<Line2D> lines, double[] qualityScores, com.irurueta.numerical.robust.RobustEstimatorMethod method) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, planes and lines, and robust estimator method.- Parameters:
listener- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.planes- list of 3D planes to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.qualityScores- quality scores corresponding to each pair of matched planes/lines.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 planes and lines or quality scores don't have the same size or their size is smaller than required minimum size (4 correspondences).
-
create
Creates a pinhole camera robust estimator based on plane/line correspondences and using default robust estimator method.- Returns:
- an instance of a pinhole camera robust estimator.
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(List<Plane> planes, List<Line2D> lines) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided planes and lines and default robust estimator method.- Parameters:
planes- list of 3D planes to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.- Returns:
- an instance of a pinhole camera robust estimator.
- Throws:
IllegalArgumentException- if provided lists of planes and lines don't have the same size or their size is smaller than required minimum size (4 correspondences).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener and default 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
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, List<Plane> planes, List<Line2D> lines) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, planes and lines, and default robust estimator method.- Parameters:
listener- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.planes- list of 3D planes to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.- Returns:
- an instance of a pinhole camera robust estimator.
- Throws:
IllegalArgumentException- if provided lists of planes and lines don't have the same size or their size is smaller than required minimum size (4 correspondences).
-
create
Creates a pinhole camera robust estimator based on plane/line correspondences and using provided quality scores and default robust estimator method.- Parameters:
qualityScores- quality scores corresponding to each pair of matched planes/lines.- Returns:
- an instance of a pinhole camera robust estimator.
- Throws:
IllegalArgumentException- if provided quality scores length is smaller than required minimum size (4 samples).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(List<Plane> planes, List<Line2D> lines, double[] qualityScores) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided planes and lines, quality scores and default robust estimator method.- Parameters:
planes- list of 3D planes to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.qualityScores- quality scores corresponding to each pair of matched planes/lines.- Returns:
- an instance of a pinhole camera robust estimator.
- Throws:
IllegalArgumentException- if provided lists of planes and lines or quality scores don't have the same size or their size is smaller than required minimum size (4 correspondences).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, double[] qualityScores) Creates a pinhole camera robust estimator based on plane/line 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 planes/lines.- Returns:
- an instance of a pinhole camera robust estimator.
- Throws:
IllegalArgumentException- if provided quality scores don't have the required minimum size (4 samples).
-
create
public static LinePlaneCorrespondencePinholeCameraRobustEstimator create(PinholeCameraRobustEstimatorListener listener, List<Plane> planes, List<Line2D> lines, double[] qualityScores) Creates a pinhole camera robust estimator based on plane/line correspondences and using provided listener, planes and lines, and default robust estimator method.- Parameters:
listener- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.planes- list of 3D planes to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.qualityScores- quality scores corresponding to each pair of matched planes/lines.- Returns:
- an instance of a pinhole camera robust estimator.
- Throws:
IllegalArgumentException- if provided lists of planes and lines or quality scores don't have the same size or their size is smaller than required minimum size (4 correspondences).
-
attemptRefine
Attempt sto refine provided camera.- Parameters:
pinholeCamera- camera to be refined.weight- weight for suggestion residual.- Returns:
- refined camera of provided camera if anything fails.
-
singleBackprojectionResidual
protected double singleBackprojectionResidual(PinholeCamera pinholeCamera, Line2D line, Plane plane) Back-projection residual/error for a single line using provided camera.- Parameters:
pinholeCamera- camera ot be checked.line- line to be back-projected.plane- plane to check against.- Returns:
- dot product distance between back-projected line and plane.
-
internalSetLinesAndPlanes
Internal method to set lists of planes and lines to be used to estimate a pinhole camera. This method does not check whether estimator is locked or not.- Parameters:
planes- list of 3D planes used to estimate a pinhole camera.lines- list of corresponding projected 2D lines used to estimate a pinhole camera.- Throws:
IllegalArgumentException- if provided lists of planes/lines don't have the same size or their size is smaller than required minimum size (4 samples).
-
attemptSlowRefine
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
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.
-