Class SelfCalibrationPraticalGuessAndCheckFocus
- All Implemented Interfaces:
VerbosePrint
Computes the best projective to metric 4x4 rectifying homography matrix by guessing different values for focal lengths of the first two views. Focal lengths are guessed using a log scale. Skew and image center are both assumed to be known and have to be specified by the user. This strategy shows better convergence than methods which attempt to guess the focal length using linear or gradient descent approaches due to the vast number of local minima in the search space. Non-linear refinement is highly recommended after using this algorithm due to its approximate nature.
NOTE: Performance on noise free synthetic data replicates paper claims. Have not been able to replicate performance on real data. Authors were contacted for a reference implementation and was told source code is not publicly available.
- if sameFocus is set to true then the first two views are assumed to have approximately the same focal length
- Internally, the plane at infinity is computed using the known intrinsic parameters.
- Rectifying homography is computed using known K in first view and plane at infinity. lambda of 1 is assumed
- Extracting K using absolute quadratic instead of rectifying homography
There will be a sign ambiguity in the returned result for the translation vector. That can be resolved by checking for positive depth of triangulated features.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the projective to metric rectifying homographyboolean
boolean
boolean
process
(List<DMatrixRMaj> cameraMatrices) Computes the best rectifying homography given the set of camera matrices.void
setCamera
(double skew, double cx, double cy, int width, int height) Specifies known portions of camera intrinsic parametersvoid
setSampling
(double min, double max, int total) Specifies how focal lengths are sampled on a log scale.void
setSingleCamera
(boolean sameFocus) void
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> configuration)
-
Constructor Details
-
SelfCalibrationPraticalGuessAndCheckFocus
public SelfCalibrationPraticalGuessAndCheckFocus()
-
-
Method Details
-
setCamera
public void setCamera(double skew, double cx, double cy, int width, int height) Specifies known portions of camera intrinsic parameters- Parameters:
skew
- skewcx
- image center xcy
- image center ywidth
- Image widthheight
- Image height
-
setSampling
public void setSampling(double min, double max, int total) Specifies how focal lengths are sampled on a log scale. Remember 1.0 = nominal length- Parameters:
min
- min value. 0.3 is defaultmax
- max value. 3.0 is defaulttotal
- Number of sample points. 50 is default
-
process
Computes the best rectifying homography given the set of camera matrices. Must callsetCamera(double, double, double, int, int)
first.DO NOT ADD P1=[I|0] it is implicit!
- Parameters:
cameraMatrices
- (Input) camera matrices for view 2 and beyond. Do not add the implicit P1=[I|0]- Returns:
- true if successful or false if it fails
-
isFixedFocus
public boolean isFixedFocus() -
setSingleCamera
public void setSingleCamera(boolean sameFocus) -
getRectifyingHomography
Returns the projective to metric rectifying homography -
isLocalMinimum
public boolean isLocalMinimum() -
setVerbose
public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration) - Specified by:
setVerbose
in interfaceVerbosePrint
-