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
Imageobject.- map1, map2
Imageobjects 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|iiiiiiwithispecified 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
col2bgrrepresenting the color of the border (default: "black").- target
The location where the results should be stored. It can take 3 values:
- "new":
a new
Imageobject is created and the results are stored inside (the default).- An
Imageobject: the results are stored in another existing
Imageobject. This is fast but will replace the content oftarget. Note thattargetmust have the same dimensions, bit depth and number of channels asimagebut that it cannot beimageitself or an error will be thrown.