+ All Categories
Home > Documents > 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

Date post: 21-Dec-2015
Category:
View: 220 times
Download: 0 times
Share this document with a friend
25
1 Lecture 12 Lecture 12 Neighbourhood Neighbourhood Operations (2) Operations (2) TK3813 TK3813 DR MASRI AYOB
Transcript
Page 1: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

1

Lecture 12Lecture 12

Neighbourhood Neighbourhood Operations (2)Operations (2)

TK3813TK3813

DR MASRI AYOB

Page 2: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

2

OutlinesOutlines

Edge detection.Rank filtering.

Page 3: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

3

Edge DetectionEdge Detection

One of the major applications for convolution is in edge detection.

Page 4: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

4

Edge DetectionEdge Detection

Noise and other uninteresting image feature can also generate noise.Given a noisy image, edge detection techniques aim to locate the edge pixels most likely to have been generated by scene elements, rather than by noise.Typical 3 steps are:

Noise reduction – try to suppress much noise as possible, without smoothing away the meaningful edges.Edge enhancement – apply some kind of filter (e.g. high pass filter) that responds strongly at edges and weakly elsewhere.Edge localisation – decide which of the local maxima output by the filter are meaningful edges and which are caused by noise.

Page 5: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

5

A Simple Edge DetectorA Simple Edge Detector

The simplest detector performs minimal noise smoothing and fairly crude localisation.There are based on the estimation of grey level gradient at a pixel.The gradient can be approximated in the x and y directions by:

gx(x,y)≈ f(x+1,y) – f(x-1,y);

gy(x,y)≈ f(x,y+1) – f(x,y-1);

(7.14)

(7.15)

Page 6: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

6

A Simple Edge DetectorA Simple Edge Detector

These are known as the Prewitt kernels.

Page 7: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

7

Sobel KernelsSobel Kernels

A similar pair of kernels (Prewitt kernels) are Sobel kernels.These give more weight to on-axis pixels.

101

202

101

xh

121

000

121

yh

Page 8: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

8

Sobel KernelsSobel Kernels

Page 9: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

9

Sobel KernelsSobel Kernels

Page 10: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

10

Sobel KernelsSobel Kernels

Page 11: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

11

LocalisationLocalisation

In localisation step, we must identify the meaningful edges from gradient magnitude data.Typical assumption is that meaningful edges give rise to the strongest gradients, so a simple approach is to threshold the gradient magnitudes computed using equation 7.18 or 7.20.The threshold produces an ‘edge gap’- a binary image in which pixels set to 1 represent meaningful edges.

Page 12: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

12

Localisation exampleLocalisation example

Page 13: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

13

Sobel Example hSobel Example hyy

0 0 50 50 50 100 100 100 200 200

0 0 50 50 50 100 100 100 200 200

0 0 50 50 50 100 100 100 200 200

50 50 100 100 100 150 150 150 250 250

50 50 100 100 100 150 150 150 250 250

50 50 100 100 100 150 150 150 250 250

2

0

-2

00

11

-1-1

00000000

200200200200200200200200

200200200200200200200200

00000000

0(-1)+0(-2)+50(-1)+50(0)+100(1)+50(2)+

50(1)+0(0)+0(0)

Page 14: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

14

Sobel Example hSobel Example hxx

0 0 50 50 50 100 100 100 200 200

0 0 50 50 50 100 100 100 200 200

0 0 50 50 50 100 100 100 200 200

50 50 100 100 100 150 150 150 250 250

50 50 100 100 100 150 150 150 250 250

50 50 100 100 100 150 150 150 250 250

0

0

0

2-2

1-1

1-1

40040002002000200200

40040002002000200200

40040002002000200200

40040002002000200200

Page 15: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

Upper Left: Original ImageUpper Middle: Prewitt Filtered – XUpper Right: Prewitt Filtered - YLeft: Combined

Upper Left: Original ImageUpper Middle: Prewitt Filtered – XUpper Right: Prewitt Filtered - YLeft: Combined

Page 16: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

Upper Left: Original ImageUpper Middle: Sobel Filtered - XUpper Right: Sobel Filtered - YLeft: Combined

Upper Left: Original ImageUpper Middle: Sobel Filtered - XUpper Right: Sobel Filtered - YLeft: Combined

Page 17: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

17

Rank FiltersRank Filters

Rank filtering transforms images based on the rank of a pixels value within a local neighborhood.Sort all of the pixels in the local region by intensity value (this yields a “rank” for every pixel).

Median: The value of the output pixel is the value of the “median” pixel.Minimum: The output pixel is the lowest-ranked inputMaximum: The output pixel is the highest-ranked inputRange: The output is the difference between high and low.

Advantage: Not being a kernel-based, so there is no problem with filtering over a small neighbourhood at the corners and sides of the image.

Page 18: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

18

Page 19: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

19

Rank FilteringRank Filtering

Page 20: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

20

Median Filter ExampleMedian Filter Example

Original Image (impulse noise) Median Filtered Image (3x3)

Median Filters are great at preserving edges and eliminating impulse noise.

Page 21: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

21

Min/Max Filter ExampleMin/Max Filter Example

Page 22: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

22

Median FiltersMedian Filters

replaces the value of a pixel by the median of the gray levels in the neighborhood of that pixel (the original value of the pixel is included in the computation of the median)quite popular because for certain types of random noise (impulse noise impulse noise salt and pepper noise salt and pepper noise) , they provide provide excellent noise-reduction capabilitiesexcellent noise-reduction capabilities, with considering less less blurring than linear smoothing filters of similar size.blurring than linear smoothing filters of similar size.

Page 23: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

23

Median FiltersMedian Filters

forces the points with distinct gray levels to be more like their neighbors.isolated clusters of pixels that are light or dark with respect to their neighbors, and whose area is less than n2/2 (one-half the filter area), are eliminated by an n x n median filter.eliminated = forced to have the value equal the median intensity of the neighbors.larger clusters are affected considerably less.

Page 24: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

24

Example : Median FiltersExample : Median Filters

Page 25: 1 Lecture 12 Neighbourhood Operations (2) TK3813 DR MASRI AYOB.

25

Thank youThank you

Q&A Q&A


Recommended