Arguments
- image
An
Image
object.- x, y
The coordinates of the bottom-left corner of the subimage within the original image.
- width
The width of the subimage. Ignored if
target
is anImage
object.- height
The height of the subimage. Ignored if
target
is anImage
object.- target
The location where the results should be stored. It can take 2 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 that iftarget
does not have the same number of channels and bit depth asimage
, an error will be thrown.
Value
If target="new"
, the function returns an Image
object. If target
is an Image
object, the function
returns nothing and modifies that Image
object in place.
Author
Simon Garnier, garnier@njit.edu
Examples
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_sub <- subImage(balloon, 290, 170, 150, 150)