Walchand College of Engineering, Sangli
(An Government Aided Institute)
Department of Information Technology
Image Specification and histogram
matching
Walchand College of Engineering, Sangli
(An Government Aided Institute)
Department of Information Technology
Name of Students :
1. Bhushan Jadhav ( PRN: 2019BTEIT00060 )
2. Sanket Sanatan ( PRN: 2019BTEIT00071 )
3. Omkar Kulkarni ( PRN: 2019BTEIT00055 )
Agenda
1. Image Histogram
2. Histogram Matching
3. References
3
What is Image Histogram ?
• The image histogram indicates the intensity distribution of an image
• The image histogram shows the number of pixels in an image having a
specific intensity value
• As an example, assume a normal image with pixel intensities varies
from 0 to 255
• Count the number of pixels having intensity value 0, then 1 and
continue to the 255 to generate histogram
4
Image Histogram
0 2 1 3 4 Gray level Number of Pixels
1 3 4 3 3 0 4
0 1 3 1 4 1 5
3 1 4 2 0 2 3
0 4 2 4 4 3 6
4 7
Image 5 * 5
Histogram Table
Generating histogram:
● Count the number of each pixel intensities
● Generate the histogram by creating a bar chart based on the histogram
table
5
Image Histogram
Gray level Number of
Pixels
0 4
1 5
2 3
3 6
4 7
6
Histogram Matching
● Histogram Matching or Histogram Specification is the transformation of an
image so that its histogram matches a specified histogram
● Histogram matching is useful when we want to unify the contrast level of
group of images
● Histogram matching can be used as a lightweight normalization for image
processing, such as feature matching
7
Histogram Matching
8
Histogram Matching and Equalization
● In histogram equalization the goal is to improve contrast in images that
might be either blurry or have a background and foreground that are
either both bright or both dark
● Histogram equalization helps sharpen an image
● The goal of histogram matching is to take an input image and generate
an output image that is based upon the shape of a specific or reference
histogram
● Histogram equalization as a special case of histogram matching
9
Histogram Matching
Example:
Gray 0 1 2 3 4 5 6 7
level
No of 790 1023 850 656 329 245 122 81
Pixel
Input image
Gray 0 1 2 3 4 5 6 7
level
No of 0 0 0 614 819 1230 819 614
Pixel
Reference Image
10
Histogram Matching
Intensit No of PDF CDF SK*7 Round New nk
y Pixels (nk) Off
0 790 0.19 0.19 1.33 1 790
1 1023 0.25 0.44 3.08 3 1023
2 850 0.21 0.65 4.55 5 850
3 656 0.16 0.81 5.68 6 985
4 329 0.08 0.89 6.23 6
5 245 0.06 0.95 6.65 7
6 122 0.03 0.98 6.86 7 448
7 81 0.02 1 7 7
Histogram equalization of Input image
11
Histogram Matching
Intensit No of PDF CDF SK*7 Round
y Pixels (nk) Off
0 0 0 0 0 0
1 0 0 0 0 0
2 0 0 0 0 0
3 614 0.149 0.149 1.05 1
4 819 0.2 0.35 2.50 3
5 1230 0.30 0.65 4.55 5
6 819 0.20 0.85 5.97 6
7 614 0.15 1 7 7
Histogram Equalization of
Reference image
12
Histogram Matching
Intensity Round Round New nk
Off Off
0 0 1 790
1 0 3 1023
2 0 5 850
3 1 6
4 3 6 985
5 5 7
6 6
7 448
7 7
7
Reference Image Input Image
Intensity 0 1 2 3 4 5 6 7
No of 0 0 0 790 1023 850 985 448
pixels
Output image intensity count 13
Histogram Matching
Input Image Histogram Reference Image Histogram
Output Image Histogram
14
Histogram Matching
15
References
● Histogram equalization
https://towardsdatascience.com/histogram-matching-ee3a67
b4cbc1
(30-11-2022)
● Histogram Matching
https://youtu.be/fZn0dSkS28I (29-11-2022)
● Histogram Matching
https://github.com/aliprf/CV-HistogramMatching (30-11-2022)
16