×
☰ Menu

 


Gray Level Transformation

There are three basic gray level transformation.

  • Linear
  • Logarithmic
  • Power – law

 

 


Linear Transformation

First, we will look at the linear transformation. Simple identity and negative transformation are examples of linear transformation.

The change in identity is depicted by a linear line. Each value of the input picture is directly mapped to each other value of the output image during this transition. The input image and output image are the same as a result of that. Therefore, it is known as identity change. 
The opposite of identity change is negative transformation. Each incoming image value is here subtracted from L-1 before being mapped onto the output image.

Negative of an Image

The negative of an image is achieved by replacing the intensity ‘i’ in the original image by ‘i-1’, i.e. the brightest pixels will become the darkest and darkest pixels will become the brightest. Image negative is formed by subtracting each pixel from the maximum value of intensity.

Example: In an 8-bit grayscale image, the maximum intensity value is 255, thus each pixel is subtracted from 255 to produce the output image.

The transformation function used in image negative is:
s = (L – 1) – r


Where

  • L - 1 is the max intensity value,
  • s is the output pixel value
  • r is the input pixel value

 


Log transformation

The log transformations can be defined by this formula

s = c log (r + 1)

Where

 

  • s is the output pixel value
  • r is the input pixel value
  • c is a constant

The value 1 is added to each of the pixel value of the input image because if there is a pixel intensity of 0 in the image, then log (0) is equal to infinity. So, 1 is added, to make the minimum value at least 1. During log transformation, the dark pixels in an image are expanded as compare to the higher pixel values. The higher pixel values are kind of compressed in log transformation. This result in following image enhancement.

 

The value of c in the log transform adjusts the kind of enhancement. 

  • The input image's small range of low Gray-level values is translated by the log curve into a larger range of output levels.
  • Used to compress the higher-level values while expanding the values of dark pixels in an image.
  • It reduces the dynamic range of images with significant pixel value variation.
  • When the input grey level values may have an extremely wide range of values, log functions are especially helpful.

Power – Law transformations

There are further two transformation is power law transformations, that include nth power and nth root transformation. These transformations can be given by the expression:

s=crγ

This symbol γ is called gamma, due to which this transformation is also known as gamma transformation.
Variation in the value of γ varies the enhancement of the images. Different display devices / monitors have their own gamma correction, that’s why they display their image at different intensity. This type of transformation is used for enhancing images for different type of display devices.

The gamma of different display devices is different.

If gamma <1 : The mapping is weighted  toward brighter output values.
If gamma =1 : The mapping is  linear (default).
If gamma >1 : The mapping is weighted  toward darker output values.