0% found this document useful (0 votes)
3 views18 pages

Week 9 - L1

The lecture focuses on sharpening spatial filters in image processing, detailing the use of first and second-order derivatives, specifically the Laplacian operator. It explains how these derivatives can enhance images by highlighting edges and discontinuities, and introduces the concept of unsharp masking and highboost filtering. The presentation also includes formulas for calculating derivatives and demonstrates the application of the Laplacian for image sharpening.

Uploaded by

dr.tamer.nassef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views18 pages

Week 9 - L1

The lecture focuses on sharpening spatial filters in image processing, detailing the use of first and second-order derivatives, specifically the Laplacian operator. It explains how these derivatives can enhance images by highlighting edges and discontinuities, and introduces the concept of unsharp masking and highboost filtering. The presentation also includes formulas for calculating derivatives and demonstrates the application of the Laplacian for image sharpening.

Uploaded by

dr.tamer.nassef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

CS389 – Image Processing

Week 9 - Lecture 1

Spatial Filtering (Pt. 2)

Dr. Mohamed Nagy Saad


Associate Professor
Faculty of Computer Science
October University for Modern Sciences and Arts
(MSA University)
Fall 2024
Spatial filters
Sharpening Spatial Filters

► Foundation

► Laplacian Operator

► Unsharp Masking and Highboost Filtering

► Using First-Order Derivatives for Nonlinear Image


Sharpening — The Gradient

3
Sharpening Spatial Filters: Foundation

► The first-order derivative of a one-dimensional


function f(x) is the difference

f
 f ( x  1)  f ( x)
x

► The second-order derivative of f(x) as the difference

2 f
2
 f ( x  1)  f ( x  1)  2 f ( x)
x

4
Spatial Differentiation

A B
1st Derivative

The formula for the 1st derivative of a function is as follows:


f
 f ( x  1)  f ( x)
x
it’s just the difference between subsequent values and measures the rate
of change of the function.
2nd Derivative

The formula for the 2nd derivative of a function is as follows:

2 f
2
 f ( x  1)  f ( x  1)  2 f ( x)
 x

Simply takes into account the values both before and after the current
value
1st derivative

2nd derivative
9
Sharpening Spatial Filters: Laplace Operator

The second-order isotropic derivative operator is the


Laplacian for a function (image) f(x,y)
2 2
2  f  f
 f  2  2
x y
2 f
2
 f ( x  1, y )  f ( x  1, y )  2 f ( x, y )
x
2 f
2
 f ( x, y  1)  f ( x, y  1)  2 f ( x, y )
y
2 f  f ( x  1, y )  f ( x  1, y )  f ( x, y  1)  f ( x, y  1)
- 4 f ( x, y )
10
Sharpening Spatial Filters: Laplace
Operator
• The second-order isotropic derivative operator is the Laplacian for a
function (image) f(x,y)
2 2
2  f  f
 f  2  2
x y
2 f 2 f
 f ( x  1, y )  f ( x  1, y )  2 f ( x, y ) 2
 f ( x, y  1)  f ( x, y  1)  2 f ( x, y )
x 2
y

2 f  f ( x  1, y )  f ( x  1, y )  f ( x, y  1)  f ( x, y  1)
- 4 f ( x, y )
Sharpening Spatial Filters: Laplace Operator

12
Sharpening Spatial Filters: Laplace Operator

Image sharpening in the way of using the Laplacian:

g ( x, y )  f ( x, y )  c  2 f ( x, y ) 
where,
f ( x, y ) is input image,
g ( x, y ) is sharpenend images,
c -1 if 2 f ( x, y ) corresponding to Fig. 3.37(a) or (b)
and c 1 if either of the other two filters is used.

13
Applying the
Laplacian to an
image, we get a
new image that
highlights edges
and other
discontinuities

14
Image scaling (Ch2)

(OR) y= ((x-min)/(max-min))*255

15
Laplacian Image Enhancement

- =

Original Laplacian Sharpened


Image Filtered Image Image

In the final sharpened image, edges and fine detail are


much more obvious.
Simplified Image Enhancement
(cont…)
This gives us a new filter which does the whole job for us in one step

0 -1 0

-1 5 -1

0 -1 0

You might also like