Comparison between Images
Arguments
- e1, e2
Either 2
Imageobjects or 1Imageobject 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.- comparison
A character string indicating the comparison to be performed between
e1on the left ande2on the right. It can be any of the followings: "==", "!=", ">", "<", ">=", "<=".- target
The location where the results should be stored. It can take 3 values:
- "new":
a new
Imageobject is created and the results are stored inside (the default).- "self":
the results are stored back into
e1if it is anImageobject, otherwise intoe2(faster but destructive).- An
Imageobject: the results are stored in another existing
Imageobject. This is fast and will not replace the content ofe1ore2but will replace that oftarget. Note that iftargetdoes not have the same dimensions, number of channels, and bit depth ase1(ife1is anImageobject,e2otherwise), 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.
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"))
comp <- compare(balloon1, balloon2, ">=")