MATLAB File Help: cv.perspectiveTransform | Index |
Performs the perspective matrix transformation of vectors
dst = cv.perspectiveTransform(src, mtx)
{[x,y],...}
or {[x,y,z],...}
.src
has
2D points, mtx
must be a 3x3 matrix, otherwise 4x4 matrix in case of
3D points.src
(either numeric or cell array).The function cv.perspectiveTransform transforms every element of src
by
treating it as a 2D or 3D vector, in the following way:
[x,y,z] -> [X/w, Y/w, Z/w]
where
[X,Y,Z,W] = mtx * [x,y,z,1]
and | W if W ~=0 w = | | inf otherwise
Here a 3D vector transformation is shown. In case of a 2D vector
transformation, the z
component is omitted.
The function transforms a sparse set of 2D or 3D vectors. If you want to transform an image using perspective transformation, use cv.warpPerspective. If you have an inverse problem, that is, you want to compute the most probable perspective transformation out of several pairs of corresponding points, you can use cv.getPerspectiveTransform or cv.findHomography.