Skip to contents

Logical Functions for Images

Usage

bitAnd(e1, e2, target)

bitOr(e1, e2, target)

bitNot(e1, target)

Arguments

e1, e2

Either 2 Image objects or 1 Image object and 1 numeric value/vector. If a vector and its length is less than the number of channels of the image, then it is recycled to match it.

target

The location where the results should be stored. It can take 3 values:

  • "new":a new Image object is created and the results are stored inside (the default).

  • "self":the results are stored back into e1 if it is an Image object, otherwise into e2 (faster but destructive).

  • An Image object:the results are stored in another existing Image object. This is fast and will not replace the content of e1 or e2 but will replace that of target. Note that if target does not have the same dimensions, number of channels, and bit depth as e1 (if e1 is an Image object, e2 otherwise), an error will be thrown.

Value

If target="new", the function returns an Image

object. If target="self", the function returns nothing and modifies

e1 in place if it is an Image object, otherwise it modifies e2 in place. If target is an Image

object, the function returns nothing and modifies that Image

object in place.

See also

Author

Simon Garnier, garnier@njit.edu

Examples

balloon1 <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon2 <- image(system.file("sample_img/balloon2.png", package = "Rvision"))