Learn R Programming

Rvision (version 0.4.2)

flip: Flip an Image

Description

flip returns a flipped version of an Image around one or both of its axes.

Usage

flip(image, type = 0, in_place = FALSE)

Arguments

image

An Image object.

type

An integer indicating the type of flipping to be performed. If type = 0 (the default), the image is flipped around its x-axis; if type = 1 (or any positive value, then it is flipped around its y-axis; finally, if type = -1 (or any negative value, then it is flipped around both axes.)

in_place

A logical indicating whether the change should be applied to the image itself (TRUE, faster but destructive) or to a copy of it (FALSE, the default, slower but non destructive).

Value

An Image object if in_place=FALSE. Otherwise, it returns nothing and modifies image in place.

See Also

Image

Examples

Run this code
# NOT RUN {
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_flipped <- flip(balloon, -1)
plot(balloon_flipped)

# }

Run the code above in your browser using DataLab