There are three basic gray level 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.
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
The log transformations can be defined by this formula
s = c log (r + 1)
Where
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.
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.