Back to FabImage Studio website

You are here: Start » Filter Reference » Image » Image Enhancement » NormalizeImage

NormalizeImage


Module: FoundationLite

Rescales an image linearly, so that its minimum becomes inNewMinimum and the maximum of the remaining pixels becomes inNewMaximum.

Applications

Aims at better using the image's dynamic range to represent an interesting subset of pixel values.
Name Type Range Description
Input value inImage Image Input image
Input value inRoi Region* Range of pixels to be processed
Input value inNewMinimum Real Desired minimum value of the resulting image
Input value inNewMaximum Real Desired maximum value of the resulting image
Input value inSaturateBrightestFraction Real 0.0 - 1.0 Fraction of the brightest pixels skipped during normalization
Input value inSaturateDarkestFraction Real 0.0 - 1.0 Fraction of the darkest pixels skipped during normalization
Input value inMinValue Real* Pixels darker than that value will be skipped during normalization
Input value inMaxValue Real* Pixels brighter than that value will be skipped during normalization
Output value outImage Image Rescaled image
Output value outA Real Multiplicative parameter of the applied linear transformation of pixel values
Output value outB Real Additive parameter of the applied linear transformation of pixel values
Diagnostic input diagLinearNormalizedRegion Region Region of image that has been linearly normalized

Description

This filter linearly scales the pixel values of an image in order to make the histogram span the desired range of values.

The operation computes the parameters \(A\), \(B\) of the linear transform that scales the image values to the desired range and applies the transform computing the results as follows:

\[ \begin{aligned} outImage[i,j] &= inImage[i,j] \times A + B \\ outA &= A \\ outB &= B \end{aligned} \]

The inSaturateBrightestFraction and inSaturateDarkestFraction parameters can be used to make image normalization independent from salt and pepper noise. The normalization skips a chosen fraction of the brightest and the darkest pixels during counting \(A\) and \(B\). The brightest and darkest pixels are set to inNewMaximum and inNewMinimum respectively, while the rest of the image is linearly scaled. A region of the linear scaling is available on diagLinearNormalizedRegion diagnostic output. For example, setting inSaturateBrightestFraction to 0.01 causes skipping 1 percent of the brightest pixels during counting \(A\) and \(B\). Please note that the inSaturateBrightestFraction and inSaturateDarkestFraction parameters can be non-zero only for images with UInt8, Int8, UInt16 or Int16 pixel type.

Examples

Description of usage of this filter can be found in examples and tutorial: Fourier Analysis.

NormalizeImage run on example image.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Empty image on input in NormalizeImage.
DomainError Region exceeds an input image in NormalizeImage.
DomainError The inSaturationFraction inputs cannot be used for images with this pixel type in NormalizeImage.
DomainError The sum of inSaturateBrightestFraction and inSaturateDarkestFraction can't be greater than 1 in NormalizeImage.

Complexity Level

This filter is available on Advanced Complexity Level.

See Also

  • RescalePixels – Applies linear transformation to pixel values.
  • ResaturateImage – Sets pixels below the low value to minimum, above the high value to maximum, and interpolates the rest.
  • AddToImage – Adds a scalar value to each pixel.