You are on page 1of 23

Biometrics Course

Image
Enhancement

• PRESENTED BY:

• SAIF ALABACHI

• COMPUTER ENGINEERING

• UNIVERSITY OF TECHNOLOGY
What is Image Enhancement
Improve the quality of an image or accentuate features. Techniques are more general
purpose, and, unlike restoration, a strong model of the degradation process is not assumed.

• How to improve contrast?

• How to sharpen edges?

• How to reduce noise?

12/23/2020 2
Enhancement Techniques
When recording image data, there are often particular problems: lighting, motion blur, noise,…

We transform an image A into a new image Anew of the same size, by mapping a grey
level u at pixel location p in A by a gradation function g onto a grey level v=g(u).

Spatial Domain: Point operations methods operate on pixels’ intensities

Spatial Domain: Mask operations methods operate on pixel’s neighbors

Frequency Domain: Global operations operate on FT Image

12/23/2020 3
Power-Law Transformation
➢ Change contrast and brightness by transforming pixel intensities.
➢ Assign the same new intensity value to all pixels having a given original value.

𝒊𝒏𝒆𝒘 = 𝒄 ∗ 𝒊𝜸
12/23/2020 4
Digital negative

Image negative is produced by subtracting each pixel from the maximum intensity value.

𝒊𝒏𝒆𝒘 = 𝑳 − 𝒙
12/23/2020 5
Contrast Stretching

α𝑥 0≤𝑥<𝑎
𝑦 = ቐ β 𝑥 − 𝑎 + 𝑦𝑎 𝑎≤𝑥<𝑏
γ 𝑥 − 𝑏 + 𝑦𝑏 𝑏≤𝑥<𝐿

𝑎 = 50, 𝑏 = 150, α = 0.2, β = 2, γ = 1, 𝑦𝑎 = 30, 𝑦𝑏 = 200


12/23/2020 6
Clipping

0 0≤𝑥<𝑎
𝑦 = ቐβ 𝑥 − 𝑎 𝑎≤𝑥<𝑏
β 𝑏−𝑎 𝑏≤𝑥<𝐿

𝑎 = 50, 𝑏 = 150, β = 2
12/23/2020 7
Range Compression

𝑦 = 𝑐𝑙𝑜𝑔10 (1 + 𝑥)

Where, ‘y’ and ‘x’ are the output and input pixel values and c is the scaling
constant represented by the following expression (for 8-bit)
255
c=
(log 1+𝑚𝑎𝑥𝐼𝑛𝑝𝑢𝑡𝑃𝑖𝑥𝑒𝑙𝑉𝑎𝑙𝑢𝑒 )

12/23/2020
𝑐 = 100
8
Homework:

• 𝑾𝒉𝒂𝒕 𝑳𝒐𝒈 𝒕𝒓𝒂𝒏𝒔𝒇𝒐𝒓𝒎𝒂𝒕𝒊𝒐𝒏 𝒄𝒂𝒏 𝒅𝒐 𝒕𝒐 𝒕𝒉𝒆 𝒊𝒎𝒂𝒈𝒆 𝒊𝒏𝒕𝒆𝒏𝒔𝒊𝒕𝒊𝒆𝒔 𝒗𝒂𝒍𝒖𝒆𝒔


• 𝑺𝒉𝒐𝒘 𝒕𝒉𝒆 𝒈𝒓𝒂𝒚𝒍𝒆𝒗𝒆𝒍 𝒕𝒓𝒂𝒏𝒔𝒇𝒐𝒓𝒎𝒂𝒕𝒊𝒐𝒏 𝒑𝒍𝒐𝒕
• 𝑾𝒉𝒆𝒏 𝒘𝒆 𝒄𝒂𝒏 𝒖𝒔𝒆 𝒕𝒉𝒊𝒔 𝒎𝒆𝒕𝒉𝒐𝒅

𝑵𝒐𝒕𝒆: 𝑷𝒓𝒐𝒈𝒓𝒂𝒎𝒎𝒊𝒏𝒈 𝒔𝒐𝒍𝒖𝒕𝒊𝒐𝒏𝒔 𝒘𝒊𝒕𝒉 𝒄𝒐𝒎𝒎𝒆𝒏𝒕𝒔 𝒘𝒊𝒍𝒍 𝒈𝒆𝒕 𝒆𝒙𝒕𝒓𝒂 𝒄𝒓𝒆𝒅𝒊𝒕𝒔

12/23/2020 9
Histogram

12/23/2020 10
Image Histogram
The histogram of a digital image with gray levels from 0 to 𝐿 − 1 is a discrete function ℎ(𝑟𝑘 ) = 𝑛𝑘 ,
where:

nk
• Normalized histogram: p rk
n

(Sum of all components = 1)

12/23/2020 11
Image Histogram

• Histogram of an image provides the frequency of the


brightness (intensity) value in the image.
• Provides a natural bridge between images and a probabilistic
description.

Pseudo-Code for Histogram:


1. Create an array ℎ with zero in its elements.
2. For all pixel locations (𝑥, 𝑦) of the image 𝐴, increment
ℎ(𝐴 𝑥, 𝑦 ) by 1.

12/23/2020 12
Histogram and Probability Density Function (PDF)

• Assume a scalar image, A, and its histogram H.

𝐻 𝑢
ℎ 𝑢 =
|𝛺|
• Denominator is the size of histogram (num. of pixels)
• h -> PDF, relative frequencies are set between 0 and 1.

12/23/2020 13
Histogram Modifications

12/23/2020 14
Histogram Equalization
• Histogram equalization is an effective techn for improving the appearance of a poor image
• The function is the same as histogram stretch but often provides more visually pleasing results
across a wider range of images
• Involves probability theory which treat as the probability distribution of gray levels
• Can use a sigmoid lookup to map input to output grey levels
• A sigmoid function g(i) controls the mapping from input to output pixel
• Can easily be implemented in hardware for maximum efficiency
• Often images poorly use the full range of the gray scale.
Solution:
Transform image such that its histogram is spread out more evenly in gray scale

12/23/2020 15
12/23/2020
Corresponding
Histograms
Source image
Histogram Equalization

Equalized Image
16
Histogram Equalization
Normalized histogram p (PDF) of an image f, whose intensity values span from 0 to L-1

𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑝𝑖𝑥𝑒𝑙𝑠 𝑤𝑖𝑡ℎ 𝑖𝑛𝑡𝑒𝑛𝑠𝑖𝑡𝑦 𝑛


𝑝 𝑛 = 𝑛 = 0, 1, … … , 𝐿 − 1
𝑡𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑝𝑖𝑥𝑒𝑙𝑠
𝑓𝑖,𝑗

𝑔𝑖,𝑗 = 𝑓𝑙𝑜𝑜𝑟((𝐿 − 1) ෍ 𝑝𝑛 )
𝑛=0

12/23/2020 17
Histogram Equalization – Discrete Case

12/23/2020 18
Histogram Equalization – Discrete Case

12/23/2020 19
Histogram Equalization – Example 1

12/23/2020 20
Histogram Equalization – Example 2

12/23/2020 21
Histogram Equalization – Example 3

12/23/2020 22
Histogram Equalization – Example 4

12/23/2020 23

You might also like