Class HomographyRadial6Pts
- All Implemented Interfaces:
VerbosePrint
Estimates homography between two views and independent radial distortion from each camera. Radial distortion is modeled using the one parameter division model [1]. Implementation based on the 6-point algorithm in [2] that solves 2 quadratic equations and 6 linear equations. See Tech Report [3] for the final form of equations used in code below.
Undistortion model:f(x,y) = [x, y, 1 + λ(x**2 + y**2)]T
where λ is the radial distortion parameter from one of the cameras.NOTE: This assumes that the center of distortion is the center of the image. I.e. image center = (0,0)
NOTE: This will work on homographies induced from planes or pure rotations
NOTE: Modified from original description to handle > 6 points
- Fitzgibbon, Andrew W. "Simultaneous linear estimation of multiple view geometry and lens distortion." CVPR 2001
- Kukelova, Z., Heller, J., Bujnak, M., & Pajdla, T. "Radial distortion homography" (2015)
- Peter Abeles, "Notes on Scene Reconstruction: BoofCV Technical Report", 2022
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Estimated homography matrix and radial distortion terms -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
computeResidualError
(List<AssociatedPair> points, HomographyRadial6Pts.Result result) Used to evaluate how good a hypothesis is by removing radial distortion from points then applying the found homography.boolean
process
(List<AssociatedPair> points) Computes the homography matrix given a set of observed points in two images.void
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> configuration)
-
Constructor Details
-
HomographyRadial6Pts
public HomographyRadial6Pts()
-
-
Method Details
-
process
Computes the homography matrix given a set of observed points in two images. A set of
To get the output callAssociatedPair
is passed in. The computed homography 'H' is found such that the attributes 'p1' and 'p2' inAssociatedPair
refers to x1 and x2, respectively, in the equation below:
x2 = H*x1#getFound()
. One way to evaluate multiple solutions to see which one is best is to callcomputeResidualError(List, Result)
.- Parameters:
points
- A set of observed image points that are generated from a planar object. Minimum of 6 pairs required.- Returns:
- True if successful. False if it failed.
-
computeResidualError
public static double computeResidualError(List<AssociatedPair> points, HomographyRadial6Pts.Result result) Used to evaluate how good a hypothesis is by removing radial distortion from points then applying the found homography. The difference between the observed undistorted point and the predicted point in view 2 is the computed and summed across all points.- Parameters:
points
- Observed point pairsresult
- Hypothesis- Returns:
- sqrt(sum residual error squared)/N
-
setVerbose
public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration) - Specified by:
setVerbose
in interfaceVerbosePrint
-