Pendeteksian Tepi Edge Detection Eri Prasetyo Pertemuan ke

  • Slides: 13
Download presentation
Pendeteksian Tepi ( Edge Detection ) Eri Prasetyo Pertemuan ke 6 1

Pendeteksian Tepi ( Edge Detection ) Eri Prasetyo Pertemuan ke 6 1

Definisi Tepi • Tepi (edge) adalah perubahan nilai intensitas derajat keabuan yang cepat/tiba-tiba (besar)

Definisi Tepi • Tepi (edge) adalah perubahan nilai intensitas derajat keabuan yang cepat/tiba-tiba (besar) dalam jarak yang singkat Profiles of image intensity edges § Step §Roof §Line 2

Tujuan Pendeteksian tepi • Untuk meningkatkan penampakan garis batas suatu daerah atau obyek di

Tujuan Pendeteksian tepi • Untuk meningkatkan penampakan garis batas suatu daerah atau obyek di dalam citra. Teknik yang digunakan untuk pendeteksian tepi antara lain : §Operator gradien pertama ( differential gradient ) §Operator turunan kedua ( Laplacian ) §Operator kompas ( compass operator ) 3

Image gradient • The gradient of an image: • The gradient points in the

Image gradient • The gradient of an image: • The gradient points in the direction of most rapid change in intensity The gradient direction is given by: • how does this relate to the direction of the edge? The edge strength is given by the gradient magnitude 4

Magnitude of gradient vector • Rumus 1: • Rumus 2: • Rumus 3: The

Magnitude of gradient vector • Rumus 1: • Rumus 2: • Rumus 3: The discrete gradient • How can we differentiate a digital image f[x, y]? – Option 1: reconstruct a continuous image, then take gradient – Option 2: take discrete derivative (finite difference) 5

 • Digunakan operator sobel Tinjau pengaturan pixel disekitar pixel (x, y) Operator sobel

• Digunakan operator sobel Tinjau pengaturan pixel disekitar pixel (x, y) Operator sobel adalah magnitude dari gradien yang dihitung dengan Atau M = |sx| + |sy| Turunan parsial dihitung dengan : Sx = (a 2+ca 3+a 4) – (a 0+ca 7+a 6) ; sy = (a 0+ca 1+a 2) – (a 6+ca 5+a 4) Dengan konstanta c=2 dalam bentuk mask, sx dan sy dinyatakan sebagai Sx = -1 0 1 -2 0 2 -1 0 1 1 Sy = 2 1 2 0 0 0 3 -1 -2 -1 6

 • Contoh citra yang akan dilakukan pendeteksian tepi dengan operator sobel, 3 4

• Contoh citra yang akan dilakukan pendeteksian tepi dengan operator sobel, 3 4 2 5 7 * * * 2 1 6 4 2 * 18 * 3 5 7 2 4 4 2 5 7 1 2 5 1 6 9 citra awal citra hasil konvolusi sx = 3 x(-1)+2 x(-1)+ 3 x(-1)+2 x(1)+6 x(2)+7 x(1) = 11 sy = 3 x(1)+4 x(2)+2 x(1)+3 x(-1)+5 x(-2)+7 x(-1) = -7 maka M = 18 • Operator lain adalah prewitt, dengan c = 1 -1 px= -1 -1 0 0 0 1 1 1 py = 1 0 -1 7

 • Operator Robert disebut operator silang, gradien robert dalam arah x dan y

• Operator Robert disebut operator silang, gradien robert dalam arah x dan y dapat dihitung : R+(x, y) = f( x+1, y+1) – f(x, y) R-(x, y) = f(x, y+1) – f(x+1, y) f(x, y+1) f(x+1, y+1) f(x, y) f(x+1, y) operator R+ adalah turunan berarah dalam arah 45 derajat, dan R- turunan berarah dalam arah 135 derajat Dalam bentuk mask operator adalah : 1 0 0 1 R+ = 0 -1 R- = -1 0 Nilai kekuatan tepi : G[f(x, y)] = |R+| + |R-| 8

 • Contoh deteksi tepi dengan robert : 4 2 4 4 2 5

• Contoh deteksi tepi dengan robert : 4 2 4 4 2 5 1 3 2 4 7 3 2 5 8 5 4 6 7 6 1 5 9 1 3 citra awal 6 4 3 0 2 8 1 2 7 4 5 5 6 2 8 3 6 7 5 6 1 5 9 1 3 citra hasil pendeteksian tepi f’[0, 0] = |4 -1| + |5 -2| = 6 9

Effects of noise • Consider a single row or column of the image –

Effects of noise • Consider a single row or column of the image – Plotting intensity as a function of position gives a signal Where is the edge? 10

Solution: smooth first Where is the edge? Look for peaks in 11

Solution: smooth first Where is the edge? Look for peaks in 11

Derivative theorem of convolution • This saves us one operation: 12

Derivative theorem of convolution • This saves us one operation: 12

Laplacian of Gaussian • Consider Laplacian of Gaussian operator Where is the edge? Zero-crossings

Laplacian of Gaussian • Consider Laplacian of Gaussian operator Where is the edge? Zero-crossings of bottom graph 13