warpAffine | R Documentation |
warpAffine
applies an affine transformation to an image.
warpAffine(
image,
warp_matrix,
interp_mode = "linear",
inverse_map = TRUE,
border_type = "constant",
border_color = "black",
target = "new",
output_size = dim(image)[1:2]
)
image |
An |
warp_matrix |
A 2x3 numeric matrix. |
interp_mode |
A character string indicating the interpolation method to be used. It can be any of the following:
|
inverse_map |
A logical. TRUE if |
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:
|
border_color |
A value or vector of any kind of R color specification
compatible with |
target |
The location where the results should be stored. It can take 3 values:
|
output_size |
If |
If target="new"
, the function returns an Image
object. If target="self"
, the function returns nothing and modifies
image
in place. If target
is an Image
object,
the function returns nothing and modifies that Image
object in
place.
Simon Garnier, garnier@njit.edu
warpPerspective
, findTransformECC
file1 <- system.file("sample_img/balloon1.png", package = "Rvision")
file2 <- system.file("sample_img/balloon2.png", package = "Rvision")
balloon1 <- changeColorSpace(image(file1), "GRAY")
balloon2 <- changeColorSpace(image(file2), "GRAY")
ecc <- findTransformORB(balloon1, balloon2)
balloon2_transformed <- warpAffine(balloon2, ecc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.