Chapter 3: Image processing and computer vision Edge detection and image filtering by prof K H Wong Computer Science and engineering dept. CUHK khong@cse cuhk. edu. hk Tutorial for CMSC5711: Edge vo. 1a
Chapter 3: Image processing and computer vision Edge detection and image filtering by Prof. K.H. Wong, Computer Science and Engineering Dept. CUHK khwong@cse.cuhk.edu.hk Tutorial for CMSC5711 : Edge v0.1a 1
ear Introduction Edge detection by differentiation and threshold Convolution math tool Edge mask: edge detection by convolution(e.g Sobel) Image Filtering: smoothing, high pass etc Laplacian method 2nd order derivative method Laplacian of Gaussian: LOG smoothing and edge detection together Canny Edge Detection Most popular method Tutorial for CMSC5711: Edge vo. 1a
You will learn • Introduction: Edge detection by differentiation and threshold • Convolution math tool • Edge mask : edge detection by convolution (e.g. Sobel) • Image Filtering: smoothing, high pass etc. • Laplacian method : 2nd order derivative method. • Laplacian of Gaussian :LOG smoothing and edge detection together • Canny Edge Detection: Most popular method Tutorial for CMSC5711 : Edge v0.1a 2
opICS Edge detection First order derivative g(0 Second order derivative v2l a gray level image I has many sharp edges Tutorial for CMSC5711: Edge vo. 1a
Topics • Edge detection • First order derivative G(I) • Second order derivative 2 I A gray level image I has many sharp edges Tutorial for CMSC5711 : Edge v0.1a 3
What are edges and why we need them? Features have many applications: recognition tracking etc The most common are Point edges Shape intensity change positions Boundary edges Shape intensity changing lines Tutorial for CMSC5711: Edge vo. 1a
What are edges and why we need them? • Features have many applications: recognition, tracking etc. • The most common are • Point edges • Shape intensity change positions • Boundary edges • Shape intensity changing lines Tutorial for CMSC5711 : Edge v0.1a 4
Sobel demo D⊥addn33fns http://www.youtube.com/watch?v=z_a6e30a0xo Tutorial for CMSC5711: Edge vo. 1a 5
Sobel Demo • http://www.youtube.com/watch?v=z_a6e30aOXo Tutorial for CMSC5711 : Edge v0.1a 5
Face edges ·Demo http://www.youtube.com/watch?v=cdile-53a0w Tutorial for CMSC5711: Edge vo. 1a 6
Face edges • Demo http://www.youtube.com/watch?v=CDlLe-53a0w Tutorial for CMSC5711 : Edge v0.1a 6
Application of edges .l ane detection http://www.youtube.com/watch?v=al4dnnkzuea&feature=related http://www.youtube.com/watch?v=9f3_6xl8hey&feature=related Tutorial for CMSC5711: Edge vo. 1a
Application of edges • Lane detection http://www.youtube.com/watch?v=Al4DnNkZUeA&feature=related http://www.youtube.com/watch?v=9F3_6xL8hEY&feature=related Tutorial for CMSC5711 : Edge v0.1a 7
How to obtained edges? I(xy+1)I(x+12y+1) (x,y)I(x+1,y) Use gradient G of intensity [ (x, y)] change, two methods First order gradient 1(x,y) is an edge if X (((x,y)≈ al(x,y) a(x,y)|≥ Threshold Second order gradient(Laplacian operator I(x,y is an edge if a/(x,y),a/(x,y) x,) Tutorial for CMSC5711: Edge vo. 1a
How to obtained edges? • Use gradient G of intensity [I(x,y)] change, two methods • First order gradient • I(x,y) is an edge if • Second order gradient (Laplacian operator) • I(x,y) is an edge if Threshold y I x y x I x y G I x y + 2 2 ( , ) ( , ) ( ( , )) 0 ( , ) ( , ) ( , ) 2 2 2 2 2 = + = y I x y x I x y I x y x y I(x,y) I(x,y+1) I(x+1,y+1) I(x,y) I(x+1,y) Tutorial for CMSC5711 : Edge v0.1a 8
Edge detection using First order gradient G > threshold Edges are at positions of rapid change of intensity levels If ( intensity gradient G((x, y))> threshold ((x,y)≈ aI(x,y), al(x ≥ Threshold ax pixel(x, y) is an edge point First order derivative GI(x,y)=> threshold is an edge Tutorial for CMSC5711: Edge vo. 1a
Edge detection using First order gradient G > threshold • Edges are at positions of rapid change of intensity levels • If (intensity gradient G(I(x,y))> threshold) • { • pixel(x,y) is an edge point; • } Threshold x I x y x I x y G I x y + 2 2 ( , ) ( , ) ( ( , )) First order derivative I(x,y) G[I(x,y)]=> threshold is an edge Tutorial for CMSC5711 : Edge v0.1a 9
Edge detection using second order gradient V2=0 Edges are at v2i=0 02I(x,y)01(x,y)=0 If intensity gradient V21=0) pixel(x, y) is an edge point ∧I(X,y -7+GI(X)=> threshold is an edge First order derivative (gradient of I(x,y)). VZI(X, y)=0 is an edge Second order derivative (gradient of gradient-Of > I(x,y) Tutorial for CMSC5711: Edge vo. 1a 10
Edge detection using second order gradient 2 I=0 • Edges are at 2 I =0 • If (intensity gradient 2 I =0) • { • pixel(x,y) is an edge point; • } 0 ( , ) ( , ) ( , ) 2 2 2 2 2 = + = x I x y x I x y I x y I(x,y) G[I(x,y)]=> threshold is an edge 2 I(x,y)= 0 is an edge First order derivative (gradient of I(x,y)) Second order derivative (gradient of gradient of I(x,y)) x I(x,y) x x Tutorial for CMSC5711 : Edge v0.1a 10