
Last chance! 50% off unlimited learning
Sale ends in
## S3 method for class 'im':
cut(x, \dots)
"im"
.cut.default
.
They determine the breakpoints for the mapping from numerical values to
factor values. See cut.default
."im"
) with
pixel values that are a factor.
See im.object
.cut
operation
to the pixel values of the image x
. The range of pixel values
is divided into several intervals, and each
interval is associated with a level of a factor.
The result is another pixel image,
with the same window and pixel grid as
x
, but with the numeric value of each pixel discretised
by replacing it by the factor level. This function is a convenient way to inspect an image and to obtain summary statistics. See the examples.
To select a subset of an image, use the subset operator
[.im
instead.
cut
,
im.object
# artificial image data
Z <- setcov(square(1))
Y <- cut(Z, 3)
Y <- cut(Z, breaks=seq(0,1,length=5))
# cut at the quartiles
# (divides the image into 4 equal areas)
Y <- cut(Z, quantile(Z))
Run the code above in your browser using DataLab