getZero: Find Baseline (Zero) Pixel Value

View source: R/getZero.R

getZeroR Documentation

Find Baseline (Zero) Pixel Value

Description

Find the most common non-zero pixel in each frame of an image.

Usage

getZero(x, frac = 1)

Arguments

x

A numeric vector or array or list of such objects, where each object is typically a grayscale Image object.

frac

Number between 0 and 1 specifying the fraction of values to include in the search for the most common value.

Details

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.

Value

A numeric vector or list of numeric vectors with the most common non-zero pixel for each frame.

See Also

bnormalize, setZero, getBgnd, findBgnd

Examples

set.seed(123)
z <- c(rnorm(200, 1, 0.1), rnorm(200, 2, 1))
plot(density(z))
abline(v = getZero(z), col = 2)


ornelles/virustiter documentation built on March 29, 2024, 8:30 p.m.