PCD Lanjut Prajanto Wahyu Adi
PCD Lanjut – Pertemuan 2
Gray-Level
Co-occurrence Matrix
(GLCM)
P r a j a n t o W a h y u A d i
Rencana Kegiatan Perkuliahan
Semester
# Pokok Bahasan
1 Pengujian Kualitas Citra
2 Gray-Level Co-occurrence Matrix (GLCM)
3 Principal Component Analysis (PCA) 4 Fuzzy C-Mean (FCM) 5 K-Nearest Neighbor (KNN) 6 Jaringan Syaraf Tiruan (JST)
# Pokok Bahasan
8 Modulus Function (MF) pada domain Integer Wavelet Transform (IWT) 9 Chinese Remainder Theorem (CRT) pada
domain IWT 10
11 Kompresi Lossy 12
13 Kompresi Loseless 14 *Presentasi Tugas Besar*
PCD Lanjut Prajanto Wahyu Adi
Content
•
GLCM
1
•
Contrast
2
•
Correlation
3
•
Energy
4
•
Homogeneity
5
•
Hasil Ekstraksi Fitur GLCM
1. GLCM
P r a j a n t o W a h y u A d i
PCD Lanjut Prajanto Wahyu Adi
GLCM
•
GLCM adalah sebuah teknik untuk
GLCM
•
Nilai
θ
yang banyak adalah 0
0, 45
0, 90
0,
PCD Lanjut Prajanto Wahyu Adi
GLCM
Contoh:
•
Diketahui sebuah citra 3-bit sebagai
berikut:
bentuklah GLCM dengan jarak 1 dan
θ
=
0
0([0 1]) !
GLCM
Contoh:
•
Membentuk GLCM
[0 1]
:
3 5 72 4 1 6 3 5
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1 0 0 0
3 0 0 0 0 0 2 0 0
4 0 1 0 0 0 0 0 0
5 0 0 0 0 0 0 0 1
6 0 0 0 1 0 0 0 0
PCD Lanjut Prajanto Wahyu Adi
GLCM
Contoh:
•
Membentuk GLCM
[0 1]
:
Setelah Normalisasi =
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0 7 0 0 0 0 0 0 0 0
GLCM
•
Ekstraksi fitur (
feature extraction
) tekstur
GLCM menghasilkan beberapa fitur, antara
lain:
– Contrast – Correlation – Energy
PCD Lanjut Prajanto Wahyu Adi
2. Contrast
P r a j a n t o W a h y u A d i
Contrast
•
Contrast
merupakan
fitur
yang
merepresentasikan
perbedaan
tingkat
warna atau skala keabuah (grayscale)
yang muncul pada sebuah citra
•
Contrast akan bernilai 0 jika piksel
ketetanggaan mempunyai nilai yang sama
PCD Lanjut Prajanto Wahyu Adi
Contrast
Contoh:
•
Hitunglah Contrast dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
Contrast
Contoh:
•
Hitunglah Contrast dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0
0 0 0 0 0 0 0 0
667
,
0
6
4
6
1
)
4
2
(
2) 4 , 2 (
PCD Lanjut Prajanto Wahyu Adi
Contrast
Contoh:
•
Hitunglah Contrast dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0 7 0 0 0 0 0 0 0 0
333
,
1
6
8
6
2
)
5
3
(
2) 5 , 3 (
Contrast
Contoh:
•
Hitunglah Contrast dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0
0 0 0 0 0 0 0 0
5
,
1
6
9
6
1
)
1
4
(
2 )1 , 4 (
PCD Lanjut Prajanto Wahyu Adi
Contrast
Contoh:
•
Hitunglah Contrast dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0 7 0 0 0 0 0 0 0 0
667
,
0
6
4
6
1
)
7
5
(
2) 7 , 5 (
Contrast
Contoh:
•
Hitunglah Contrast dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0
0 0 0 0 0 0 0 0
5
,
1
6
9
6
1
)
3
6
(
2) 3 , 6 (
PCD Lanjut Prajanto Wahyu Adi
Contrast
Contoh:
•
Hitunglah Contrast dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0 7 0 0 0 0 0 0 0 0
667
,
5
6
34
6
9
4
9
8
4
3. Correlation
P r a j a n t o W a h y u A d
i
PCD Lanjut Prajanto Wahyu Adi
Correlation
•
Correlation merepresentasikan keterkaitan
linear dari derajat dari citra keabuan
•
Correlation bernilai antara -1 hingga 1
Correlation
•
Correlation merepresentasikan keterkaitan
linear dari derajat dari citra keabuan
•
Correlation bernilai antara -1 hingga 1
Dimana:
•
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Hitunglah Correlation dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
Correlation
Contoh:
•
Menghitung :
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung :
Correlation
Contoh:
•
Menghitung :
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung :
Correlation
Contoh:
•
Menghitung :
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung :
Correlation
Contoh:
•
Menghitung :
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung :
•
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0 7 0 0 0 0 0 0 0 0
343
,
1
36
65
216
390
216
169
49
1
50
121
i
Correlation
Contoh:
•
Menghitung :
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung :
Correlation
Contoh:
•
Menghitung :
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung :
Correlation
Contoh:
•
Menghitung :
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung :
•
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0 7 0 0 0 0 0 0 0 0
863
,
1
36
125
216
750
216
289
50
1
49
361
j
Correlation
Contoh:
•
Menghitung Correlation:
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung Correlation:
Correlation
Contoh:
•
Menghitung Correlation:
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung Correlation:
Correlation
Contoh:
•
Menghitung Correlation:
PCD Lanjut Prajanto Wahyu Adi
Correlation
Contoh:
•
Menghitung Correlation:
4. Energy
P r a j a n t o W a h y u A d
i
PCD Lanjut Prajanto Wahyu Adi
Energy
•
Energy
merepresentasikan
ukuran
keseragaman pada citra
•
Semakin tinggi kemiripan citra maka akan
semakin tinggi pula nilai Energy
Energy
Contoh:
•
Hitunglah Energy dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0
PCD Lanjut Prajanto Wahyu Adi
Energy
Contoh:
•
Hitunglah Energy dari GLCM berikut:
5. Homogeneity
P r a j a n t o W a h y u A d
i
PCD Lanjut Prajanto Wahyu Adi
Homogeneity
•
Homogeneity merepresentasikan ukuran
keserbasamaan
•
Homogeneity akan bernilai tinggi jika
semua piksel mempunyai nilai yang
uniform
Homogeneity
Contoh:
•
Hitunglah Homogeneity dari GLCM berikut:
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0
PCD Lanjut Prajanto Wahyu Adi
Homogeneity
Contoh:
•
Hitunglah Homogeneity dari GLCM berikut:
Homogeneity
Contoh:
•
Hitunglah Homogeneity dari GLCM berikut:
PCD Lanjut Prajanto Wahyu Adi
Homogeneity
Contoh:
•
Hitunglah Homogeneity dari GLCM berikut:
Homogeneity
Contoh:
•
Hitunglah Homogeneity dari GLCM berikut:
PCD Lanjut Prajanto Wahyu Adi
Homogeneity
Contoh:
•
Hitunglah Homogeneity dari GLCM berikut:
Homogeneity
Contoh:
•
Hitunglah Homogeneity dari GLCM berikut:
PCD Lanjut Prajanto Wahyu Adi
6. Hasil Ekstraksi
Fitur GLCM
P r a j a n t o W a h y u A d
i
Hasil Ekstraksi Fitur GLCM
•
Hasil ekstraksi fitur GLCM:
• Contrast :5,667 • Correlation :-0,056 • Energy :0,222 • Homogeneity :0,306
i j 0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
2 0 0 0 0 1/6 0 0 0 3 0 0 0 0 0 2/6 0 0 4 0 1/6 0 0 0 0 0 0 5 0 0 0 0 0 0 0 1/6 6 0 0 0 1/6 0 0 0 0
PCD Lanjut Prajanto Wahyu Adi
Hasil Ekstraksi Fitur GLCM
•
Hasil ekstraksi fitur GLCM:
– Contrast : 5,667 – Correlation :-0,056 – Energy : 0,222 – Homogeneity : 0,306