MATLAB File Help: cv.warpPerspective | Index |
Applies a perspective transformation to an image
dst = cv.warpPerspective(src, M)
dst = cv.warpPerspective(src, M, 'OptionName',optionValue, ...)
DSize
(with
size(dst,3) == size(src,3)
) and the same type as src
.[w,h]
. Default [0,0]
means using
the same size as the input [size(src,2) size(src,1)]
.M
is the inverse transformation (dst -> src
).
default falseiiiiii|abcdefgh|iiiiiii
with some specified i
aaaaaa|abcdefgh|hhhhhhh
fedcba|abcdefgh|hgfedcb
gfedcb|abcdefgh|gfedcba
cdefgh|abcdefgh|abcdefg
uvwxyz|absdefgh|ijklmno
DSize
and the type of src
, otherwise it is ignored
and recreated by the function. This option is only useful when
BorderType=Transparent
, in which case the transformed image is drawn
onto the existing Dst
without extrapolating pixels. Not set by
default.The function cv.warpPerspective transforms the source image using the specified matrix:
dst(x,y) = src((M_11*x + M_12*y + M_13) / (M_31*x + M_32*y + M_33),
(M_21*x + M_22*y + M_23) / (M_31*x + M_32*y + M_33))
when the WarpInverse
option is true. Otherwise, the transformation is
first inverted with cv.invert and then put in the formula above instead of
M
.