21bce7149 Spandana (Dip Ass-2)
21bce7149 Spandana (Dip Ass-2)
ASSIGNMENT – 2
STEP-2:
Display 64-bin histograms for both the original image (A)
and the equalized image (B) to reveal insights into pixel intensity
distribution.
STEP-3:
Convert the original image (A) to grayscale (C) and apply
contrast stretching, creating an adjusted grayscale image k.
STEP-4:
Apply contrast stretching to the original color image (A)
within the specified intensity range [0.3, 0.7], yielding modified
color image K.
STEP-5:
Arrange a 3x2 grid for visualization:
• Display the original image (A) with a title.
• Show the histogram of the original image (A) with 50 bins
and a title.
• Present the histogram-equalized image (B) with a title.
• Show the histogram of the equalized image (B) with 50 bins
and a title.
• Display the contrast-stretched grayscale image (k) with a
title.
• Display the contrast-stretched color image (K) with a title.
Code :
Output Images:
Conclusion :
In Conclusion this workflow explores the effects
of histogram equalization and contrast stretching on an image,
enhancing contrast and adjusting pixel intensity distribution.
Visualizations in a 3x2 grid showcase the original image,
histograms, histogram-equalized version, and contrast-
stretched grayscale/color images. The process demonstrates
the significance of spatial filtering in improving image quality
and understanding contrast adjustments' visual impact.