Date post: | 05-Jan-2016 |
Category: |
Documents |
Upload: | nanx-bocai |
View: | 222 times |
Download: | 0 times |
EE663Image ProcessingEdge Detection 3
Dr. Samir H. Abdul-Jauwad
Electrical Engineering Department
King Fahd University of Petroleum & Minerals
2
Edge Detection
• Operator-operator Gradient− Roberts− Prewitt− Sobel
• Gradient Gaussian (Canny)• Laplacian Gaussian (Marr-Hildreth)
• Detektor:
3
Edge Detection Using the Gradient
• Definis gradient:
• Magn dihitung dengan:
4
Edge Detection Using the Gradient
• Sifat gradient:
− Magnitude gradient memberikan informasi tentan kekuatan dari edge
− Arah gradient selalu tegak lurus dengan arah sisi
• Main idea:
− Menghitung turunan dari arah x dan y − Mencari besaran Gradient− Ambang dari besaran gradient
5
Edge Detection Using the Gradient
• Menentukan gradient dengan beda hingga
− Pendekatan beda hingga
6
Edge Detection Using the Gradient
• Menggunakan notasi koordinat pixel (ingat: j berkaitan denga arah x dan i arah negative y):
7
Edge Detection Using the Gradient
• Contoh :− Misal menghitung
gradient pada z5
• Dapat mengimplementasikan I/x dan I/y menggunakan mask
Catatan: Mx adalah hitungan pada (i, j + 1/2) dan My pendekatan pada (i + 1/2, j)
8
Edge Detection Using the Gradient
• Detektor sisi Roberts ( Robert Operator )
• Dapat diimplementasikan dengan mask
Note: Mx and My pendektan pada (i + 1/2, j + 1/2)
9
Edge Detection Using the Gradient
• Prewitt edge detector
− Turunan parsial dihitung dengan:
Note: Mx and My hitungan pada (i, j))
− Perhatikan pixel (i, j):
− c mempengaruhi pixel yang dekat dengan pusat mask− Jika c = 1, didapatkan Prewitt operator:
10
Edge Detection Using the Gradient
• Sobel edge detector
Note: Mx and My perhitungan pada (i, j))
− Jika c = 2, didapatkan Sobel operator:
11
Edge Detection Using the Gradient
• Langkah-langkah utama dalam deteksi tepi menggunakan mask:
12
Edge Detection Using the Gradient
(contoh menggunakan Prewitt edge detector – jangan dibagi dengan 2)
13
Edge Detection Using the Gradient
• Example:
Idx
d
Idy
d
14
Edge Detection Using the Gradient
• Example – cont.:
22
I
dy
dI
dx
d
15
Edge Detection Using the Gradient
• Example – cont.:
100 Threshold
16
Edge Detection Using the Gradient
17
Edge Detection Using the Gradient
18
Edge Detection Using the Gradient
• Isotropic property of gradient magnitude:− The magnitude of gradient is an isotropic operator (it detects edges
in any direction !!)
19
Edge Detection• Practical issues:
− High-pass filters – cenderung memperkuat noise.− Mengurangi noise - smooth pergtama dengan low-pass filter.
1) The noise suppression-localization tradeoff
− Meperbesar pengurangan noise, memperburuk penentuan tepi( menambah ketidakpastian posisi dari sisi/tepi) dan begitu sebaliknya
20
Edge Detection
2) Memilih treshold
21
Edge Detection
3) Penipisan tepi dan linking
− Diperlukan untuk mendapatkan kontur yang baik
22
Edge Detection
− Good detection: detektor optimal harus meminimkan kemungkinan kesalahan deteksi (mendeteksi sisi palsu yang disebabkan oleh noise ) dan juga meminimumkan hilangnya sisi yang sesungguhnya,
− Good localization: deteksi tepi harus mendekati sisi/tepi yang sesungguhnya.
− Single response constraint: detector harus menghasilkan satu titik hanya pada setiap titik sisi yang sesungguhnya, yaitu meminimalkan jumlah local maxima disekitar sisi sebenarnya
• Kriteria untuk deteksi tepi optimal
23
Edge Detection• Examples:
True edge
Poor robustness to noise
Poorlocalization
Too manyresponses
24
The Canny Edge Detector
− Banyak sekali digunakan.− Canny telah menunjukan bahawa turunan pertama dari Gaussian
adalah operator yang lebih sesuai yaitu mengoptimalkan hasil signal-to-noise ratio dan penempatan posisi
− Ini didasarkan pada "step-edges" yang disebabkan “penambahan Gaussian noise".
• Canny edge detector:
25
The Canny Edge Detector
26
The Canny Edge Detector• Turunan Gaussian:
),( yxg
),( yxg x
),( yxg y
27
The Canny Edge Detector• Canny – penghalusan dan derivatives:
xf
yf
f
28
The Canny Edge Detector• Canny – Besaran gradient:
image gradient magnitude
29
Edge Detection
− To find the edge points, we need to find the local maxima of the gradient magnitude.
− Broad ridges must be thinned so that only the magnitudes at the points of greatest local change remain.
− All values along the direction of the gradient that are not peak values of a ridge are suppressed.
• Non-maxima suppression
30
Edge Detection• Non-maxima suppression – cont.
31
Edge Detection• Non-maxima suppression – cont.
− What are the neighbors?− Look along gradient normal
− Quantization of normal directions:
0
12
3
41420tan41422-:3
41422|tan|:2
41422tan41420:1
41420tan41420:0
:onQuantizati
.θ.
.θ
.θ.
.θ.-
directiongradientθ tan
32
Edge Detection• Canny – Non-maxima suppression:
gradient magnitude thinned
33
Edge Detection
− The output of non-maxima suppression still contains the local maxima created by noise.
− Can we get rid of them just by using a single threshold?− if we set a low threshold, some noisy maxima will be accepted too.
− if we set a high threshold, true maxima might be missed (the value of true maxima will fluctuate above and below the threshold, fragmenting the edge).
• Hysteresis thresholding / Edge linking
− A more effective scheme is to use two thresholds:− a low threshold tl
− a high threshold th
− usually, th ≈ 2tl