EBImage (version 4.14.2)

normalize: Intensity values linear scaling

Description

Linearly scale the intensity values of an image to a specified range.

Usage

"normalize"(object, separate=TRUE, ft=c(0,1), inputRange)
"normalize"(object, separate=TRUE, ft=c(0,1), inputRange)

Arguments

object
an Image object or an array
separate
if TRUE, normalizes each frame separately
ft
a numeric vector of 2 values, target minimum and maximum intensity values after normalization
inputRange
a numeric vector of 2 values, sets the range of the input intensity values; values exceeding this range are clipped

Value

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

Details

normalize performs linear interpolation of the intensity values of an image to the specified range ft. If inputRange is not set the whole dynamic range of the image is used as input. By specifying inputRange the input intensity range of the image can be limited to [min, max]. Values exceeding this range are clipped, i.e. intensities lower/higher than min/max are set to min/max.

Examples

Run this code
  x = readImage(system.file('images', 'shapes.png', package='EBImage'))
  x = x[110:512,1:130]
  y = bwlabel(x)
  display(x, title='Original')

  print(range(y))
  y = normalize(y)
  print(range(y))
  display(y, title='Segmented')

Run the code above in your browser using DataLab