Package com.irurueta.geometry.estimators
Class PinholeCameraEstimator
java.lang.Object
com.irurueta.geometry.estimators.PinholeCameraEstimator
- Direct Known Subclasses:
LinePlaneCorrespondencePinholeCameraEstimator,PointCorrespondencePinholeCameraEstimator
This class defines the interface for an estimator for pinhole cameras.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PinholeCameraEstimatorTypeDefault estimator type.static final doubleDefault value for maximum suggestion weight.static final doubleDefault value for minimum suggestion weight.static final booleanDefault value indicating whether aspect ratio is suggested or not.static final booleanDefault value indicating whether center is suggested or not.static final booleanDefault value indicating whether horizontal focal length value is suggested or not.static final booleanDefault value indicating whether principal point is suggested or not.static final booleanDefault value indicating whether rotation is suggested or not.static final booleanDefault value indicating whether skewness value is suggested or not.static final booleanDefault value indicating whether vertical focal length value is suggested or not.static final doubleDefault value of aspect ratio to be suggested when suggestion is enabled.static final doubleDefault value of skewness to be suggested when suggestion is enabled.static final doubleDefault value for the step to increase suggestion weight.protected PinholeCameraEstimatorListenerListener to be notified of events such as when estimation starts, ends or estimation progress changes.protected booleanTrue when an estimator is estimating a camera.protected doubleMaximum suggestion weight.protected doubleMinimum suggestion weight.protected booleanIndicates whether aspect ratio is suggested or not.protected booleanIndicates whether camera center is suggested or not.protected doubleSuggested aspect ratio value to be reached when suggestion is enabled.protected InhomogeneousPoint3DSuggested center to be reached when suggestion is enabled.protected doubleSuggested horizontal focal length value to be reached when suggestion is enabled.protected InhomogeneousPoint2DSuggested principal point value to be reached when suggestion is enabled.protected QuaternionSuggested rotation to be reached when suggestion is enabled.protected doubleSuggested skewness value to be reached when suggestion is enabled.protected doubleSuggested vertical focal length value to be reached when suggestion is enabled.protected booleanIndicates whether horizontal focal length is suggested or not.protected doubleStep to increase suggestion weight.protected booleanIndicates whether principal point is suggested or not.protected booleanIndicates whether camera rotation is suggested or not.protected booleanIndicates whether skewness value is suggested or not.protected booleanIndicates whether vertical focal length is suggested or not. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedConstructor with listener. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract PinholeCameraattemptRefine(PinholeCamera pinholeCamera) Attempts to refine provided camera using requested suggestions.static PinholeCameraEstimatorcreate()Creates an instance of a pinhole camera estimator using default type.static PinholeCameraEstimatorCreates an instance of a pinhole camera estimator using provided type.abstract PinholeCameraestimate()Estimates a pinhole camera.Returns listener to be notified of events such as when estimation starts, ends or estimation progress changes.doubleGets maximum suggestion weight.doubleGets minimum suggestion weight.doubleGets suggested aspect ratio value to be reached when suggestion is enabled.Gets suggested center to be reached when suggestion is enabled.doubleGets suggested horizontal focal length value to be reached when suggestion is enabled.Gets suggested principal point value to be reached when suggestion is enabled.Gets suggested rotation to be reached when suggestion is enabled.doubleGets suggested skewness value to be reached when suggestion is enabled.doubleGets suggested vertical focal length value to be reached when suggestion is enabled.doubleGets step to increase suggestion weight.abstract PinholeCameraEstimatorTypegetType()Returns type of pinhole camera estimator.private booleanIndicates whether suggestions for any extrinsic parameter are required or not.private booleanIndicates whether suggestions for any intrinsic parameter are required or not.protected booleanIndicates whether obtained solution requires refinement to apply provided suggestions.booleanisLocked()Indicates whether this instance is locked.abstract booleanisReady()Indicates if this estimator is ready to start the estimation.booleanIndicates whether aspect ratio is suggested or not.booleanIndicates whether camera center is suggested or not.booleanIndicates whether horizontal focal length is suggested or not.booleanIndicates whether principal point is suggested or not.booleanIndicates whether camera rotation is suggested or not.booleanIndicates whether skewness value is suggested or not.booleanIndicates whether vertical focal length is suggested or not.voidsetListener(PinholeCameraEstimatorListener listener) Sets listener to be notified of events such as when estimation starts, ends or estimation progress changes.voidsetMaxSuggestionWeight(double maxSuggestionWeight) Sets maximum suggestion weight.voidsetMinMaxSuggestionWeight(double minSuggestionWeight, double maxSuggestionWeight) Sets minimum and maximum suggestion weights.voidsetMinSuggestionWeight(double minSuggestionWeight) Sets minimum suggestion weight.voidsetSuggestAspectRatioEnabled(boolean suggestAspectRatioEnabled) Specifies whether aspect ratio is suggested or not.voidsetSuggestCenterEnabled(boolean suggestCenterEnabled) Specifies whether camera center is suggested or not.voidsetSuggestedAspectRatioValue(double suggestedAspectRatioValue) Sets suggested aspect ratio value to be reached when suggestion is enabled.voidsetSuggestedCenterValue(InhomogeneousPoint3D suggestedCenterValue) Sets suggested center to be reached when suggestion is enabled.voidsetSuggestedHorizontalFocalLengthValue(double suggestedHorizontalFocalLengthValue) Sets suggested horizontal focal length value to be reached when suggestion is enabled.voidsetSuggestedPrincipalPointValue(InhomogeneousPoint2D suggestedPrincipalPointValue) Sets suggested principal point value to be reached when suggestion is enabled.voidsetSuggestedRotationValue(Quaternion suggestedRotationValue) Sets suggested rotation to be reached when suggestion is enabled.voidsetSuggestedSkewnessValue(double suggestedSkewnessValue) Sets suggested skewness value to be reached when suggestion is enabled.voidsetSuggestedVerticalFocalLengthValue(double suggestedVerticalFocalLengthValue) Sets suggested vertical focal length value to be reached when suggestion is enabled.voidsetSuggestHorizontalFocalLengthEnabled(boolean suggestHorizontalFocalLengthEnabled) Specifies whether horizontal focal length is suggested or not.voidsetSuggestionWeightStep(double suggestionWeightStep) Sets step to increase suggestion weight.voidsetSuggestPrincipalPointEnabled(boolean suggestPrincipalPointEnabled) Specifies whether principal point is suggested or not.voidsetSuggestRotationEnabled(boolean suggestRotationEnabled) Specifies whether camera rotation is suggested or not.voidsetSuggestSkewnessValueEnabled(boolean suggestSkewnessValueEnabled) Specifies whether skewness value is suggested or not.voidsetSuggestVerticalFocalLengthEnabled(boolean suggestVerticalFocalLengthEnabled) Specifies whether vertical focal length is suggested or not.
-
Field Details
-
DEFAULT_ESTIMATOR_TYPE
Default estimator type. -
DEFAULT_SUGGEST_SKEWNESS_VALUE_ENABLED
public static final boolean DEFAULT_SUGGEST_SKEWNESS_VALUE_ENABLEDDefault value indicating whether skewness value is suggested or not. By default, this is disabled.- See Also:
-
DEFAULT_SUGGESTED_SKEWNESS_VALUE
public static final double DEFAULT_SUGGESTED_SKEWNESS_VALUEDefault value of skewness to be suggested when suggestion is enabled. By default suggested skewness is zero.- See Also:
-
DEFAULT_SUGGEST_HORIZONTAL_FOCAL_LENGTH_ENABLED
public static final boolean DEFAULT_SUGGEST_HORIZONTAL_FOCAL_LENGTH_ENABLEDDefault value indicating whether horizontal focal length value is suggested or not. By default, this is disabled.- See Also:
-
DEFAULT_SUGGEST_VERTICAL_FOCAL_LENGTH_ENABLED
public static final boolean DEFAULT_SUGGEST_VERTICAL_FOCAL_LENGTH_ENABLEDDefault value indicating whether vertical focal length value is suggested or not. By default, this is disabled.- See Also:
-
DEFAULT_SUGGEST_ASPECT_RATIO_ENABLED
public static final boolean DEFAULT_SUGGEST_ASPECT_RATIO_ENABLEDDefault value indicating whether aspect ratio is suggested or not. By default, this is disabled.- See Also:
-
DEFAULT_SUGGESTED_ASPECT_RATIO_VALUE
public static final double DEFAULT_SUGGESTED_ASPECT_RATIO_VALUEDefault value of aspect ratio to be suggested when suggestion is enabled. By default, suggested aspect ratio is 1.0, although also -1.0 is a typical value when vertical coordinates increase downwards.- See Also:
-
DEFAULT_SUGGEST_PRINCIPAL_POINT_ENABLED
public static final boolean DEFAULT_SUGGEST_PRINCIPAL_POINT_ENABLEDDefault value indicating whether principal point is suggested or not. By default, this is disabled.- See Also:
-
DEFAULT_SUGGEST_ROTATION_ENABLED
public static final boolean DEFAULT_SUGGEST_ROTATION_ENABLEDDefault value indicating whether rotation is suggested or not. By default, this is disabled.- See Also:
-
DEFAULT_SUGGEST_CENTER_ENABLED
public static final boolean DEFAULT_SUGGEST_CENTER_ENABLEDDefault value indicating whether center is suggested or not. By default, this is disabled.- See Also:
-
DEFAULT_MIN_SUGGESTION_WEIGHT
public static final double DEFAULT_MIN_SUGGESTION_WEIGHTDefault value for minimum suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- See Also:
-
DEFAULT_MAX_SUGGESTION_WEIGHT
public static final double DEFAULT_MAX_SUGGESTION_WEIGHTDefault value for maximum suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- See Also:
-
DEFAULT_SUGGESTION_WEIGHT_STEP
public static final double DEFAULT_SUGGESTION_WEIGHT_STEPDefault value for the step to increase suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- See Also:
-
locked
protected boolean lockedTrue when an estimator is estimating a camera. -
listener
Listener to be notified of events such as when estimation starts, ends or estimation progress changes. -
suggestSkewnessValueEnabled
protected boolean suggestSkewnessValueEnabledIndicates whether skewness value is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value. -
suggestedSkewnessValue
protected double suggestedSkewnessValueSuggested skewness value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value. -
suggestHorizontalFocalLengthEnabled
protected boolean suggestHorizontalFocalLengthEnabledIndicates whether horizontal focal length is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value. -
suggestedHorizontalFocalLengthValue
protected double suggestedHorizontalFocalLengthValueSuggested horizontal focal length value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value. -
suggestVerticalFocalLengthEnabled
protected boolean suggestVerticalFocalLengthEnabledIndicates whether vertical focal length is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value. -
suggestedVerticalFocalLengthValue
protected double suggestedVerticalFocalLengthValueSuggested vertical focal length value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value. -
suggestAspectRatioEnabled
protected boolean suggestAspectRatioEnabledIndicates whether aspect ratio is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value. -
suggestedAspectRatioValue
protected double suggestedAspectRatioValueSuggested aspect ratio value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value. -
suggestPrincipalPointEnabled
protected boolean suggestPrincipalPointEnabledIndicates whether principal point is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value. -
suggestedPrincipalPointValue
Suggested principal point value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value. -
suggestRotationEnabled
protected boolean suggestRotationEnabledIndicates whether camera rotation is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value. -
suggestedRotationValue
Suggested rotation to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value. -
suggestCenterEnabled
protected boolean suggestCenterEnabledIndicates whether camera center is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value. -
suggestedCenterValue
Suggested center to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value. -
minSuggestionWeight
protected double minSuggestionWeightMinimum suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones. -
maxSuggestionWeight
protected double maxSuggestionWeightMaximum suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones. -
suggestionWeightStep
protected double suggestionWeightStepStep to increase suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.
-
-
Constructor Details
-
PinholeCameraEstimator
protected PinholeCameraEstimator()Constructor. -
PinholeCameraEstimator
Constructor with listener.- Parameters:
listener- listener to be notified of events such as when estimation starts, ends or estimation progress changes.
-
-
Method Details
-
getListener
Returns listener to be notified of events such as when estimation starts, ends or estimation progress changes.- Returns:
- listener to be notified of events.
-
setListener
Sets listener to be notified of events such as when estimation starts, ends or estimation progress changes.- Parameters:
listener- listener to be notified of events.- Throws:
LockedException- if estimator is locked.
-
isSuggestSkewnessValueEnabled
public boolean isSuggestSkewnessValueEnabled()Indicates whether skewness value is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Returns:
- true if skewness value is suggested, false otherwise.
-
setSuggestSkewnessValueEnabled
public void setSuggestSkewnessValueEnabled(boolean suggestSkewnessValueEnabled) throws LockedException Specifies whether skewness value is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Parameters:
suggestSkewnessValueEnabled- true if skewness value is suggested, false otherwise.- Throws:
LockedException- if estimator is locked.
-
getSuggestedSkewnessValue
public double getSuggestedSkewnessValue()Gets suggested skewness value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Returns:
- suggested skewness value.
-
setSuggestedSkewnessValue
Sets suggested skewness value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Parameters:
suggestedSkewnessValue- suggested skewness value.- Throws:
LockedException- if estimator is locked.
-
isSuggestHorizontalFocalLengthEnabled
public boolean isSuggestHorizontalFocalLengthEnabled()Indicates whether horizontal focal length is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Returns:
- true if horizontal focal length is suggested, false otherwise.
-
setSuggestHorizontalFocalLengthEnabled
public void setSuggestHorizontalFocalLengthEnabled(boolean suggestHorizontalFocalLengthEnabled) throws LockedException Specifies whether horizontal focal length is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Parameters:
suggestHorizontalFocalLengthEnabled- true if horizontal focal length is suggested, false otherwise.- Throws:
LockedException- if estimator is locked.
-
getSuggestedHorizontalFocalLengthValue
public double getSuggestedHorizontalFocalLengthValue()Gets suggested horizontal focal length value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Returns:
- suggested horizontal focal length value.
-
setSuggestedHorizontalFocalLengthValue
public void setSuggestedHorizontalFocalLengthValue(double suggestedHorizontalFocalLengthValue) throws LockedException Sets suggested horizontal focal length value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Parameters:
suggestedHorizontalFocalLengthValue- suggested horizontal focal length value.- Throws:
LockedException- if estimator is locked.
-
isSuggestVerticalFocalLengthEnabled
public boolean isSuggestVerticalFocalLengthEnabled()Indicates whether vertical focal length is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Returns:
- true if vertical focal length is suggested, false otherwise.
-
setSuggestVerticalFocalLengthEnabled
public void setSuggestVerticalFocalLengthEnabled(boolean suggestVerticalFocalLengthEnabled) throws LockedException Specifies whether vertical focal length is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Parameters:
suggestVerticalFocalLengthEnabled- true if vertical focal length is suggested, false otherwise.- Throws:
LockedException- if estimator is locked.
-
getSuggestedVerticalFocalLengthValue
public double getSuggestedVerticalFocalLengthValue()Gets suggested vertical focal length value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Returns:
- suggested vertical focal length.
-
setSuggestedVerticalFocalLengthValue
public void setSuggestedVerticalFocalLengthValue(double suggestedVerticalFocalLengthValue) throws LockedException Sets suggested vertical focal length value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Parameters:
suggestedVerticalFocalLengthValue- suggested vertical focal length.- Throws:
LockedException- if estimator is locked.
-
isSuggestAspectRatioEnabled
public boolean isSuggestAspectRatioEnabled()Indicates whether aspect ratio is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Returns:
- true if aspect ratio is suggested, false otherwise.
-
setSuggestAspectRatioEnabled
Specifies whether aspect ratio is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Parameters:
suggestAspectRatioEnabled- true if aspect ratio is suggested, false otherwise.- Throws:
LockedException- if estimator is locked.
-
getSuggestedAspectRatioValue
public double getSuggestedAspectRatioValue()Gets suggested aspect ratio value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Returns:
- suggested aspect ratio value.
-
setSuggestedAspectRatioValue
Sets suggested aspect ratio value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Parameters:
suggestedAspectRatioValue- suggested aspect ratio value.- Throws:
LockedException- if estimator is locked.
-
isSuggestPrincipalPointEnabled
public boolean isSuggestPrincipalPointEnabled()Indicates whether principal point is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Returns:
- true if principal point is suggested, false otherwise.
-
setSuggestPrincipalPointEnabled
public void setSuggestPrincipalPointEnabled(boolean suggestPrincipalPointEnabled) throws LockedException Specifies whether principal point is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Parameters:
suggestPrincipalPointEnabled- true if principal point is suggested, false otherwise.- Throws:
LockedException- if estimator is locked.
-
getSuggestedPrincipalPointValue
Gets suggested principal point value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Returns:
- suggested principal point value to be reached when suggestion is enabled.
-
setSuggestedPrincipalPointValue
public void setSuggestedPrincipalPointValue(InhomogeneousPoint2D suggestedPrincipalPointValue) throws LockedException Sets suggested principal point value to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Parameters:
suggestedPrincipalPointValue- suggested principal point value to be reached when suggestion is enabled.- Throws:
LockedException- if estimator is locked.
-
isSuggestRotationEnabled
public boolean isSuggestRotationEnabled()Indicates whether camera rotation is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Returns:
- true if camera rotation is suggested, false otherwise.
-
setSuggestRotationEnabled
Specifies whether camera rotation is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Parameters:
suggestRotationEnabled- true if camera rotation is suggested, false otherwise.- Throws:
LockedException- if estimator is locked.
-
getSuggestedRotationValue
Gets suggested rotation to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Returns:
- suggested rotation to be reached when suggestion is enabled.
-
setSuggestedRotationValue
Sets suggested rotation to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Parameters:
suggestedRotationValue- suggested rotation to be reached when suggestion is enabled.- Throws:
LockedException- if estimator is locked.
-
isSuggestCenterEnabled
public boolean isSuggestCenterEnabled()Indicates whether camera center is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Returns:
- true if camera center is suggested, false otherwise.
-
setSuggestCenterEnabled
Specifies whether camera center is suggested or not. When enabled, the estimator will attempt to enforce suggested value in an iterative manner starting from an initially estimated camera. Even when suggestion is enabled, the iterative algorithm might not reach suggested value if the initial value largely differs from the suggested value.- Parameters:
suggestCenterEnabled- true if camera is suggested, false otherwise.- Throws:
LockedException- if estimator is locked.
-
getSuggestedCenterValue
Gets suggested center to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Returns:
- suggested center to be reached when suggestion is enabled.
-
setSuggestedCenterValue
public void setSuggestedCenterValue(InhomogeneousPoint3D suggestedCenterValue) throws LockedException Sets suggested center to be reached when suggestion is enabled. Suggested value should be close to the initially estimated value otherwise the iterative refinement might not converge to provided value.- Parameters:
suggestedCenterValue- suggested center to be reached when suggestion is enabled.- Throws:
LockedException- if estimator is locked.
-
getMinSuggestionWeight
public double getMinSuggestionWeight()Gets minimum suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- Returns:
- minimum suggestion weight.
-
setMinSuggestionWeight
Sets minimum suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- Parameters:
minSuggestionWeight- minimum suggestion weight.- Throws:
LockedException- if estimator is locked.
-
getMaxSuggestionWeight
public double getMaxSuggestionWeight()Gets maximum suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- Returns:
- maximum suggestion weight.
-
setMaxSuggestionWeight
Sets maximum suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- Parameters:
maxSuggestionWeight- maximum suggestion weight.- Throws:
LockedException- if estimator is locked.
-
setMinMaxSuggestionWeight
public void setMinMaxSuggestionWeight(double minSuggestionWeight, double maxSuggestionWeight) throws LockedException Sets minimum and maximum suggestion weights. Suggestion weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- Parameters:
minSuggestionWeight- minimum suggestion weight.maxSuggestionWeight- maximum suggestion weight.- Throws:
LockedException- if estimator is locked.IllegalArgumentException- if minimum suggestion weight is greater or equal than maximum value.
-
getSuggestionWeightStep
public double getSuggestionWeightStep()Gets step to increase suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- Returns:
- step to increase suggestion weight.
-
setSuggestionWeightStep
Sets step to increase suggestion weight. This weight is used to slowly draw original camera parameters into desired suggested values. Suggestion weight slowly increases each time Levenberg-Marquardt is used to find a solution so that the algorithm can converge into desired value. The faster the weights are increased the less likely that suggested values can be converged if they differ too much from the original ones.- Parameters:
suggestionWeightStep- step to increase suggestion weight.- Throws:
LockedException- if estimator is locked.IllegalArgumentException- if provided step is negative or zero.
-
isLocked
public boolean isLocked()Indicates whether this instance is locked.- Returns:
- true if this estimator is busy estimating a camera, false otherwise.
-
isReady
public abstract boolean isReady()Indicates if this estimator is ready to start the estimation.- Returns:
- true if estimator is ready, false otherwise.
-
estimate
public abstract PinholeCamera estimate() throws LockedException, NotReadyException, PinholeCameraEstimatorExceptionEstimates a pinhole camera.- Returns:
- estimated pinhole camera.
- Throws:
LockedException- if estimator is locked.NotReadyException- if input has not yet been provided.PinholeCameraEstimatorException- if an error occurs during estimation, usually because input data is not valid.
-
getType
Returns type of pinhole camera estimator.- Returns:
- type of pinhole camera estimator.
-
create
Creates an instance of a pinhole camera estimator using default type.- Returns:
- an instance of a pinhole camera estimator.
-
create
Creates an instance of a pinhole camera estimator using provided type.- Parameters:
type- type of pinhole camera estimator.- Returns:
- an instance of a pinhole camera estimator.
-
attemptRefine
Attempts to refine provided camera using requested suggestions. If no suggestions are requested or if refinement fails, provided camera is returned instead.- Parameters:
pinholeCamera- camera to be refined.- Returns:
- refined camera.
-
hasSuggestions
protected boolean hasSuggestions()Indicates whether obtained solution requires refinement to apply provided suggestions.- Returns:
- true if solution requires refinement to apply provided suggestions, false otherwise.
-
hasIntrinsicSuggestions
private boolean hasIntrinsicSuggestions()Indicates whether suggestions for any intrinsic parameter are required or not.- Returns:
- true if suggestions for any intrinsic parameters are required, false otherwise.
-
hasExtrinsicSuggestions
private boolean hasExtrinsicSuggestions()Indicates whether suggestions for any extrinsic parameter are required or not.- Returns:
- true if suggestions for any extrinsic parameter are required, false otherwise.
-