ECES 682 Digital Image Processing
Oleh Tretiak
ECE Department
Drexel University
Digtial Image Processing, Spring 200 1
6
About the Course
• Instructor: Oleh Tretiak, Bossone 607, 215 895 2214,
[email protected] Office hours: M 2-4, Tu 2-4, or by
appointment
• Textbook: Rafael C. Gonzalez and Richard E. Woods,
Digital Image Processing (Second Edition), Prentice Hall,
2002
• Web site: ece.drexel.edu/courses/ECE-S682
Site contains syllabus, assignments, solutions, exams, etc
We will also use webct (reachable through Drexel One or via
http://vle.dcollege.net/) for grade distribution
Also see textbook website, imageprocessingplace.com
Digtial Image Processing, Spring 2006 2
This Weeks Lecture
• Image Enhancement in the Spatial Domain
Gray level transformations
Histogram processing
Arithmetic/Logic operations
Spatial filtering
Smoothing
Sharpening
• Matlab image processing
Image datatypes
Image display
Color maps
Digtial Image Processing, Spring 2006 3
Intensity Scale
• What does ‘image intensity’ mean?
• In technical images, image intensity is reflects an
objective quantity
In astronomy, intensity reflects energy per sterradian
In transmission microscopy, intensity is a function of
amount of absorbing material on a ray passing through
an object
• In most images, image intensity is a feature that
allows us to infer the presence of objects in a
scene.
• For human vision, the image is reflected by
‘intensity’ and ‘color’. Most of the time, intensity
is much more important than color
Digtial Image Processing, Spring 2006 4
General Framework
• We compute a new image from an original image
• The most basic transformation is
g(x, y) = T(f(x, y))
where f(x, y) is the gray value of the input image
pixel, g(x, y) is the gray value of the input image
pixel at the same locations, and T(•) is a function
of a single (real) variable.
Digtial Image Processing, Spring 2006 5
Conventions: Digital Images
Left: Digital image. Note unusual (x, y)
convention.
Below: Examples of gray-value
transformations.
Digtial Image Processing, Spring 2006 6
Basic Gray Level Transformations
• Negative
• Log
• Power law
• Piecewise linear
• Bit slicing
Digtial Image Processing, Spring 2006 7
Histogram Processing
• The histogram
• Histogram processing
• Histogram equalization
Global
Local
• Histogram matching
• Local means, variances
Digtial Image Processing, Spring 2006 8
Arithmetic/Logical Operations
• Logical operations: x is a 4 bit number)
AND(x, 1111) = x
AND(x, 0000) = 0
OR(x, 1111) = 1111
OR(x, 1111) = x
• Subtraction: change detection
• Addition: Image averaging
Digtial Image Processing, Spring 2006 9
Spatial Filtering
a b
g(x, y) = ∑ ∑ w (s,t)f(x + s,y+ t)
s=−a t=−b
• How big should a, b be?
• What do we do at edges?
• What are we trying to accomplish?
Smoothing
Edge detection
• Alternate notation:
R = w1z1 + w 2z2 +K + w 9z9
Digtial Image Processing, Spring 2006 10
Smoothing Masks
• Smoothing masks are normally adjusted to
preserve average value (∑wi = 1)
Digtial Image Processing, Spring 2006 11
Order Statistics Filters
• R = median(z1, … zn)
• R = max (z1, … zn)
• R = min (z1, … zn)
Digtial Image Processing, Spring 2006 12
Sharpening Filters
• One-dimensional
df
g(x) = = f(x +1)− f(x)
dx
d2 f
h(x)= 2 = f(x +1)−2 f(x)+ f(x −1)
dx
• Two-dimensional (Laplacian)
2 2
∂ f ∂ f
Δf = ∇ 2 f = 2 + 2 =
∂x ∂y
= f (x + 1, y) + f (x, y + 1) + f (x − 1, y) + f (x, y − 1) − 4 f (x, y)
Digtial Image Processing, Spring 2006 13
Laplacian Masks
Digtial Image Processing, Spring 2006 14
Image Sharpening
(a) Orignal Image, (a) (b)
(b) Laplacian,
(c) Laplacian – scaled,
(d) Original plus
Laplacian
(c) (d)
Digtial Image Processing, Spring 2006 15
Unsharp Masking/High Boosting
g = f−cΔf high boost
g = b(f− f)+ f = bf−(b −1)f unsharp m ask
• Unsharp masking is a technique developed in film
chemical processing. An out-of-focus image was
subtracted from the original.
Digtial Image Processing, Spring 2006 16
First Derivative Enhancement
• There is no first derivative linear filter that is not
direction-dependent
• Magnitude of the gradient is independent of
direction
2 2
⎛ ∂f⎞ ⎛ ∂f⎞
g(x, y) = ⎜ ⎟ + ⎜ ⎟
⎝ dx⎠ ⎝ dy⎠
Digtial Image Processing, Spring 2006 17
Some Implementations
Upper masks: Roberts
filter.
Lower masks: Sobel
Filter
Digtial Image Processing, Spring 2006 18
Other Examples
• Unsharp masking with rank filters
• Product masks (image times Sobel)
• Combine with power-law transformation
• ...
Digtial Image Processing, Spring 2006 19
Mach Bands
Subjective Objective
(perceived) value
value (intensity
)
Digtial Image Processing, Spring 20
2006
The circles have the same objective
intensity.
Digtial Image Processing, Spring 21
2006
Digtial Image Processing, Spring 200 22
6
Digtial Image Processing, Spring 200 23
6