cv.remap - MATLAB File Help |
Applies a generic geometrical transformation to an image
dst = cv.remap(src, map1, map2)
dst = cv.remap(src, map1)
dst = cv.remap(..., 'OptionName',optionValue, ...)
int16
(2-channels), single
(1-channels), or single
(2-channels). See cv.convertMaps for details on
converting a floating-point representation to fixed-point for speed.uint16
(1-channel) or single
(1-channel), or none (empty map if map1
is (x,y) points), respectively.In other words, the following map combinations are valid:
map1
as NxMx1 single
matrix,
and map2
as NxMx1 single
matrixmap1
as NxMx2 single
array,
and unspecified/empty map2
. This is equivalent to map1=cat(3,map1,map2)
from the separate floating-point representation.map1
as NxMx2
int16
array, and map2
as NxMx1
uint16
matrix, converted from the floating-point
representation using cv.convertMaps.map1
and
the same type as src
.iiiiii|abcdefgh|iiiiiii
with some specified i
aaaaaa|abcdefgh|hhhhhhh
fedcba|abcdefgh|hgfedcb
gfedcb|abcdefgh|gfedcba
cdefgh|abcdefgh|abcdefg
uvwxyz|abcdefgh|ijklmno
map1
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.remap transforms the source image using the specified map:
dst(x,y) = src(mapX(x,y), mapY(x,y))
where values of pixels with non-integer coordinates are computed using one
of available interpolation methods. mapX
and mapY
can be encoded as
separate floating-point maps in map1
and map2
respectively, or
interleaved floating-point maps of (x,y) in map1
, or fixed-point maps
created by using cv.convertMaps. The reason you might want to convert from
floating to fixed-point representations of a map is that they can yield much
faster (2x) remapping operations. In the converted case, map1
contains
pairs (floor(x), floor(y))
and map2
contains indices in a table of
interpolation coefficients.
Note: Due to current implementation limitations, the size of an input and output images should be less than 32767x32767.