
subImage
extracts a portion of an Image
and
returns it as an Image
object.
subImage(image, x, y, width, height, border = TRUE, ...)
An Image
object.
The coordinates of the bottom-left corner of the subimage within the original image.
The width of the subimage.
The height of the subimage.
If the subimage extends beyond the boundaries of the source
image and border = TRUE
(the default), a border is created to account
for the missing pixels.
Additional parameters to be passed to border
if the
the subimage extends beyond the boundaries of the source image and
border = TRUE
. These parameters control for the type and color of the
border.
An Image
object.
# NOT RUN {
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_sub <- subImage(balloon, 290, 170, 150, 150)
plot(balloon_sub)
# }
Run the code above in your browser using DataLab