Overview
• Assignment 1 Contextualisa1on
• Spa1al Filters – Sharpening Spa1al Filters • Morphological Image Processing
Last Lecture
Today- Sharpening Spa8al Filters
Sharpening Spa8al Filters
Ø Term sharpening is referred to techniques suited for enhancing intensity transi8ons
Ø In images, borders between objects are perceived because of intensity change: the crisper the intensity transi1ons, the sharper the image is perceived
Ø Intensity transi8on between adjacent pixels is related to deriva8ves of image in that posi1on
Therefore majority of sharpening filters involve the use of edge detectors
1st and 2nd Deriva8ves Deriva8ves reflect how grey level changes
Formula for the 1st deriva1ve of a func1on: ∂f =f(x+1)−f(x)
Gary-level values
∂x
→ difference between subsequent values
1st deriva1ve
and measures rate of change of func1on
Formula for the 2nd deriva1ve of a func1on:
∂2 f = f(x+1)+ f(x−1)−2f(x) 2nd
∂2 x deriva1ve
→ takes into account the values both before and aIer the current value
Deriva8ves
1st Deriva8ve
2nd Deriva8ve
Constant grey level
Zero
Zero
Onset and end of discon1nu es
Non-zero
Non-zero
Along grey-level ramps
Non-zero
Zero
∂f =f(x+1)−f(x) ∂x
∂2 f = f(x+1)+ f(x−1)−2f(x) ∂2x
1st Order Deriva8ve
1st Order Deriva8ve
1D central difference
2D 1st Order Deriva8ve • Weight 2; smoothing by emphasizing centre
1D central difference
2D
2D 1st Order Deriva8ve • Weight 2; smoothing by emphasizing centre
output pixel [1,1] = ([0,0] × -1) + ([0,1] × 0) + ([0,2] × 1) + ([1,0] × -2) + ([1,1] × 0) + ([1,2] × 2) + ([2,0] × -1) + ([2,1] × 0) + ([2,2] × 1)
Sobel Filter
• Weight 2; smoothing by emphasizing centre
Gx: ver1cal
Sobel Filter
• Weight 2; smoothing by emphasizing centre
• 2 different kernels for ver1cal and horizontal gradient
• Detects horizontal and ver1cal edges
Gx: ver1cal Gy: horizontal
Sobel Filter
• Weight 2; smoothing by emphasizing centre
• 2 different kernels for ver1cal and horizontal gradient
• Detects horizontal and ver1cal edges
• Reduces visibility where intensity changes slowly, highligh1ng edges
Gx: ver1cal Gy: horizontal combina1on
Sharpening Effect
Original
Original + Sober
1st Order Gradient
2nd Order Gradient Filter
Laplacian Operator
Laplacian Operator
Laplacian Operator
Unsharp Masking
Basic idea: subtract blurred version of an image from original image to generate the edges, then add the edge image to the original image.
fs(x,y)= f(x,y)− f(x,y) Unsharp Mask Original Blurred
22
Unsharp Masking
• Smoothing affects transi1on regions where grey values vary
• Subtrac1on isolates these edge regions
• Adding edges back onto image causes edges to appear more pronounced, giving effect of
image sharpening
Unsharp Masking
Syllabus
Fundamentals
Introduc8on Image Acquisi8on Enhancement-1 Enhancement-2
Image Analysis
Module Introduc1on, Origins of Image Processing (Imaging), Imaging Modali1es Image Forma1on, Pixels, Spa1al & Intensity Resolu1ons, Interpola1on
Grey Level Transforma1ons: Contrast Stretching, Histogram Processing
Spa1al Filtering: Smoothing (Averaging, Median), Sharpening (Sobel & Laplacian)
Morphological Image Processing Image Segmenta8on
Applica8ons
Colour Image Processing
Image Compression Representa8on and Descrip8on Real-world Applica8ons
Mathema8cal Morphology
• Techniques for pre- or post-processing: • Noise filtering,
• Filling in small holes in foreground,
• extracting connected components,
• Eliminating small protrusions from their boundaries, etc
• Representation and description of region shape: • boundaries,
• skeletons, etc
Binary Images
Example
• Counting coins is difficult because they touch each other! • Solution: Binarization and Erosion separates them!
Example
Recommended Reading
“Digital Image Processing”, R.C. Gonzalez and R.E. Woods, 3rd edi1on, Pearson Pren1ce Hall, 2008
Chapter 3 Chapter 9