inRange
performs range thresholding on an
Image
object. Pixels which values are within the desired
range are turned white while pixels which values are outside are turned
black. This operation is performed separately on each channel for
multi-channel images.
Arguments
- image
An
Image
object.- low
A vector indicating the inclusive lower end of the thresholding range. It can have as many elements as the number of channels in the image. If it has less elements than the number of channels, it is recycled to match the number of channels. If it has more elements than the number of channels, the extra elements are ignored without warning (default: 0).
- up
A vector indicating the inclusive upper end of the thresholding range. Itcan have as many elements as the number of channels in the image. If it has less elements than the number of channels, it is recycled to match the number of channels. If it has more elements than the number of channels, the extra elements are ignored without warning (default: 255).
- target
The location where the results should be stored. It can take 2 values:
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.
An Image
object.
Author
Simon Garnier, garnier@njit.edu
Examples
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
bw <- inRange(balloon, low = c(10, 20, 30), up = c(120, 130, 140))