IP Unit2
IP Unit2
in Spatial Domain
• The second linear transformation is negative transformation, which is invert of identity transformation. In
negative transformation, each value of the input image is subtracted from the L-1 and mapped onto the
output image. The result is somewhat like this.
since the input image of Einstein is an 8 bpp image, so the
number of levels in this image are 256. i.e. 2 power 8
Input Image Output Image
Putting 256 in the equation, we get this
s = 255 – r
So each value is subtracted by 255 and the result image
has been shown above. So what happens is that, the
lighter pixels become dark and the darker picture
becomes light. And it results in image negative. It has
been shown in the graph below.
Inverse Log:
For low contrast image, the histogram values are at the center
and not distributed
1. In digital image processing, histograms are used for simple calculations in software.
2. It is used to analyze an image. Properties of an image can be predicted by the detailed
study of the histogram.
3. The brightness of the image can be adjusted by having the details of its histogram.
4. The contrast of the image can be adjusted according to the need by having details of the x-
axis of a histogram.
5. It is used for image equalization. Gray level intensities are expanded along the x-axis to
produce a high contrast image.
6. Histograms are used in thresholding as it improves the appearance of the image.
7. If we have input and output histogram of an image, we can determine which type of
transformation is applied in the algorithm.
Histogram Processing Techniques
1. Histogram Sliding:
In Histogram sliding, the complete
histogram is shifted towards rightwards or
leftwards. When a histogram is shifted
towards the right or left, clear changes are
seen in the brightness of the image. The
brightness of the image is defined by the
intensity of light which is emitted by a
particular light source.
2. Histogram Stretching
• In histogram stretching, contrast of an image is increased. The contrast of an image is
defined between the maximum and minimum value of pixel intensity.
• If we want to increase the contrast of an image, histogram of that image will be fully
stretched and covered the dynamic range of the histogram.
• From histogram of an image, we can check that the image has low or high contrast.
3. Histogram Equalization
• Histogram equalization is used for equalizing all the pixel values of an image. Transformation
is done in such a way that uniform flattened histogram is produced.
• Histogram equalization increases the dynamic range of pixel values and makes an equal count
of pixels at each level which produces a flat histogram with high contrast image.
• While stretching histogram, the shape of histogram remains the same whereas in Histogram
equalization, the shape of histogram changes and it generates only one image.
Discuss the algorithm for histogram equalizations
Histogram equalization is one of the Pixel brightness transformations techniques. It is a well-known contrast
enhancement technique due to its performance on almost all types of image.
Example: Perform the histogram equalization of following pixel values
3. What is an edge detection filter? Differentiate between the first derivative and second
derivative filter? Derive the filter mask for Laplacian filter and write the algorithm for its
implementation. [1+2+7=10]