Package com.irurueta.geometry.refiners
Class NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner
java.lang.Object
com.irurueta.geometry.refiners.Refiner<PinholeCamera>
com.irurueta.geometry.refiners.InliersDataRefiner<PinholeCamera>
com.irurueta.geometry.refiners.PairMatchesAndInliersDataRefiner<PinholeCamera,Plane,Line2D>
com.irurueta.geometry.refiners.PinholeCameraRefiner<Plane,Line2D>
com.irurueta.geometry.refiners.LinePlaneCorrespondencePinholeCameraRefiner
com.irurueta.geometry.refiners.NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner
public class NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner
extends LinePlaneCorrespondencePinholeCameraRefiner
A pinhole camera refiner using line/plane correspondences and the
Levenberg-Marquardt algorithm to try to decrease overall error in LMSE terms
among inlier samples by taking the pinhole camera matrix as a whole without
decomposition.
Typically, this refiner is used by a robust estimator, however it can also be
useful in some other situations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault value for the weight applied to errors related to suggested camera parameters during computation of projection residuals.private static final intDimensions for refinement.private doubleSuggestion error weight.Fields inherited from class com.irurueta.geometry.refiners.PinholeCameraRefiner
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, refinementStandardDeviationFields inherited from class com.irurueta.geometry.refiners.PairMatchesAndInliersDataRefiner
samples1, samples2Fields inherited from class com.irurueta.geometry.refiners.InliersDataRefiner
inliers, numInliers, residualsFields inherited from class com.irurueta.geometry.refiners.Refiner
covariance, DEFAULT_KEEP_COVARIANCE, initialEstimation, keepCovariance, listener, locked -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner(PinholeCamera initialEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData, List<Plane> samples1, List<Line2D> samples2, double refinementStandardDeviation) Constructor.NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner(PinholeCamera initialEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers, List<Plane> samples1, List<Line2D> samples2, double refinementStandardDeviation) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets suggestion error weight.booleanrefine(PinholeCamera result) Refines provided initial estimation.voidsetSuggestionErrorWeight(double suggestionErrorWeight) Sets suggestion error weight.Methods inherited from class com.irurueta.geometry.refiners.LinePlaneCorrespondencePinholeCameraRefiner
residualLevenbergMarquardt, residualPowellMethods inherited from class com.irurueta.geometry.refiners.PinholeCameraRefiner
cameraToParameters, getRefinementStandardDeviation, getSuggestedAspectRatioValue, getSuggestedCenterValue, getSuggestedHorizontalFocalLengthValue, getSuggestedPrincipalPointValue, getSuggestedRotationValue, getSuggestedSkewnessValue, getSuggestedVerticalFocalLengthValue, hasSuggestions, isSuggestAspectRatioEnabled, isSuggestCenterEnabled, isSuggestHorizontalFocalLengthEnabled, isSuggestPrincipalPointEnabled, isSuggestRotationEnabled, isSuggestSkewnessValueEnabled, isSuggestVerticalFocalLengthEnabled, parametersToCamera, refine, setRefinementStandardDeviation, setSuggestAspectRatioEnabled, setSuggestCenterEnabled, setSuggestedAspectRatioValue, setSuggestedCenterValue, setSuggestedHorizontalFocalLengthValue, setSuggestedPrincipalPointValue, setSuggestedRotationValue, setSuggestedSkewnessValue, setSuggestedVerticalFocalLengthValue, setSuggestHorizontalFocalLengthEnabled, setSuggestPrincipalPointEnabled, setSuggestRotationEnabled, setSuggestSkewnessValueEnabled, setSuggestVerticalFocalLengthEnabled, suggestionResidualMethods inherited from class com.irurueta.geometry.refiners.PairMatchesAndInliersDataRefiner
getSamples1, getSamples2, isReady, setSamples1, setSamples2Methods inherited from class com.irurueta.geometry.refiners.InliersDataRefiner
getInliers, getNumInliers, getResiduals, getTotalSamples, setInliers, setInliersData, setNumInliers, setResidualsMethods inherited from class com.irurueta.geometry.refiners.Refiner
getCovariance, getInitialEstimation, getListener, isCovarianceKept, isLocked, setCovarianceKept, setInitialEstimation, setListener
-
Field Details
-
DEFAULT_SUGGESTION_ERROR_WEIGHT
public static final double DEFAULT_SUGGESTION_ERROR_WEIGHTDefault value for the weight applied to errors related to suggested camera parameters during computation of projection residuals.- See Also:
-
REFINE_DIMS
private static final int REFINE_DIMSDimensions for refinement.- See Also:
-
suggestionErrorWeight
private double suggestionErrorWeightSuggestion error weight. This weight is applied to errors related to suggested camera parameters during computation of projection residuals.
-
-
Constructor Details
-
NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner
public NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner()Constructor. -
NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner
public NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner(PinholeCamera initialEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers, List<Plane> samples1, List<Line2D> samples2, double refinementStandardDeviation) Constructor.- Parameters:
initialEstimation- initial estimation to be set.keepCovariance- true if covariance of estimation must be kept after refinement, false otherwise.inliers- set indicating which of the provided matches are inliers.residuals- residuals for matched samples.numInliers- number of inliers on initial estimation.samples1- 1st set of paired samples.samples2- 2nd set of paired samples.refinementStandardDeviation- standard deviation used for Levenberg-Marquardt fitting.
-
NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner
public NonDecomposedLinePlaneCorrespondencePinholeCameraRefiner(PinholeCamera initialEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData, List<Plane> samples1, List<Line2D> samples2, double refinementStandardDeviation) Constructor.- Parameters:
initialEstimation- initial estimation to be set.keepCovariance- true if covariance of estimation must be kept after refinement, false otherwise.inliersData- inlier data, typically obtained from a robust estimator.samples1- 1st set of paired samples.samples2- 2nd set of paired samples.refinementStandardDeviation- standard deviation used for Levenberg-Marquardt fitting.
-
-
Method Details
-
getSuggestionErrorWeight
public double getSuggestionErrorWeight()Gets suggestion error weight. This weight is applied to errors related to suggested camera parameters during computation of projection residuals.- Returns:
- suggestion error weight.
-
setSuggestionErrorWeight
Sets suggestion error weight. This weight is applied to errors related to suggested camera parameters during computation of projection residuals.- Parameters:
suggestionErrorWeight- suggestion error weight.- Throws:
LockedException- if estimator is locked.
-
refine
public boolean refine(PinholeCamera result) throws NotReadyException, LockedException, RefinerException Refines provided initial estimation. This method always sets a value into provided result instance regardless of the fact that error has actually improved in LMSE terms or not.- Specified by:
refinein classRefiner<PinholeCamera>- Parameters:
result- instance where refined estimation will be stored.- Returns:
- true if result improves (decreases) in LMSE terms respect to initial estimation, false if no improvement has been achieved.
- Throws:
NotReadyException- if not enough input data has been provided.LockedException- if estimator is locked because refinement is already in progress.RefinerException- if refinement fails for some reason (e.g. unable to converge to a result).
-