Package boofcv.alg.geo.selfcalib
Class SelfCalibrationEssentialGuessAndCheck
java.lang.Object
boofcv.alg.geo.selfcalib.SelfCalibrationEssentialGuessAndCheck
- All Implemented Interfaces:
VerbosePrint
Brute force sampling approach to perform self calibration of a partially calibrated image. The focal length for the first and second images are selected by sampling a grid of values and selecting the hypothesis with the smallest model fit error is selected.
Assumptions: fx and fy are identical, zero principle point, and no lens distortion. There are no false positives in the input set.
Steps:- Create a list of different focal length hypothesis
- Use a given hypothesis to compute the Essential matrix
- Decompose essential matrix and get 4 extrinsic hypotheses
- Select best hypothesis and save result. Repeat for all focal lengths
- Select focal lengths for camera
- Rectifying homography
- P. Abeles, "BoofCV Technical Report: Automatic Camera Calibration" 2020-1
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionGenerates and scores a hypothesis given two intrinsic camera matricesboolean
if true the focus is assumed to be the same for the first two imagesdouble
The selected focal length for the first imagedouble
The selected focal length for the second imageint
The length of the longest side in the image.boolean
If true that indicates that the selected focal length was at the upper or lower limit.int
Number of values it will samplefinal DMatrixRMaj
The selected rectifying homographydouble
Range of values focal length values will sample.double
Range of values focal length values will sample. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(double sampleFocalRatioMin, double sampleFocalRatioMax) Specifies the range of focal lengths it will evaluate as ratio ofimageLengthPixels
boolean
process
(DMatrixRMaj F21, DMatrixRMaj P2, List<AssociatedPair> observations) Selects the best focal length(s) given the trifocal tensor and observationsvoid
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> configuration)
-
Field Details
-
sampleFocalRatioMin
public double sampleFocalRatioMinRange of values focal length values will sample. Fraction relative toimageLengthPixels
-
sampleFocalRatioMax
public double sampleFocalRatioMaxRange of values focal length values will sample. Fraction relative toimageLengthPixels
-
numberOfSamples
public int numberOfSamplesNumber of values it will sample -
fixedFocus
public boolean fixedFocusif true the focus is assumed to be the same for the first two images -
focalLengthA
public double focalLengthAThe selected focal length for the first image -
focalLengthB
public double focalLengthBThe selected focal length for the second image -
rectifyingHomography
The selected rectifying homography -
isLimit
public boolean isLimitIf true that indicates that the selected focal length was at the upper or lower limit. This can indicate a fault -
imageLengthPixels
public int imageLengthPixelsThe length of the longest side in the image. In pixels. -
calibrator
Generates and scores a hypothesis given two intrinsic camera matrices
-
-
Constructor Details
-
SelfCalibrationEssentialGuessAndCheck
public SelfCalibrationEssentialGuessAndCheck()
-
-
Method Details
-
configure
public void configure(double sampleFocalRatioMin, double sampleFocalRatioMax) Specifies the range of focal lengths it will evaluate as ratio ofimageLengthPixels
- Parameters:
sampleFocalRatioMin
- The minimum allowed focal length ratiosampleFocalRatioMax
- Tha maximum allowed focal length ratio
-
process
Selects the best focal length(s) given the trifocal tensor and observations- Parameters:
F21
- (Input) Fundamental matrix between view-1 and view-2P2
- (Input) Projective camera matrix for view-1 with inplicit identity matrix view-1observations
- (Input) Observation for all three views. Highly recommend that RANSAC or similar is used to remove false positives first.- Returns:
- true if successful
-
setVerbose
public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration) - Specified by:
setVerbose
in interfaceVerbosePrint
-