08-Citra Medis (Konsep Warna)
08-Citra Medis (Konsep Warna)
MATERIKULIAH– [8]:
PENGEMBANGAN APLIKASI INFORMATIKA MEDIS
Tim Pengajar:
Referensi Utama
Scott Bezan. Image Processing using MATLAB.
Outline
Citra Mikroskopis
• Citra erythrocytes normal
terlihat dalam pengamatan
mikroskop
• Medical Technologist
biasanya ditugaskan untuk
menghitung banyaknya sel
darah dan menganalisa
komponen sel darah
Brain Teaser
Citra Mikroskopis
• Apa ciri untuk menentukan
objek sel darah pada citra
mikroskopis di samping?
• Bagaimana cara mengambil
hanya (mengisolasi) objek
sel darah?
Brain Teaser
Citra Mikroskopis
• Apa ciri untuk menentukan
objek sel darah pada citra
mikroskopis di samping?
• Bagaimana cara mengambil
hanya (mengisolasi) objek
sel darah?
Konsep warna
Citra Mikroskopis
• Apa ciri untuk menentukan
objek sel darah pada citra
mikroskopis di samping?
– Sel darah berwarna lebih
gelap daripada background
– Sel darah berbentuk lingkaran
Konsep warna
Citra Mikroskopis
• Apa ciri untuk menentukan
objek sel darah pada citra
mikroskopis di samping?
– Sel darah nampak lebih gelap
daripada background
– Sel darah berbentuk lingkaran
Konsep warna: RGB vs Graylevel
Citra RGB Citra Graylevel
%memanggil file citra RGB, disimpan sbg matriks %mengubah citra RGB menjadi citra graylevel
A = imread('Normal-bovine-erythrocytes.jpg'); B = rgb2gray(A);
• Prinsip Kerja
Thresholding
• Gambar A: kasus bi-modal seperti pada citra
grayErythrocytes
2 2 2
σ (t ) = q1 (t ) σ (t ) + q 2 (t )σ (t )
w 1 2
t I
iP(i) iP(i)
µ1 (t) = ∑ µ2 (t) = ∑
i =1 q1 (t) i =t +1 q2 (t )
Finally, the individual class variances are:
t
P(i)
σ (t) = ∑[i − µ1 (t)]
2
1
2
i=1 q1 (t)
I
P(i)
σ (t) = ∑ [i − µ 2 (t)]
2
2
2
i =t +1 q2 (t)
Now, we could actually stop here. All we need to do is just run through the full
2
range of t values [1,256] and pick the value that minimizesσ w (t) .
But the relationship between the within-class and between-class variances can
be exploited to generate a recursion relation that permits a much faster
calculation.
Between/Within/Total Variance
• The book gives the details, but the basic
idea is that the total variance does not
depend on threshold (obviously).
• For any given threshold, the total variance is
the sum of the within-class variances
(weighted) and the between class variance,
which is the sum of weighted squared
distances between the class means and the
grand mean.
After some algebra, we can express the total variance as...
2 2 2
σ = σ (t) + q1 (t)[1 − q1 (t)][µ1 (t) − µ2 (t)]
w
Within-class,
from before Between-class, σ B2 (t)
Since the total is constant and independent of t, the effect of changing the
threshold is merely to move the contributions of the two terms back and forth.
So, minimizing the within-class variance is the same as maximizing the between-
class variance.
The nice thing about this is that we can compute the quantities in σ B2 (t)
recursively as we run through the range of t values.
Finally...
Initialization... q1 (1) = P(1) ; µ1 (0) = 0
Recursion...
q1 (t + 1) = q1 (t) + P(t + 1)
µ − q1 (t + 1)µ1 (t + 1)
µ2 (t + 1) =
1 − q1 (t + 1)
Yang tinggal pakai ;-)
Brain Teaser
• Lakukan segmentasi citra grayErythrocytes
dengan menggunakan nilai t sesuai algoritma
Otsu’s
Perbandingan hasil segmentasi
Terima kasih
izzati@uii.ac.id