Histogram
Histogram
✓ Low contrast: image values concentrated near a narrow range (mostly dark, or mostly bright, or mostly
medium values)
✓ Contrast enhancement: change the image value change the image value distribution to cover a wide
range
✓ Contrast of an image can be revealed by its histogram ✓ Can we reconstruct image from histogram? No!
Drill Problem
Very Different Images May Have Same Histogram ❑ Can two different images have the same histogram? Justify your answer.
❑ Yes, there is a possibility that two different images can have the same histogram. Here, we
have taken an original image (humming bird), and then the image is flipped in the left/right
direction. The histograms of the original image and the flipped image are taken. Since the
values of the pixels are not affected by a ‘flipping’ operation, the histogram of the original
image is the same as the histogram of the flipped image. From Fig., it is clear that even though
the original and flipped images are different, their histograms remain the same. From this
illustration, it is obvious that two different images can have the same histogram.
1
23-09-2024
❑If all the pixels in an image are shuffled, there will not be any change in the histogram of the
image. A histogram gives only the frequency of occurrence of the gray level. Consider two
images, 1 and 2, as given below:
❑Image 2 is obtained by shuffling the rows of Image 1. Their corresponding histograms are
shown below:
❑From the two histograms, it is clear that even if all the pixels in an image are shuffled, there
will not be any change in the histogram of the image.
Histograms showing (i) low dynamic range and low contrast, (ii) maximum dynamic
range and high contrast and (iii) maximum dynamic range and even higher
contrast.
2
23-09-2024
3
23-09-2024
Drill Problem
❑Perform histogram equalization on the following image.
Total 9
The modified
image has a better
histogram spread.
4
23-09-2024
Drill Problem
❑What would be the impact of the removal of the last bit in the histogram for the
following image?
Modified image
has a range of 6,
while original has
Total 9 a range of 4.
❑Histogram comparison: Below is a comparison of the two histograms i.e. original Drill Problem
and modified images. We notice the following differences in the histograms ❑The histograms of two images are illustrated below. Sketch a transformation
function for each image that will make the image have a better contrast. Use the
axis provided below to sketch your transformation functions.
✓ The range of the histogram has decreased. Original range was 7, while the
modified histogram has a range of 4.
✓ Lower range means that fewer bits are sufficient to represent the image. In this
case, the modified image can be represented with only 2 bits.
5
23-09-2024