Class CameraKannalaBrandt
- All Implemented Interfaces:
Serializable
(x,y,z) is a point in 3D space in camera frame
θ = acos(z/normf([x y z]))
φ = atan2(y, x)
symmetric(θ) = k1θ + k2θ3 + ... + θnθ2*n-1
radial(θ,φ) = (l1θ + l2θ3 + l3θ5) (i1cos(φ) + i2sin(φ) + i3cos(2φ) + i4sin(2φ))
tangential(θ,φ) = (m1θ + m2θ3 + m3θ5) (j1cos(φ) + j2sin(φ) + j3cos(2φ) + j4sin(2φ))
Then the distorted normalized coordinates are found:xd = (symmetric(θ) + radial(θ,φ))ur(φ) + tangential(θ,φ)ut(φ)
where ur and ut are unit vectors in radial and tangential directions.
NOTE: If the number of asymmetric distortion terms is set to zero then there will only be radially symmetric distortion. This is what most libraries refer to as the Kannala-Brandt model as they do not implement the full model. It's also often referred to as an Equidistance model. That's a bit of a misnomer as the Equidistance model is defined as r = f*theta, which is a special case of the symmetric model. BoofCV's naming convention is closer to the original authors in [1] and their source code.
[1] Kannala, J., and Brandt, S. S. (2006). A generic camera model and calibration method for conventional, wide-angle, and fish-eye lenses. IEEE transactions on pattern analysis and machine intelligence, 28(8), 1335-1340.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptiondouble[]
Coefficients for distortion terms in radial directiondouble[]
Coefficients for distortion terms in radial directiondouble[]
Coefficients for radially symmetric modeldouble[]
Coefficients for distortion terms in tangential directiondouble[]
Coefficients for distortion terms in tangential directionFields inherited from class boofcv.struct.calib.CameraModel
height, width
-
Constructor Summary
ConstructorDescriptionWith no coefficients specified.CameraKannalaBrandt
(int numSymmetric, int numAsymmetric) Constructor which allows the order of all distortion coefficients to be specifiedCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
configureCoefficients
(int numSymmetric, int numAsymmetric) Configures the number of coefficients for each distortion term.<T extends CameraModel>
TCreates a new camera model with zero values of the same type os this onefsetK
(double fx, double fy, double skew, double cx, double cy) fsetRadial
(double... coefs) fsetRadialTrig
(double... coefs) fsetShape
(int width, int height) fsetSymmetric
(double... coefs) fsetTangent
(double... coefs) fsetTangentTrig
(double... coefs) boolean
Returns true if there are coefficients that could result in a non-zero distortion for the non-symmetric terms.boolean
Checks to see of the two models are exactly alikeboolean
Returns true if it's a symmetric model.void
print()
Prints a summary of this model to stdoutsetTo
(CameraKannalaBrandt src) Copies the value of 'src' into 'this'.toString()
Methods inherited from class boofcv.struct.calib.CameraPinhole
fsetK, fsetK, isEquals, isInside, isInside, reset, setTo
Methods inherited from class boofcv.struct.calib.CameraModel
getDimension, getHeight, getWidth, isSameShape, isSameShape, setHeight, setWidth
-
Field Details
-
symmetric
public double[] symmetricCoefficients for radially symmetric model -
radial
public double[] radialCoefficients for distortion terms in radial direction -
radialTrig
public double[] radialTrigCoefficients for distortion terms in radial direction -
tangent
public double[] tangentCoefficients for distortion terms in tangential direction -
tangentTrig
public double[] tangentTrigCoefficients for distortion terms in tangential direction
-
-
Constructor Details
-
CameraKannalaBrandt
public CameraKannalaBrandt(int numSymmetric, int numAsymmetric) Constructor which allows the order of all distortion coefficients to be specified- Parameters:
numSymmetric
- Number of radially symmetric terms. Standard is 5.numAsymmetric
- Number of non symmetric terms. If not zero then trig coefficients will be 4. Standard is 4
-
CameraKannalaBrandt
Copy constructor -
CameraKannalaBrandt
public CameraKannalaBrandt()With no coefficients specified.
-
-
Method Details
-
configureCoefficients
public void configureCoefficients(int numSymmetric, int numAsymmetric) Configures the number of coefficients for each distortion term.- Parameters:
numSymmetric
- Number of radially symmetric terms. Standard is 5.numAsymmetric
- Number of non symmetric terms. If not zero then trig coefficients will be 4. Standard is 4
-
fsetK
- Overrides:
fsetK
in classCameraPinhole
-
fsetShape
- Overrides:
fsetShape
in classCameraPinhole
-
fsetSymmetric
-
fsetRadial
-
fsetTangent
-
fsetRadialTrig
-
fsetTangentTrig
-
isSymmetricModel
public boolean isSymmetricModel()Returns true if it's a symmetric model. That is, no radial or tangential distortion -
isAsymmetricModel
public boolean isAsymmetricModel()Returns true if there are coefficients that could result in a non-zero distortion for the non-symmetric terms. This does not check to see if the coefficients are zero. -
setTo
Copies the value of 'src' into 'this'. After this call they will be identical- Parameters:
src
- (input) Camera model
-
isIdentical
Checks to see of the two models are exactly alike -
createLike
Description copied from class:CameraModel
Creates a new camera model with zero values of the same type os this one- Overrides:
createLike
in classCameraPinhole
-
toString
- Overrides:
toString
in classCameraPinhole
-
print
public void print()Description copied from class:CameraModel
Prints a summary of this model to stdout- Overrides:
print
in classCameraPinhole
-