remap
transforms the source image using the specified
maps and interpolation methods.
Usage
remap(
image,
map1,
map2,
interpolation = "linear",
border_type = "constant",
border_color = "black",
target = "new"
)
Arguments
- image
An
Image
object.- map1, map2
Image
objects representing a joint undistortion and rectification transformation as computed byinitUndistortRectifyMap
.- interpolation
A character string representing the type of interpolation to use during transformation (default: "linear"). See notes for all accepted interpolation methods. It can be any of the following:
- "nearest":
nearest neighbor interpolation.
- "linear":
bilinear interpolation.
- "cubic":
bicubic interpolation.
- "Lanczos":
Lanczos interpolation over 8x8 neighborhood.
- border_type
A character string indicating the extrapolation method to use when filling empty pixels created during the transformation. It can be any of the following:
- "constant" (the default):
iiiiii|abcdefgh|iiiiii
withi
specified byborder_value
.- "replicate":
aaaaaa|abcdefgh|hhhhhh
.- "reflect":
fedcba|abcdefgh|hgfedc
.- "wrap":
cdefgh|abcdefgh|abcdef
.- "reflect_101":
gfedcb|abcdefgh|gfedcb
.- "transparent":
uvwxyz|abcdefgh|ijklmn
.
- border_color
A value or vector of any kind of R color specification compatible with
col2bgr
representing the color of the border (default: "black").- target
The location where the results should be stored. It can take 3 values:
- "new":
a new
Image
object is created and the results are stored inside (the default).- An
Image
object: the results are stored in another existing
Image
object. This is fast but will replace the content oftarget
. Note thattarget
must have the same dimensions, bit depth and number of channels asimage
but that it cannot beimage
itself or an error will be thrown.