Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

equalize

Histogram Equalization


Description

Equalize the image histogram to a specified range and number of levels.

Usage

equalize(x, range = c(0, 1), levels = 256)

Arguments

x

an Image object or an array

range

numeric vector of length 2, the output range of the equalized histogram

levels

number of grayscale levels (Grayscale images) or intensity levels of each channel (Color images)

Details

Histogram equalization is an adaptive image contrast adjustment method. It flattens the image histogram by performing linearization of the cumulative distribution function of pixel intensities.

Individual channels of Color images and frames of image stacks are equalized separately.

Value

An Image object or an array, containing the transformed version of x.

Author(s)

Andrzej Oles, andrzej.oles@embl.de, 2014

See Also

Examples

x = readImage(system.file('images', 'cells.tif', package='EBImage'))
  hist(x)
  y = equalize(x)
  hist(y)
  display(y, title='Equalized Grayscale Image')

  x = readImage(system.file('images', 'sample-color.png', package='EBImage'))
  hist(x)
  y = equalize(x)
  hist(y)
  display(y, title='Equalized Grayscale Image')

EBImage

Image processing and analysis toolbox for R

v4.32.0
LGPL
Authors
Andrzej Oleś, Gregoire Pau, Mike Smith, Oleg Sklyar, Wolfgang Huber, with contributions from Joseph Barry and Philip A. Marais
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.