camMatrix = cameraMatrix(cameraParams,rotationMatrix,translationVector) returns
a 4-by-3 camera projection matrix. You can use this matrix to project
3-D world points in homogeneous coordinates into an image.
Generate the world coordinates of the checkerboard corners in the pattern-centric coordinate system, with the upper-left corner at (0,0). The square size is in millimeters.
Rotation of camera, specified as a 3-by-3 matrix. You can obtain
this matrix using the extrinsics function.
You can also obtain the matrix using the relativeCameraPose function
by transposing its orientation output. The rotationMatrix and translationVector inputs
must be real, nonsparse, and of the same class.
translationVector — Translation of camera 1-by-3 vector
Translation of camera, specified as a 1-by-3 vector. The translation vector describes the
transformation from the world coordinates to the camera coordinates. You can
obtain this vector using the extrinsics function. You
can also obtain the vector using the location and
orientation outputs of the relativeCameraPose function:
camMatrix — Camera projection matrix 4-by-3 matrix
Camera projection matrix, returned as a 4-by-3 matrix. The matrix contains
the 3-D world points in homogenous coordinates that are projected into the
image. When you set rotationMatrix and
translationVector to double, the
function returns camMatrix as
double. Otherwise it returns
camMatrix as single.
The function computes camMatrix as follows:
camMatrix =
[rotationMatrix;
translationVector] ×
K. K: the
intrinsic matrix
Then, using the camera matrix and homogeneous coordinates, you
can project a world point onto the image.
w ×
[x,y,1] =
[X,Y,Z,1]
×
camMatrix.
(X,Y,Z):
world coordinates of a point
(x,y): coordinates of the
corresponding image point
w: arbitrary scale factor
Data Types: single | double
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.