Performs camera calibration (fisheye)
[K, D, rms] = cv.fisheyeCalibrate(objectPoints, imagePoints, imageSize)
[K, D, rms, rvecs, tvecs] = cv.fisheyeCalibrate(...)
[...] = cv.fisheyeCalibrate(..., 'OptionName',optionValue, ...)
Input
- objectPoints A cell array of cells of calibration pattern points in
the calibration pattern coordinate space
{{[x,y,z], ..}, ...}
.
- imagePoints A cell array of cells of the projections of calibration
pattern points
{{[x,y], ..}, ...}
. numel(imagePoints)
and
numel(objectPoints)
must be equal, and length(imagePoints{i})
must be
equal to length(objectPoints{i})
for each i
.
- imageSize Size of the image used only to initialize the intrinsic
camera matrix
[w,h]
.
Output
- K Output 3x3 floating-point camera matrix
[fx 0 cx; 0 fy cy; 0 0 1]
.
- D Output vector of distortion coefficients
[k1, k2, k3, k4]
.
- rms the overall RMS re-projection error.
- rvecs Output cell array of rotation vectors (see cv.Rodrigues)
estimated for each pattern view. That is, each k-th rotation vector
together with the corresponding k-th translation vector (see the next
output parameter description) brings the calibration pattern from the
model coordinate space (in which object points are specified) to the world
coordinate space, that is, a real position of the calibration pattern in
the k-th pattern view (
k=1:M
).
- tvecs Output cell array of translation vectors estimated for each
pattern view (cell array of 3-element vectors).
Options
- CameraMatrix Input 3x3 camera matrix used as initial value for
K
. If
UseIntrinsicGuess
is specified, some or all of fx
, fy
, cx
, cy
must be initialized before calling the function.
- DistCoeffs Input 4 elements vector used as an initial values of
D
.
- UseIntrinsicGuess
K
contains valid initial values of fx
, fy
,
cx
, cy
that are optimized further. Otherwise, (cx,cy)
is initially
set to the image center (imageSize
is used), and focal distances are
computed in a least-squares fashion. default false
- RecomputeExtrinsic Extrinsic will be recomputed after each iteration
of intrinsic optimization. default false
- CheckCond The functions will check validity of condition number.
default false
- FixSkew Skew coefficient (alpha) is set to zero and stay zero.
default false
- FixK1, ..., FixK4 Selected distortion coefficients are set to
zeros and stay zero. default false
- FixPrincipalPoint The principal point is not changed during the global
optimization. It stays at the center or at a different location specified
when
UseIntrinsicGuess
is set too. default false
- Criteria Termination criteria for the iterative optimization algorithm.
default
struct('type','Count+EPS', 'maxCount',100, 'epsilon',eps)