You are on page 1of 36

University of Baghdad

Al-Khwarizmi College of Engineering


Biomedical Engineering Department

Image processing for BME 2


5th Stage

Lecture 1
Image Enhancement

By:
Dr. Noor Kamal
PhD in Biomedical Engineering
Image processing for BME 2_Lec 1_ 2020 1
Image Histograms

• The histogram of an image is a tally of the number of pixels


at each intensity level or color (Frequency of the intensity
values of the image).
• The shape of the histogram is related to the ranges and
groupings of intensity values in the image.
• Quantise frequency into intervals (called bins)

Image processing for BME 2_Lec 1_ 2020 2


Image Histograms

• In the following monochrome examples notice how


the peaks of in the histogram correspond to
concentrations of intensities in the image globally.
• In the color examples the primary that has the
largest value at any intensity dominates the image.

Image processing for BME 2_Lec 1_ 2020 3


Monochrome Intensity Distributions

Image processing for BME 2_Lec 1_ 2020 4


Monochrome Intensity Distributions

Image processing for BME 2_Lec 1_ 2020 5


Monochrome Intensity Distributions

Image processing for BME 2_Lec 1_ 2020 6


Color Intensity Distributions

Image processing for BME 2_Lec 1_ 2020 7


Color Intensity Distributions

Image processing for BME 2_Lec 1_ 2020 8


Color Intensity Distributions

Image processing for BME 2_Lec 1_ 2020 9


Color Intensity Distributions

Image processing for BME 2_Lec 1_ 2020 10


Image Histograms: Monochrome

Image processing for BME 2_Lec 1_ 2020 11


Image Histograms: Monochrome

Image processing for BME 2_Lec 1_ 2020 12


The Histogram of a Monochrome Image

Image processing for BME 2_Lec 1_ 2020 13


The Histogram of a Monochrome Image
(Multi-resolution Image)

Image processing for BME 2_Lec 1_ 2020 14


The Histogram of a Monochrome Image

Image processing for BME 2_Lec 1_ 2020 15


The Histogram of a Monochrome Image

Image processing for BME 2_Lec 1_ 2020 16


The Histogram of a Monochrome Image

Image processing for BME 2_Lec 1_ 2020 17


The Histograms of a Color Image

Image processing for BME 2_Lec 1_ 2020 18


The Histograms of a Color Image

Image processing for BME 2_Lec 1_ 2020 19


Image processing for BME 2_Lec 1_ 2020 20
Histograms Processing

Image processing for BME 2_Lec 1_ 2020 21


Histograms Processing

Image processing for BME 2_Lec 1_ 2020 22


Image Enhancement

Histogram equalization : is a method which increases the


dynamic range of the gray-levels in a low-contrast image to cover
full range of gray-levels.
Goal: find a transform s=T(r) such that the transformed image
has a flat (equalized) histogram.
• A) T(r) is signle-valued and monotonically increasing
in interval [0,1];
• B) 0≤T(r) ≤1 for 0 ≤r ≤1.

Image processing for BME 2_Lec 1_ 2020 23


Histogram Equalization
4
x 10
16

14

12

Histogram Equalization
10

0 50 100 150 200 250

4
x 10

16

14

12

10

0 50 100 150 200 250

Image processing for BME 2_Lec 1_ 2020 24


Histogram Equalization

Image processing for BME 2_Lec 1_ 2020 25


Histogram Equalization

Image processing for BME 2_Lec 1_ 2020 26


Histogram Equalization

Image processing for BME 2_Lec 1_ 2020 27


Histogram Equalization

Image processing for BME 2_Lec 1_ 2020 28


Histogram Equalization

Image processing for BME 2_Lec 1_ 2020 29


Histogram Equalization

Image processing for BME 2_Lec 1_ 2020 30


Histogram Equalization

Image processing for BME 2_Lec 1_ 2020 31


Histogram Equalization

Normalized histogram
Normalized histogram
nXm=6X6=36 pixels

NXM=6X6=36 pixels

Image processing for BME 2_Lec 1_ 2020 32


Example (Histogram Equalization)
Consider the following image (a matrix filled with integers) with the gray
scale value ranging from 0 to 7, with each pixel encoded into 3 bits, find the
image histogram then perform the equalization:

values are spreads over the whole range from 0 to the maximum scale level 255.
Image processing for BME 2_Lec 1_ 2020 33
8

Number of pixels
7

Pixel p(m,n) level Number of pixels 6


0 2
5
1 7
2 5 4
3 3
4 1 3

5 1 2
6 1
7 0 1

0
0 1 2 3 4 5 6 7

Scale Level

Image processing for BME 2_Lec 1_ 2020 34


The equalized image using Table 2, is finally obtained by replacing each old pixel value in the
old image with the corresponding equalized new pixel value as in below:

1 3 5 5 7
5 3 3 5 3
3 6 6 6 6
1 5 7 3 3

Image processing for BME 2_Lec 1_ 2020 35


8

Number of pixels
7
Table 3: Pixel level distribution counts of the
equalized image
6
Pixel p(m,n) level Number of pixels
0 0 5
1 2
2 0 4
3 7
4 0 3
5 5
6 4 2
7 2
1

0
0 1 2 3 4 5 6 7
Scale Level

Image processing for BME 2_Lec 1_ 2020 36

You might also like