Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮...

156
Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅傅傅 & 傅傅傅 [email protected] 傅傅傅傅 : 傅傅傅 傅傅

Transcript of Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮...

Page 1: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Computer and Robot Vision I

Chapter 7Conditioning and Labeling

Presented by: 傅楸善 & 江祖榮 [email protected]指導教授 : 傅楸善 博士

Page 2: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Recognition Methodology

Conditioning Labeling Grouping Extracting Matching

2/118

Page 3: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

dDC & CV Lab.CSIE NTU

3/118

7-1 Introduction

Conditioning:

noise removal, background normalization,…

Labeling:

thresholding, edge detection, corner finding,…

Page 4: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

4/118

7-2 Noise Cleaning

noise cleaning: • uses neighborhood spatial coherence• uses neighborhood pixel value homogeneity

Page 5: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

7-2 Filter

5/118

f(x-1,y-1) f(x,y-1) f(x+1,y-1)

f(x-1,y) f(x,y) f(x+1,y)

f(x-1,y+1) f(x,y+1) f(x+1,y+1)

W(-1,-1) W(0,-1) W(1,-1)

W(-1,0) W(0,0) W(1,0)

W(-1,1) W(0,1) W(1,1)

Y axis

X axis

image Filter

Page 6: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

6/118

box filter: computes equally weighted averagebox filter: separablebox filter: recursive implementation with “two+”, “two-”, “one/” per pixel

7.2 Noise Cleaning

Page 7: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

filter: separable

7/118

9 multiplications 3 multiplications

* = *

3 multiplications

* = *

9 multiplications 3 multiplications 3 multiplications

Page 8: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

8/118

filter: separable

Page 9: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

box filter: recursive implementation

9/118

Page 10: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

10/118

7.2 Noise Cleaning

Page 11: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

11/118

=* = *

7.2 Noise Cleaning

Page 12: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

12/118

=* = *

7.2 Noise Cleaning

Page 13: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

13/118

7.2 Noise Cleaning

Gaussian filter: linear smoother

)(2

12

22

),( cr

kecrw

for all where,),( Wcr

Wcr

cr

e

k

),(

)(2

12

22

1

linear noise-cleaning filters: defocusing images, edges blurred

size of W: two or three from center

weight matrix:

Page 14: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Take a Break 0

14/118

Page 15: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

15/118

A Statistical Framework for Noise Removal

Idealization assumption:

if there were no noise, the pixel values in each image neighborhood would be the same constant

Page 16: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

16/118

Outlier or Peak Noise

outlier: peak noise: pixel value replaced by random noise value

neighborhood size: larger than noise, smaller than preserved detail

center-deleted: neighborhood pixel values in neighborhood except center

Page 17: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Outlier or Peak Noise

X1 X2 X3

X4 y X5

X6 X7 X8

17/118

Decide whether y is an outlier or not

:y center pixel value

N

nnx

N 1

1

:,...,1 Nxx center-deleted neighborhood

Page 18: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

18/118

Outlier or Peak Noise

:,...,1 Nxx

:y

:

N

nnx

N 1

1

center-deleted neighborhood

center pixel value

mean of center-deleted neighborhood

2

1

)ˆ-(

N

nnxminimizes

Page 19: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

19/118

Outlier or Peak Noise

:_ removaloutlierzˆif | |

_ ˆ otherwise{

y y

outlier removalz

output value of neighborhood outlier removal

:y

::

not an outlier value if reasonably close toy use mean value when outlier

threshold for outlier value

too small: edges blurred

too large: noise cleaning will not be good

Page 20: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

20/118

Outlier or Peak Noise

:ˆ 2

N

nnx

N 1

22 )ˆ(1

ˆif | |

ˆ

ˆ otherwise{

yy

contrast dependent outlier removalz

center-deleted neighborhood variance

: use neighborhood mean if pixel value significantly far from mean

Page 21: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

7-2-3 Outlier or Peak Noise

21/118

Page 22: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

22/118

7-2-3 Outlier or Peak Noise

smooth replacement:

instead of complete replacement or not at all

:treplacemensmoothz convex combination of input and mean

:K weighting parameter

yK

yK

Ky

y

z treplacemensmooth

|

ˆ

ˆ|

ˆ|

ˆ

ˆ|

ˆ|

use neighborhood mean

use input pixel value

:0K

:K y

Page 23: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

23/118

7-2-4 K-Nearest Neighbor

K-nearest neighbor:

average equally weighted average of k-nearest

neighbors

Page 24: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

24/118

7-2-5 Gradient Inverse weighted

gradient inverse weighted:

reduces sum-of-squares error within regions

' '

' '

1( , ) ( , )' ' 2

otherwise1

max{ , | ( , ) ( , )|}2

( , , , ) {r c r c

k

f r c f r c

w r c r c

Page 25: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

25/118

Take a Break 1

Page 26: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

26/118

7-2-6 Order Statistic Neighborhood Operators

order statistic:

linear combination of neighborhood sorted values

neighborhood pixel values

sorted neighborhood values from smallest to

largest

:,,1 Nxx

:,..., )()1( Nxx

Page 27: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

7-2-6 Order Statistic Neighborhood Operators

27/118

:,, 91 xx

:,..., )9()1( xx

x1 x2 x3 x4 x5 x6 x7 x8 x9

16 128 109 66 4 6 96 84 53

x(1) x(2) x(3) x(4) x(5) x(6) x(7) x(8) x(9)

4 6 16 53 66 84 96 109 128

Page 28: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

28/118

7-2-6 Order Statistic Neighborhood Operators

Median Operator

median: most common order statistic operator

median root: fixed-point result of a median filter

median roots: comprise only constant-valued neighborhoods, sloped edges

Page 29: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

29/118

Original Image

Median Root Image

Page 30: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

30/118

7-2-6 Order Statistic Neighborhood Operators

median: effective for impulsive noise (salt and pepper)

median: distorts or loses fine detail such as

thin lines

)2

1(

Nmedian xz

Page 31: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

31/118

7-2-6 Order Statistic Neighborhood Operators

inter-quartile distance:Q

)4

2()

4

23(

NN xxQ

otherwise

||if

zy

z

yz Q

median

mediandianrunning me

Running-median Operator

Page 32: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

32/118

7-2-6 Order Statistic Neighborhood Operators

Trimmed-Mean Operator

trimmed-mean: first k and last k order statistics not used

trimmed-mean: equal weighted average of central N-2k order statistics

kN

knnmeantrimmed x

kNz

1)(2

1

Page 33: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

33/118

7-2-6 Order Statistic Neighborhood Operators

Midrange operator

midrange: noise distribution with light and smooth tails

][2

1)()1( Nmidrange xxz

Page 34: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

34/118

7-2-7 Hysteresis Smoothing

hysteresis smoothing:

removes minor fluctuations, preserves major transients

hysteresis smoothing: finite state machine with two states: UP, DOWN

applied row-by-row and then column-by-column

Page 35: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

35/118

7-2-7 Hysteresis Smoothing

if state DOWN and next one larger, if next local maximum does not exceed threshold then stays current value i.e. small peak cuts flat

otherwise state changes from DOWN to UP and preserves major transients

Page 36: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

36/118

7-2-7 Hysteresis Smoothing

if state UP and next one smaller, if next local minimum does not exceed threshold then stays current value i.e. small valley filled flat

otherwise state changes from UP to DOWN and preserves major transients

Page 37: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

37/118

7-2-7 Hysteresis Smoothing

Page 38: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Take a Break 2

38/118

Page 39: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

39/118

Sigma Filter

sigma filter: average only with values within

two-sigma interval

Mn

nxM

y#

}22|{ yxynMwhere n

Page 40: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

40/118

Selected-Neighborhood Averaging

selected-neighborhood averaging:

assumes pixel a part of homogeneous region

(not required to be squared, others can be diagonal, rectangle, three pixels vertical and horizontal neighborhood)

noise-filtered value:

mean value from lowest variance neighborhood

Page 41: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

41/118

Minimum Mean Square Noise Smoothing

minimum mean square noise smoothing:

additive or multiplicative noise

each pixel in true image:

regarded as a random variable

Page 42: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

42/118

Minimum Mean Square Noise Smoothing

YZ

ZY

])[(

error squaremean minimize to and choose :Goal

22 YYE

variables:,

valuepixelestimated:

noise:

valuepixel:

valuepixelobserved:

Y

Y

Z

Page 43: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

43/118

Noise-Removal Techniques-Experiments

Page 44: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

44/118

Noise-Removal Techniques-Experiments

uniform Gaussian salt and pepper varying noise

(the noise energy varies across the image)

types of noise

Page 45: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

45/118

Noise-Removal Techniques-Experiments

salt and pepper

:maxmini

gray value at given pixel in output image

:p:u:),( crI:),( crO

),( cr

{if),(

otherwise)( minmaxmin

),(pucrI

uiiicrO

minimum/ maximum gray value for noise pixels

fraction of image to be corrupted with noise

uniform random variable in [0,1]

gray value at given pixel in input image

),( cr

Page 46: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

46/118

Generate salt-and-pepper noise

Noise-Removal Techniques-Experiments

I(nim, i , j) = 0 if uniform(0,1) < 0.05I(nim, i , j) = 255 if uniform(0,1) > 1- 0.05I(nim, i , j) = I(im, i ,j) otherwiseuniform(0,1) : random variable uniformly distributed over [0,1]

Page 47: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

47/118

Noise-Removal Techniques-Experiments

S/N ratio (signal to noise ratio):

VS: image gray level variance VN: noise variance

𝑆𝑁𝑅=20∗ log10√𝑉𝑆√𝑉𝑁

Page 48: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Noise-Removal Techniques-Experiments

48/118

𝑆𝑁𝑅=20∗ log10√𝑉𝑆√𝑉𝑁

𝑉𝑆=∑∀ 𝑛

( (𝐼 (𝑖 , 𝑗 )−𝜇𝑠 ))2

‖𝑛‖

𝜇𝑠=∑∀𝑛

𝐼 (𝑖 , 𝑗 )

‖𝑛‖

𝜇𝑁𝑜𝑖𝑠𝑒=∑∀𝑛

𝐼𝑁𝑜𝑖𝑠𝑒 (𝑖 , 𝑗 )− 𝐼 (𝑖 , 𝑗)

‖𝑛‖

𝑉𝑁=∑∀𝑛

( ( 𝐼𝑁𝑜𝑖𝑠𝑒 (𝑖 , 𝑗 )− 𝐼 (𝑖 , 𝑗)−𝜇𝑁𝑜𝑖𝑠𝑒 ) )2

‖𝑛‖

Page 49: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

49/118

Take a Break 3

Page 50: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

50/118

Noise-Removal Techniques-Experiments

uniform noise

variessalt and pepper noise

Gaussian noise

Page 51: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussiannoise

Original

Page 52: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

default peak noise removal

2.0,99;{|ˆ|

ˆ_

yify

otherwiseremovaloutlierz

Page 53: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussian

outlier removal

Uniform

S & P Gaussian

Page 54: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

contrast-dependent noise removal

1.0,99;{|

ˆ

ˆ|

ˆ

yify

otherwiseremovaloutlierdependentcontrastz

Page 55: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussian

contrast-dependent outlier removal

Uniform

S & P Gaussian

Page 56: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

2.0,4.0,99;ˆ|

ˆˆ

|

ˆ|

ˆ|

KK

y

y

yK

yK

z treplacemensmooth

smooth replacement

Page 57: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussian

contrast-dependent outlier removal with smooth

replacement

Uniform

S & P Gaussian

Page 58: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

hysteresis smoothing

Page 59: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussian

hysteresis smoothing

Uniform

S & P Gaussian

Page 60: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

inter-quartile mean filter

5.0,77;{||

Q

zyify

otherwisez

median

median

z

)4

2()

4

23(

NN xxQ

Page 61: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussian

inter-quartile mean filter

Uniform

S & P Gaussian

Page 62: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

neighborhood midrange filter

77;][2

1)()1( Nmidrange xxz

Page 63: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussian

neighborhood midrange filter

Uniform

S & P Gaussian

Page 64: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

neighborhood running-mean filter

)77,( filterbox

Page 65: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussian

neighborhood running-mean filter

Uniform

S & P Gaussian

Page 66: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

sigma filter

Mn

nxM

y#

2.0,99;}22|{ yxynMwhere n

Page 67: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussian

sigma filter

Uniform

S & P Gaussian

Page 68: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

neighborhood weighted median filter

(7X7)

)77(

1111111

1222221

1233321

1234321

1233321

1222221

1111111

Page 69: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Uniform

S & P Gaussian

neighborhood weighted median filter

Uniform

S & P Gaussian

Page 70: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

70/118

Uniform Gaussian_30 S & P 0.1Contrast-dependent outlier removal 26.408 25.758 20.477Smooth replacement 29.344 26.821 26.792Outlier removal 26.407 25.768 20.406Hysteresis 18.278 13.804 1.9040Interquartile mean filter 29.193 24.517 35.720Midrange filter 22.171 19.629 -0.1658Running-mean filter 29.522 28.278 21.194Sigma filter 34.717 18.831 -2.9151Weighted-median filter 33.964 30.720 36.033

Noise-Removal Techniques-Experiments with Lena

Page 71: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

71/118

7.3 Sharpening

unsharp masking: subtract fraction of

neighborhood mean and scale result

N

nn meanodneighborhoisx

Nwhere

1

1

3

2,

5

1,:

:

:

betweenreasonablefractionk

ntconstascalings

valuepixelcentery

possible to replace neighborhood mean with neighborhood median

]ˆ[ kyszsharpened

Page 72: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

72/118

Extremum Sharpening

extremum-sharpening: output closer of

neighborhood maximum or minimum

{),(),(

max

min

maxminmin

max

}),(|),(max{

}),(|),(min{

crfzzcrfifz

otherwisezsharpenedextremumz

Wcrccrrfz

Wcrccrrfz

Page 73: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

73/118

Take a Break

Page 74: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

74/118

7.4 Edge Detection

digital edge: boundary where brightness

values are significantly different

edge: brightness value appears to jump

Page 75: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

75/118

Page 76: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

76/118

Page 77: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

77/118

Page 78: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

78/118

Gradient Edge Detectors

gradient magnitude: where are values from first, second masks

respectively

22

21 rr

Roberts operators: two 2X2 masks to calculate gradient

21, rr

Page 79: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

79/118

Roberts operators with threshold = 30

Page 80: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

80/118

Gradient Edge Detectors

22

21 ppg

21, pp)arctan( 21 pp

Prewitt edge detector: two 3X3 masks in row column direction

gradient magnitude: gradient direction: clockwise w.r.t. column axis where are values from first, second masks respectively

P1

P2

)arctan( 21 pp

Page 81: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

81/118

Gradient Edge Detectors

)()1()(' xfxfxf

)1()()1(' xfxfxf

)1()1(

)1()()()1()1()( ''

xfxf

xfxfxfxfxfxf

Page 82: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

82/118

Prewitt edge detector with threshold = 30

Page 83: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

83/118

Gradient Edge Detectors

Sobel edge detector: two 3X3 masks in row column direction

gradient magnitude: gradient direction: clockwise w.r.t. column axis where are values from first, second masks respectively

22

21 ssg

)arctan( 21 ss21, ss

Page 84: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

84/118

Gradient Edge Detectors

Sobel edge detector: 2X2 smoothing followed by 2X2 gradient

11

11

11

11

121

000

121

11

11

11

11

101

202

101

Page 85: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

85/118

Gradient Edge Detectors

11

11

11

11

101

202

101

000

011

011

11

11

11

11

000

101

101

000

1111

1111

11

11

11

11

011

112

101

01010

11011

101

11

11

11

11

101

202

101

10111

11112

101

11

11

11

11

Page 86: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

86/118

Sobel edge detector with threshold = 30

Page 87: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

87/118

Gradient Edge Detectors

Frei and Chen edge detector: two in a set of nine orthogonal

masks (3X3)

gradient magnitude: gradient direction: clockwise w.r.t. column axis where are values from first, second masks respectively

22

21 ffg

)arctan( 21 ff21, ff

Page 88: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Gradient Edge Detectors orthogonal

88/118

1

0

1-

2

0

2-

1

0

1-

1 2 1 0 0 0 1- 2- 1-

0 1 1- 1 - 1

1 1 (-1) 1 1(-1) (-1) (-1)

Page 89: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

89/118

Gradient Edge Detectors

Frei and Chen edge detector: nine orthogonal masks (3X3)

Page 90: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

90/118

Frei and Chen edge detector with threshold = 30

Page 91: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

91/118

Gradient Edge Detectors

nnn

kg7,...,0,

max

Kirsch: set of eight compass template edge masks

gradient magnitude:

gradient direction:nkmaxarg45

Page 92: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

92/118

Kirsch edge detector with threshold = 30

Page 93: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

93/118

Gradient Edge Detectors

Robinson: compass template mask set with only

2,1,0

done by only four masks since negation of each mask is also a mask gradient magnitude and direction same as Kirsch operator

nnn

rg7,...,0,

max

nrmaxarg45

Page 94: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

94/118

Robinson edge detector with threshold = 30

Page 95: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

95/118

Gradient Edge Detectors

Nevatia and Babu: set of six 5X5 compass template masks

參考軸: y 軸

Page 96: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

96/118

Nevatia and Babu with threshold = 30

Page 97: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

97/118

Gradient Edge Detectors

edge contour direction:

along edge, right side bright, left side dark

edge contour direction:

more than gradient direction90

90

contour direction

gradient direction

Page 98: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Robinson and Kirsch compass operator: detect lineal edges

Page 99: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

90

90 9090

90

9090 90

Page 100: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

100/118

Gradient Edge Detectors

four important properties an edge operator might have

accuracy in estimating gradient magnitude accuracy in estimating gradient direction accuracy in estimating step edge contrast accuracy in estimating step edge direction

gradient direction: used for edge organization, selection, linking

Page 101: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

101/118

7.4.1 Gradient Edge Detectors

參考軸: X 軸 , 順時針方向

contour

Page 102: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

102/118

Take a Break

Page 103: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

103/118

Zero-Crossing Edge Detectors

first derivative maximum: exactly where second derivative zero crossing

first derivative maximum: exactly where second derivative zero crossing

Page 104: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

104/118

Zero-Crossing Edge Detectors

2

2

2

2

2

2

2

22 )(

c

I

r

II

crI

),( crILaplacian of a function

Page 105: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

105/118

Zero-Crossing Edge Detectors

two common 3X3 masks to calculate digital Laplacian

First type Second type

Page 106: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

106/118

Zero-Crossing Edge Detectors

the 3X3 neighborhood values of an image function

Page 107: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

107/118

Zero-Crossing Edge Detectors

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321),( ckrckrkckrkkcrI

( r, c)

654

321

kkk

kkk

631 kkk

654

321

kkk

kkk

1k

421 kkk

421 kkk

654

321

kkk

kkk

631 kkk

654

321

kkk

kkk

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321 )1()1)(1()1()1()1()1,1( kkkkkkI

654

321

kkk

kkk

631 kkk

654

321

kkk

kkk

1k

421 kkk

421 kkk

654

321

kkk

kkk

631 kkk

654

321

kkk

kkk

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321 )0()0)(1()1()0()1()0,1( kkkkkkI

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321 )1()1)(1()1()1()1()1,1( kkkkkkI

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321 )1()1)(0()0()1()0()1,0( kkkkkkI

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321 )0()0)(0()0()0()0()0,0( kkkkkkI

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321 )1()1)(0()0()1()0()1,0( kkkkkkI

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321 )1()1)(1()1()1()1()1,1( kkkkkkI

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321 )0()0)(1()1()0()1()0,1( kkkkkkI

(-1,-1) (-1, 0) (-1, 1)

( 0,-1) ( 0, 0) ( 0, 1)

( 1,-1) ( 1, 0) ( 1, 1)

265

24321 )1()1)(1()1()1()1()1,1( kkkkkkI

I(r,c) = k1+k2r+k3c+k4r2+k5rc+k6c2

Page 108: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

108/118

Zero-Crossing Edge Detectors

2

2

2

2

2

2

2

22 )(

c

I

r

II

crI

265

24321),( ckrckrkckrkkcrI

542 2 ckrkkr

I

42

2

2kr

I

653 2ckrkkc

I

62

2

2kc

I

642

2

2

2

2

2

2

22 22)( kk

c

I

r

II

crI

Page 109: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

109/118

Zero-Crossing Edge Detectors

)(k)-kk(k)k-k(k)kk(k)k-k(k 1421421631631 41111

64 22 kk

] 111

181

111 [3

1

654321654321421

6311631

654321421654321

)kkkkk(k)k-kk-kk(k)kk(k

)kk(k)(k)-k-k(k

)k-kkk-k(k)k-k(k)kkk-k-k(k

6464 22 66 3

1kkkk

Page 110: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

110/118

Zero-Crossing Edge Detectors

3X3 mask computing

a digital Laplacian 12),44( babae

Page 111: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

111/118

Zero-Crossing Edge Detectors

)24(

)0(

)24(

)0(

)0(

)44(

6

5

4

3

2

1

bak

k

bak

k

k

ebak

64 22 kk {)44(

12

ba-e

ba

Page 112: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

112/118

Zero-Crossing Edge Detectors

3X3 mask for computing minimum-variance digital Laplacian

First type

Page 113: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

)(2

1

2

2

22

2

1:

cr

eGaussian

2

2

2

2

:c

I

r

ILaplacian

2

2

2

2

),(c

G

r

GcrLOG

)1(2

1

)(2

1

)(2

1

))2

1(()(

2

2)(2

1

4

)(2

1

2

2)(2

1

4

)(2

1

22

)(2

1

22

2

2

22

2

22

2

22

2

22

2

22

re

er

e

er

r

errr

G

rr

G

cr

crcr

cr

cr

)1(2

12

2)(2

1

42

22

22

c

ec

Gcr

)1(2

12

2)(2

1

42

22

22

r

er

Gcr

)(2

1

2

22

4

2

2)(2

1

42

2)(2

1

4

2

22

2

22

2

22

)2(2

1

)1(2

1)1(

2

1),(

cr

crcr

ecr

ce

recrLOG

Page 114: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

Laplacian of the Gaussian kernel

-2 -9 -23 -1 103 178 103 -1 -23 -9 -2

Page 115: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

115/118

Zero-Crossing Edge Detectors

Page 116: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

116/118

Page 117: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

117/118

Page 118: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.
Page 119: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

119/118

Zero-Crossing Edge Detectors

Page 120: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

120/118

Zero-Crossing Edge Detectors

A pixel is declared to have a zero crossing if it is less than –t and one of its eight neighbors is greater than t or if it is greater than t and one of its eight neighbors is less than –t for some fixed threshold t

Page 121: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

121/118

Zero-Crossing Edge Detectors

t

-t

Page 122: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

122/118

Take a Break

Page 123: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

123/118

Edge Operator Performance

edge detector performance characteristics:

misdetection/false-alarm rate

Page 124: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

124/118

Page 125: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

125/118

Page 126: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

126/118

7.5 Line Detection

A line segment on an image can be characterized as an elongated rectangular region having a homogeneous gray level bounded on both its longer sides by homogeneous regions of a different gray level

Page 127: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

127/118

7.5 Line Detection

one-pixel-wide lines can be detected by compass line detectors

Page 128: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

detecting lines of one to three pixels in width

Page 129: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

129/118

semilinear line detector

by step edge on

either side of the line

𝑠=max {𝑎𝑖+𝑏𝑖|𝑎𝑖>𝑡∧𝑏𝑖>𝑡 }

Page 130: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

130/118

Project due Nov. 26

Write the following programs

1. Generate additive white Gaussian noise

2. Generate salt-and-pepper noise

3. Run box filter (3X3, 5X5) on all noisy images

4. Run median filter (3X3, 5X5) on all noisy images

5. Run opening followed by closing or closing followed by opening

Page 131: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

131/118

Project due Nov. 26

box filter on white Gaussian noise with amplitude = 10Gaussian noise After 5x5 box filterAfter 3x3 box filter

Page 132: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

132/118

Project due Nov. 26

box filter on salt-and-pepper noise with threshold = 0.05salt-and-pepper noise After 5x5 box filterAfter 3x3 box filter

Page 133: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

133/118

Project due Nov. 26

median filter on white Gaussian noise with amplitude = 10Gaussian noise After 5x5 median filterAfter 3x3 median filter

Page 134: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

134/118

Project due Nov. 26

median filter on salt-and-pepper noise with threshold = 0.05salt-and-pepper noise After 5x5 median filterAfter 3x3 median filter

Page 135: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

135/118

Project due Nov. 26

Generate additive white Gaussian noise

:)1,0(

)1,0(),,(),,(

N

NamplitudejiimIjinimI Gaussian random variable with zero mean and st. dev. 1

amplitude determines signal-to-noise ratio, try 10, 30

Page 136: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

136/118

Project due Nov. 26

Generate additive white Gaussian noise with amplitude = 10

Page 137: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

137/118

Project due Nov. 26

Generate additive white Gaussian noise with amplitude = 30

Page 138: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

138/118

Project due Nov. 26

Generate salt-and-pepper noise

I( noiseImage,i ,j) = , if 𝑢𝑛𝑖𝑓𝑜𝑟𝑚 (0,1 )<0.05, if 𝑢𝑛𝑖𝑓𝑜𝑟𝑚 (0,1 )>1−0.05

, otherwise

1.0and05.0bothtry

]1,0[overddistributeuniformlyriablevarandom:)1,0(uniform

Page 139: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

139/118

Project due Nov. 26

Generate salt-and-pepper noise with threshold = 0.05

Page 140: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

140/118

Project due Nov. 26 Generate salt-and-pepper noise with threshold = 0.1

Page 141: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

141/118

Project due Dec. 3

Roberts operator Prewitt edge detector Sobel edge detector Frei and Chen gradient operator Kirsch compass operator Robinson compass operator Nevatia-Babu 5X5 operator

Write programs to generate the following gradient magnitude images and choose proper thresholds to get the binary edge images:

Page 142: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

142/118

Project due Dec. 3

Roberts operator with threshold = 30

Page 143: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

143/118

Project due Dec. 3

Prewitt edge detector with threshold = 30

Page 144: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

144/118

Project due Dec. 3

Sobel edge detector with threshold = 30

Page 145: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

145/118

Project due Dec. 3

Frei and Chen gradient operator with threshold = 30

Page 146: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

146/118

Project due Dec. 3

Kirsch compass operator with threshold = 30

Page 147: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

147/118

Project due Dec. 3

Robinson compass operator with threshold = 30

Page 148: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

148/118

Project due Dec. 3

Nevatia-Babu 5X5 operator threshold = 30

Page 149: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

149/118

Project due Dec. 10

Write the following programs to detect edge:

Zero-crossing on the following four types of images to get edge images (choose proper thresholds), p. 349 Laplacian minimum-variance Laplacian Laplacian of Gaussian Difference of Gaussian, (use tk to generate D.O.G.) dog (inhibitory , excitatory , kernel size=11)

Page 150: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

150/118

Difference of Gaussian

Page 151: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

151/118

Difference of Gaussian

Page 152: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

152/118

Project due Dec. 10

Zero-crossing on the following four types of

images to get edge images (choose proper

thresholds t=1)

Page 153: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

153/118

Laplacian

Page 154: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

154/118

minimum-variance Laplacian

Page 155: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

155/118

Laplacian of Gaussian

Page 156: Computer and Robot Vision I Chapter 7 Conditioning and Labeling Presented by: 傅楸善 & 江祖榮 r02922085@ntu.edu.tw 指導教授 : 傅楸善 博士.

156/118

Difference of Gaussian (inhibitory , excitatory , kernel size=11)