Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

lec_7 DSP ( image) (1)

The document discusses image enhancement techniques in digital signal processing, focusing on spatial and frequency domains. It covers methods such as histogram equalization and various pixel manipulation techniques to improve image quality for specific applications. The evaluation of image quality is subjective for human perception but more straightforward for machine recognition, necessitating trial and error in selecting enhancement approaches.

Uploaded by

Hamza Mohamed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

lec_7 DSP ( image) (1)

The document discusses image enhancement techniques in digital signal processing, focusing on spatial and frequency domains. It covers methods such as histogram equalization and various pixel manipulation techniques to improve image quality for specific applications. The evaluation of image quality is subjective for human perception but more straightforward for machine recognition, necessitating trial and error in selecting enhancement approaches.

Uploaded by

Hamza Mohamed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Digital signal processing

Lec.7
Dr. Abdallah gad
Communication & electronics
October high institute for engineering & technology
➢Image enhancement

Lecture outline ➢Spatial domain


➢Histogram
➢Histogram equalization
▪ Process an image so that the result will be
more suitable than the original image for a
specific application.
▪The suitableness is up to each application.
▪A method which is quite useful for
enhancing an image may not necessarily be
Principle Objective of
the best approach for enhancing another
Enhancement images

Before After
Spatial Domain : (image plane)
◦ Techniques are based on direct manipulation of
pixels in an image
Frequency Domain :
Two domains ◦ Techniques are based on modifying the Fourier
transform of an image
There are some enhancement techniques
based on various combinations of methods
from these two categories.
For human visual
◦ The visual evaluation of image quality is a highly
subjective process.
◦ It is hard to standardize the definition of a good
image.

Good images For machine perception


◦ The evaluation task is easier.
◦ A good image is one which gives the best machine
recognition results.
A certain amount of trial and error usually is
required before a particular image
enhancement approach is selected.
▪Procedures that operate directly on pixels.
g(x,y) = T[f(x,y)]
where
◦ f(x,y) is the input image
◦ g(x,y) is the processed image
◦ T is an operator on f defined over some
neighborhood of (x,y)
Spatial Domain
g(x,y) = T[f(x,y)]
T transforms the given image f(x,y)
into another image g(x,y)

The operator T can be defined over

❑ The set of pixels (x,y) of the image

Spatial Domain ❑ The set of ‘neighborhoods’ N(x,y) of each pixel

❑ - A set of images f1,f2,f3,…

f(x,y) g(x,y)
Operation on the set
of image-pixels 6 8 2 0 3 4 1 0
12 200 20 10 6 100 10 5

(Operator: Div. by 2)
6 8 (Operator: sum)

- Operation on the set of 12 200


‘neighborhoods
’ N(x,y) of each pixel 6 8 2 0 226
12 200 20 10
6 8 2 0
12 200 20 10

- Operation on a set of (Operator: sum) 11 13 3 0


images f1,f2,…
14 220 23 14

5 5 1 0
2 20 3 4
1 1  1 1
  1 1 
1 1 1 1 1
Linear Image smoothing h= 2 = 1 1  1*
techniques L    1 L L 
Box filters. Arithmetic mean   
1 1  1 1
LxL operator
(Averaging filter)
           
 8 5 8 5 8 5  1 1 1  6 7 6 7 6 7 
1 
 8 5 8 5 8 5    1 1 1 = 6 7 6 7 6 7 
9
 8 5 8 5 8 5  1 1 1  6 7 6 7 6 7 
           
Example

Noisy image 5x5 box filter


3 7 8

2 3 7 6

4 6 7

Nonlinear image smoothing


The median filter 2, 3, 3, 4, 6, 7, 7, 7, 8

Noisy image 5x5 median filtered


+ =

Original image noise Noisy image

Noise reduction

Low-pass Median
▪ Averaging pixels corrupted by noise cancels
out the noise.

▪ Low-pass can blur image. Fine detail


Conclusion smoothed by averaging

▪ Median can retain fine image detail that may


be smoothed by averaging. Fine detail passed
by filter
Neighborhood = 1x1 pixel
g depends on only the value of f at (x,y)
T = gray level (or intensity or mapping)
transformation function
Point Processing s = T(r)
Where
r = gray level of f(x,y)
s = gray level of g(x,y)
Point operations are zero-memory operations where
a given gray level x[0,L] is mapped to another
gray level y[0,L] according to a transformation
y = f (x)
y
Point Operations L
Overview

x
L
L=255: for grayscale images
y=x
y
L

Lazy Man Operation


x
L
No influence on visual quality at all
Y
L

y = L−x
x
0 L
Digital negative
Y

 x 0 xa
 yb
y =   ( x − a ) + ya a xb
  ( x − b) + y bxL
ya
 b
a b x
0 L
Contrast Stretching

a = 50, b = 150,  = 0.2,  = 2,  = 1, ya = 30, yb = 200


 0 0 xa

y =  ( x − a) a  x  b
  (b − a) b  x  L

0 a b L x
Clipping

a = 50, b = 150,  = 2
Y

y = c log10 (1 + x)

x
0 L
Range Compression

c=100
▪ mapping function f(x) that leads to
different enhancement results
▪ MATLAB function > imadjust
▪ The natural question is: How to select
an appropriate f(x) for an arbitrary
Summary of image?
Point Operation ▪ One systematic solution is based on the
histogram information of an image
▪ Histogram equalization and
specification
▪ Histogram is called normal or Gaussian

▪ Mean(noise)  = 0

▪ Standard deviation 

▪ i is the grey level.


Noise Histogram 2500

2000

1500

 1i−  
2

f (i ) =
1 1000
exp −   
2 2
 2     500

0 50 100 150 200 250


Histogram of a digital image with gray
levels in the range [0,L-1] is a discrete
function
h(rk) = nk
Histogram Processing Where
rk : the kth gray level
nk : the number of pixels in the image
having gray level rk
h(rk) : histogram of a digital image with
gray levels rk
No. of pixels
6
2 3 3 2 5

4 2 4 3 4

3
3 2 3 5
2
2 4 2 4
1
Gray level
4x4 image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9]
histogram
• dividing each of histogram at gray
level rk by the total number of pixels
in the image, n
p(rk) = nk / n
Normalized Histogram • For k = 0,1,…,L-1
• p(rk) gives an estimate of the
probability of occurrence of gray level
rk
• The sum of all components of a
normalized histogram is equal to 1
• Basic for numerous spatial domain
processing techniques
Histogram Processing • Used effectively for image
enhancement
• Information inherent in histograms also
is useful in image compression and
segmentation
Dark image
Components of histogram
are concentrated on the low
side of the gray scale.

Histogram Processing Bright image

Components of histogram
are concentrated on the high
side of the gray scale.
Low-contrast image
histogram is narrow and
centered toward the
middle of the gray scale

High-contrast image
histogram covers broad range of
the gray scale and the
distribution of pixels is not too
far from uniform, with very few
vertical lines being much higher
than the others
▪ As the low-contrast image’s histogram is narrow
and centered toward the middle of the gray
scale, if we distribute the histogram to a wider
range the quality of the image will be improved.
Histogram
Equalization ▪ We can do it by adjusting the probability density
function of the original histogram of the image
so that the probability spread equally
before after Histogram
equalization
before after Histogram
equalization

The quality is not


improved much
because the original
image already has a
broaden gray-level
scale
No. of pixels
6
2 3 3 2 5

4 2 4 3 4

3
3 2 3 5
2
2 4 2 4 1
Gray level
4x4 image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9]
histogram
Gray
0 1 2 3 4 5 6 7 8 9
Level(j)
No. of 0 0 6 5 4 1 0 0 0 0
pixels
k

n
j =0
j
0 0 6 11 15 16 16 16 16 16

6 11 15 16 16 16 16 16
k nj
s= 0 0 / / / / / / / /
j =0 n
16 16 16 16 16 16 16 16
3.3 6.1 8.4
sx9 0 0 9 9 9 9 9
3 6 8
No. of pixels
6
3 6 6 3 5
8 3 8 6 4

6 3 6 9 3

2
3 8 3 8
1

Output image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9] Gray level
Histogram equalization
Any questions?

You might also like