imhist | R Documentation |
imhist
computes (or plots) the multichannel histogram of
an Image
object.
imhist(
image,
nbins = 257,
range = c(0, 256),
mask = NULL,
plot = FALSE,
col = c("blue", "green", "red", "black"),
xlab = "Pixel value",
ylab = "Counts",
lty = 1,
...
)
image |
An |
nbins |
An integer indicating the number of bins of the histogram (default: 256). |
range |
The range of pixel values to include in the histogram (default: c(0, 256)). The lower boundary is inclusive but the higher one is exclusive. |
mask |
A single-channel (GRAY) 8-bit (8U) |
plot |
A logical indicating whether to plot the histogram (default: FALSE). |
col |
A value or vector of any kind of R color specification
compatible with |
xlab , ylab |
Character strings for the axis labels (default: "Pixel value" for the x axis and "Counts" for the y axis). |
lty |
A vector of line types, see |
... |
Further arguments passed to |
If plot=FALSE
, the function returns a m x n
matrix,
with m = nbins
and n
equal to the number of channels in the
image + 1. The first column corresponds to the bin values. If
plot=TRUE
, the function plots the histogram and returned the
aforementioned matrix silently.
Simon Garnier, garnier@njit.edu
Image
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
imhist(balloon, plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.