Intensity transformation functions
Intensity transformation functions, also known as image enhancement or contrast enhancement functions, are used in digital image processing to modify the pixel intensity values in an image to improve its visual quality or extract specific features. These functions are commonly applied to grayscale images, although they can also be adapted for use in color images. Intensity transformation functions typically take the form of mathematical operations applied to each pixel's intensity value.
Here are some common intensity transformation functions:
1. Linear Transformation (Contrast Stretching) :
- This is a simple linear scaling of pixel values to stretch the contrast in an image. It is often used to increase the visibility of details.
- Formula: $$g(x, y) = a \cdot f(x, y) + b$$
- 'f(x, y)' is the original pixel intensity, 'g(x, y)' is the transformed intensity, 'a' is the gain (slope), and 'b' is the bias (offset).
2. Logarithmic Transformation:
- This transformation is used to expand the lower-intensity range of an image, which can make details in dark areas more visible.
- Formula: $$g(x, y) = c \cdot \log(1 + f(x, y))$$
- 'f(x, y)' is the original pixel intensity, 'g(x, y)' is the transformed intensity, and 'c' is a scaling constant.
3. Power-law (Gamma) Transformation:
- This transformation raises the pixel intensities to a power to adjust the contrast. It can be used to make dark areas lighter (γ < 1) or vice versa.
- Formula: $$g(x, y) = c \cdot [f(x, y)]^{\gamma}$$
- 'f(x, y)' is the original pixel intensity, 'g(x, y)' is the transformed intensity, 'c' is a scaling constant, and 'γ' is the gamma value.
4. Histogram Equalization:
- This method redistributes pixel values in an image to achieve a uniform histogram, which enhances the overall contrast and can make features more distinguishable.
- It involves computing a cumulative distribution function (CDF) of the pixel intensities and mapping the original values to new values based on the CDF.
5. Piecewise Linear Transformation:
- In some cases, different linear transformations are applied to different intensity ranges in the image to control contrast and brightness selectively in various parts of the image.
6. Thresholding:
- Thresholding is a simple intensity transformation where pixel values below a certain threshold are set to a minimum value, and values above the threshold are set to a maximum value, creating a binary image.
Intensity transformation functions are fundamental in image processing for tasks such as enhancing images for human perception, preprocessing images for machine vision, and extracting specific information from images. The choice of transformation depends on the specific requirements of the application and the characteristics of the input image.