Start » Filter Reference » Image » Image Enhancement » NormalizeImage
Module: | FoundationLite |
---|
Rescales an image linearly, so that its minimum becomes inNewMinimum and the maximum of the remaining pixels becomes inNewMaximum.
Applications
Name | Type | Range | Description | |
---|---|---|---|---|
inImage | Image | Input image | ||
inRoi | Region* | Range of pixels to be processed | ||
inNewMinimum | Real | Desired minimum value of the resulting image | ||
inNewMaximum | Real | Desired maximum value of the resulting image | ||
inSaturateBrightestFraction | Real | 0.0 - 1.0 | Fraction of the brightest pixels skipped during normalization | |
inSaturateDarkestFraction | Real | 0.0 - 1.0 | Fraction of the darkest pixels skipped during normalization | |
inMinValue | Real* | Pixels darker than that value will be skipped during normalization | ||
inMaxValue | Real* | Pixels brighter than that value will be skipped during normalization | ||
outImage | Image | Rescaled image | ||
outA | Real | Multiplicative parameter of the applied linear transformation of pixel values | ||
outB | Real | Additive parameter of the applied linear transformation of pixel values | ||
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
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.