Package boofcv.alg.geo.selfcalib
Class RefineDualQuadraticAlgebraicError
java.lang.Object
boofcv.alg.geo.selfcalib.RefineDualQuadraticAlgebraicError
- All Implemented Interfaces:
VerbosePrint
Non-linear refinement of Dual Quadratic using algebraic error. Different assumptions about the intrinsics parameters can be made, and the number of cameras can be less than the number of views. This should be called after a linear estimate has been generated and should be followed up by bundle adjustment. The optimization function is parameterized using intrinsic parameters of each camera directly along with the plane at infinity.
Optional Assumptions: known aspect ratio, known principle point, single camera.
w*i = Ki *KTi
w*i = PiQ*∞PTi
A[i] = PiQ*∞PTi
residual[i] = w*i/||w*i|| - A[i]/||A[i]||
- R. Hartley, and A. Zisserman, "Multiple View Geometry in Computer Vision", 2nd Ed, Cambridge 2003
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionFound/updated camera parametersfinal ConfigConverge
Convergence criteriaboolean
If true then the images are assumed to have a known aspect ratioboolean
If true then the image center is assumed to be knownOptimization algorithmfinal Point3D_F64
Resulting plane at infinity that was found -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
decodeParameters
(double[] parameters, DogArray<RefineDualQuadraticAlgebraicError.CameraState> cameras, Point3D_F64 planeAtInfinity) protected void
Computes K*Kprotected void
encodeParameters
(Point3D_F64 planeAtInfinity, DogArray<RefineDualQuadraticAlgebraicError.CameraState> cameras, double[] parameters) protected void
encodeQ
(RefineDualQuadraticAlgebraicError.CameraState camera, double infx, double infy, double infz, DMatrixRMaj Q) Encodes the ADQvoid
initialize
(int numCameras, int numViews) Must call this function before all others.boolean
refine()
Refines the initial parameters to minimize algebraic error.void
setCamera
(int cameraIndex, double fx, double cx, double cy, double aspectRatio) Specifies the initial parameters or known parameters for a cameravoid
setPlaneAtInfinity
(double x, double y, double z) Specifies the initial state for the plane at infinityvoid
setProjective
(int cameraIndex, DMatrixRMaj P) The observed camera matrixvoid
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> configuration) void
setViewToCamera
(int viewIndex, int cameraIndex) Specifies which view was generated by which camera
-
Field Details
-
minimizer
Optimization algorithm -
knownAspect
public boolean knownAspectIf true then the images are assumed to have a known aspect ratio -
knownPrinciplePoint
public boolean knownPrinciplePointIf true then the image center is assumed to be known -
converge
Convergence criteria -
planeAtInfinity
Resulting plane at infinity that was found -
cameras
Found/updated camera parameters
-
-
Constructor Details
-
RefineDualQuadraticAlgebraicError
public RefineDualQuadraticAlgebraicError()
-
-
Method Details
-
initialize
public void initialize(int numCameras, int numViews) Must call this function before all others. Specifies the number of cameras and views. Preallocates memory.- Parameters:
numCameras
- Number of cameras.numViews
- Number of views.
-
setCamera
public void setCamera(int cameraIndex, double fx, double cx, double cy, double aspectRatio) Specifies the initial parameters or known parameters for a camera- Parameters:
cameraIndex
- index of the camerafx
- focal length x-axiscx
- image center. x-axiscy
- image center. y-axisaspectRatio
- aspect ratio
-
setViewToCamera
public void setViewToCamera(int viewIndex, int cameraIndex) Specifies which view was generated by which camera -
setProjective
The observed camera matrix- Parameters:
P
- Camera matrix. 3x4
-
setPlaneAtInfinity
public void setPlaneAtInfinity(double x, double y, double z) Specifies the initial state for the plane at infinity -
refine
public boolean refine()Refines the initial parameters to minimize algebraic error.- Returns:
- true if there are no catastrophic errors
-
encodeParameters
protected void encodeParameters(Point3D_F64 planeAtInfinity, DogArray<RefineDualQuadraticAlgebraicError.CameraState> cameras, double[] parameters) -
decodeParameters
protected void decodeParameters(double[] parameters, DogArray<RefineDualQuadraticAlgebraicError.CameraState> cameras, Point3D_F64 planeAtInfinity) -
encodeKK
Computes K*K -
encodeQ
protected void encodeQ(RefineDualQuadraticAlgebraicError.CameraState camera, double infx, double infy, double infz, DMatrixRMaj Q) Encodes the ADQ -
setVerbose
public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration) - Specified by:
setVerbose
in interfaceVerbosePrint
-