Professional Documents
Culture Documents
Morphological Operations
10.1 Tujuan
Morfologi adalah teknik pengolahan citra berdasarkan bentuk. Nilai setiap pixel dalam
gambar output berdasarkan perbandingan pixel yang sesuai dengan tetangganya. Dengan
memilih ukuran dan bentuk, maka dapat membangun sebuah operasi morfologi yang sensitif
terhadap bentuk tertentu pada input gambar. Fungsi morfologi dapat digunakan untuk
pengolahan citra secara umum. Misalnya peningkatan kontras, penghilangan noise, penipisan,
skeletonization dan segmentasi.
>> B= imregionalmax(A)
>>B= imextendedmax(A,2)
>>
>> B = imhmax(A,2)
Imposing a Minimum
>>mask = uint8(10*ones(10,10));
>>mask(6:8,6:8) = 2;
>>mask(2:4,2:4) = 7;
>>mask(3,3) = 5;
>>mask(2,9) = 9
>>mask(3,8) = 9
>>mask(9,2) = 9
>>mask(8,3) = 9
>>marker = imextendedmin(mask,1)
>> I = imimposemin(mask,marker)
>>center1 = -10;
>>center2 = -center1;
>>dist = sqrt(2*(2*center1)^2);
To compute the distance transform of the complement of the binary image, use the bwdist
function. In the image of the distance transform, note how the centers of the two circular
areas are white.
>>D = bwdist(~bw);
BW = [0 0 0 0 0 0 0 0;
0 1 1 0 0 1 1 1;
0 1 1 0 0 0 1 1;
0 1 1 0 0 0 0 0;
0 0 0 1 1 0 0 0;
0 0 0 1 1 0 0 0;
0 0 0 1 1 0 0 0;
0 0 0 0 0 0 0 0];
X = bwlabel(BW,4)
X = bwlabel(BW1,4);
imshow(RGB,'notruesize')
BW = imread('circbw.tif');
SE = ones(5);
BW2 = imdilate(BW,SE);
increase = (bwarea(BW2) - bwarea(BW))/bwarea(BW);
increase =
0.3456
15. Finding the Euler Number of a Binary Image
BW1 = imread('circbw.tif');
eul = bweuler(BW1,8)
eul =
-85
16. Lookup Table Operations
BW1 = imread('text.png');
BW2 = applylut(BW1,lut);
imshow(BW1)
figure, imshow(BW2)
17. PERCOBAAN PADA SIMULINK
Sebelum transformasi
Setelah Transformasi
10.4 Tugas
Analisa percobaan diatas dan beri kesimpulan !