Learn R Programming

Rvision (version 0.4.2)

subImage: Extract Subimage

Description

subImage extracts a portion of an Image and returns it as an Image object.

Usage

subImage(image, x, y, width, height, border = TRUE, ...)

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.

height

The height of the subimage.

border

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.

Value

An Image object.

See Also

Image

Examples

Run this code
# 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