getZero | R Documentation |
Find the most common non-zero pixel in each frame of an image.
getZero(x, frac = 1)
x |
A numeric vector or array or list of such objects, where
each object is typically a grayscale |
frac |
Number between 0 and 1 specifying the fraction of values to include in the search for the most common value. |
Identify the most common pixel value in each frame of an image to serve as the true 'zero' value.
Intensity values greater than the minimum and less than
frac * maximum
are processed by the density
function to determine the most common pixel. The minimum pixel
value is excluded to avoid skewing the density estimate if an
undersaturated image is used. If the image has many bright pixels,
limit the search to the lower fraction of values by setting
frac
to a value such as 0.5
.
A numeric vector or list of numeric vectors with the most common non-zero pixel for each frame.
bnormalize
, setZero
,
getBgnd
, findBgnd
set.seed(123)
z <- c(rnorm(200, 1, 0.1), rnorm(200, 2, 1))
plot(density(z))
abline(v = getZero(z), col = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.