53
LAMPIRAN A
SCRIPT PROGRAM LOW PASS FILTER & HIGH PASS FILTER
MENGGUNAKAN MATLAB
LOW PASS FILTER
% Image processing pada frequency domain
a=imread('itebeh.jpg');
img = a(:,:,1);
% Transformasi Fourier dengan FFT
img_f = fft2(img);
img_fs = fftshift(img_f);
% Menyiapkan figure sbg tempat untuk menampilkan citra.
h1 = figure;
iptsetpref('ImshowAxesVisible','off');
set(h1, 'Units','pixels', ...
'Position', [10 40 560 530], ...
'MenuBar', 'none', ...
'ToolBar','none');
set(h1, 'NumberTitle', 'off');
set(h1, 'Name', 'Image Processing in Frequency Domain (Press Enter to continue...)');
ah1 = axes('Parent',h1, ...
'Units','pixels', ...
'Position',[5 265 256 256], ...
'XTick',[], ...
'YTick',[], ...
'Box','on', ...
'Tag','Axes3');
ah2 = axes('Parent',h1, ...
'Units','pixels', ...
'Position',[280 265 256 256], ...
'XTick',[], ...
'YTick',[], ...
'Box','on', ...
'Tag','Axes4');
ah3 = axes('Parent',h1, ...
'Units','pixels', ...
'Position',[5 5 256 256], ...
'XTick',[], ...
'YTick',[], ...
'Box','on', ...
'Tag','Axes1');
ah4 = axes('Parent',h1, ...
'Units','pixels', ...
'Position',[280 5 256 256], ...
'XTick',[], ...
'YTick',[], ...
'Box','on', ...
'Tag','Axes2');
% Menampilkan citra asal
axes(ah1);
imshow(img);
pause;
% Kompresi dynamic range dari spektrum Fourier
% untuk menampilkan spektrum Fourier sbg citra (Gonzalez, p.92)
img_spectrum = log(1+abs(img_fs));
axes(ah2);
% Menampilkan spektrum Fourier dari citra
%imshow(r2f2, [3 10]);
imshow(img_spectrum, [3 10]);
pause;
[M N]=size(img_fs);
aa=[M N];
% Memilih area frekuensi yang akan difilter
% untuk menghapus noise.
h = ones(aa);
% Memilih area frekuensi yang akan difilter
% Nilai pada freuensi tinggi akan dihilangkan dengan cara dikalikan 0.
for ix = 1:M,
for iy = 1:N,
if ((iy > N/4) & (ix > M/4)) & ((iy < (N-20))&(ix < (M-20)))
h(ix,iy) = 0;
end
end
end
g = img_fs .* h;
% Kompresi dynamic range dari spektrum Fourier
img_spectrum = log(1+abs(g));
axes(ah4);
% Menampilkan spektrum Fourier yang sudah difilter
imshow(img_spectrum, [3 10]);
pause;
% Inverse Transformasi Fourier
hasil = uint8(abs(ifft2(g)));
axes(ah3);
% Menampilkan citra hasil
imshow(hasil);
pause;
close;
- Program looping dan korelasi setelah transformasi Fourier dan filtering ‘kpcfft2D’
function kor=kpcfft2D(imk1,imk2);
[b1 k1]=size(imk1);
[b2 k2]=size(imk2);
nbaris=b2-b1+1;
nkolom=k2-k1+1;
imk2sca=imk1;
for i=1:nbaris
for j=1:nkolom
imk2scp(:,:,i,j)=imk2(i:i+b1-1,j:j+k1-1);
imk2scpttf=tff(imk2scp(:,:,i,j));
imk2scattf=tff(imk2sca);
kor(i,j)=corr2(imk2scattf,imk2scpttf);
end;
end;
- Program mencari nilai korelasi masing-masing kanal dan nilai korelasi maksimum total ‘korfft2D’
function [vcormax rowlk collk]=korfft2D(im1,im2)
% pemisahan kanal RGB
[R1 G1 B1]=chsepRGB(im1);
[R2 G2 B2]=chsepRGB(im2);
% menghitung korelasi masing-masing kanal
korR =kpcfft2D(R1,R2);
korG =kpcfft2D(G1,G2);
korB =kpcfft2D(B1,B2);
% menghitung berat masing-masing kanal
wR=std2(R1);
wG=std2(G1);
wB=std2(B1);
% menghitung nilai korelasi maksimum yang diberi bobot dengan rumus
% kortotal=wR*korR + wG*korG + wB*korB /wR+wG+wB
Mkortotal=(wR*korR+wG*korG+wB*korB)/(wR+wG+wB);
[vcormax rowlk collk]=maxcor(Mkortotal);
% menghitung nilai korelasi maksimum mqsing-masing kanal // MODIFIKASI
[korRhemax rowRlk colRlk]=maxcor(korR);
[korGhemax rowGlk colGlk]=maxcor(korG);
[korBhemax rowBlk colBlk]=maxcor(korB);
fid=fopen('hasilperkanal2Dsetelah.txt','w');
fprintf(fid,'kanal merah : %d %d %2.4f\n',rowRlk,colRlk,korRhemax);
fprintf(fid,'kanal hijau : %d %d %2.4f\n',rowGlk,colGlk,korGhemax);
fprintf(fid,'kanal biru : %d %d %2.4f\n',rowBlk,colBlk,korBhemax);
fprintf(fid,'kanal total : %d %d %2.4f\n',rowlk,collk,vcormax);
fclose(fid);
LAMPIRAN C
DAFTAR TABEL NILAI KORELASI HASIL PERCOBAAN
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 21x21 piksel area
homogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.4638 0.4442
0.731 0.7355
0.4978 0.5123
0.6384 0.64
0.5621 0.5844
0.4876 0.5079
0.3966 0.3908
0.7014 0.6909
0.318 0.3185
0.3679 0.4156
0.2879 0.3139
0.19 0.2225
0.8622 0.8748
0.337 0.3783
0.1441 0.1714
0.19 0.2105
0.4394 0.453
0.1947 0.2137
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.4638 0.6009
0.731 0.769
0.4978 0.7187
0.6384 0.7991
0.5621 0.6126
0.4876 0.5923
0.3966 0.5513
0.7014 0.797
0.318 0.4006
0.3679 0.4795
0.2879 0.3852
0.19 0.2348
0.8622 0.9141
0.337 0.43
0.1441 0.0297
0.19 0.2684
0.4394 0.5559
0.1947 0.1722
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 31x31 piksel area
homogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.1175 0.1368
0.731 0.7355
0.5621 0.5895
0.6384 0.64
0.5621 0.5844
0.4876 0.5079
0.431 0.4303
0.7014 0.6909
0.318 0.3185
0.3679 0.4156
0.376 0.3793
0.3101 0.367
0.8622 0.8748
0.4332 0.4825
0.3444 0.3609
0.4541 0.4754
0.4562 0.4548
0.2564 0.2694
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.1175 0.1782
0.731 0.769
0.5621 0.7187
0.6384 0.7991
0.5621 0.6126
0.4876 0.5923
0.431 0.5513
0.7014 0.797
0.318 0.4006
0.3679 0.4795
0.376 0.5696
0.3101 0.388
0.8622 0.9141
0.4332 0.5003
0.3444 0.3568
0.4541 0.605
0.4562 0.5579
0.2564 0.4037
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 41x41 piksel area
homogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.3683 0.4733
0.731 0.7355
0.5743 0.6011
0.6384 0.64
0.5621 0.5844
0.4876 0.5079
0.431 0.4303
0.7014 0.6909
0.318 0.3185
0.4324 0.4156
0.0886 0.09
0.3612 0.367
0.8622 0.8748
0.4584 0.4825
0.298 0.4065
0.4541 0.4754
0.4562 0.4548
0.1658 0.3079
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.3683 0.6365
0.731 0.769
0.5743 0.7187
0.6384 0.7991
0.5621 0.6126
0.4876 0.5923
0.431 0.5513
0.7014 0.797
0.318 0.4006
0.4324 0.5102
0.0886 0.0996
0.3612 0.4285
0.8622 0.9141
0.4584 0.6041
0.298 0.4256
0.4541 0.605
0.4562 0.5699
0.1658 0.4037
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 51x51 piksel area
homogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.4129 0.4076
0.731 0.7355
0.5743 0.6011
0.6384 0.6538
0.5932 0.6079
0.4876 0.5079
0.431 0.4303
0.7014 0.6909
0.4279 0.4442
0.4324 0.4156
0.2287 0.2372
0.3612 0.367
0.8622 0.8748
0.4584 0.4825
0.298 0.3209
0.5515 0.5716
0.4562 0.4803
0.2625 0.3079
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.4129 0.5392
0.731 0.769
0.5743 0.7187
0.6384 0.7991
0.5932 0.6447
0.4876 0.5923
0.431 0.5513
0.7014 0.797
0.4279 0.47
0.4324 0.5102
0.2287 0.2487
0.3612 0.4285
0.8622 0.9141
0.4584 0.6041
0.298 0.4256
0.5515 0.6869
0.4562 0.5699
0.2625 0.4037
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 61x61 piksel area
homogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.3061 0.3459
0.731 0.7355
0.5743 0.6011
0.4247 0.4714
0.5802 0.5973
0.731 0.7355
0.431 0.444
0.7014 0.6909
0.4279 0.4442
0.4558 0.5079
0.3145 0.2323
0.3612 0.367
0.8622 0.8748
0.4584 0.4825
0.3702 0.3893
0.5515 0.5716
0.4562 0.4803
0.3801 0.4036
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.3061 0.4061
0.731 0.769
0.5743 0.7187
0.4247 0.7995
0.5802 0.6095
0.731 0.769
0.431 0.5513
0.7014 0.797
0.4279 0.522
0.4558 0.5102
0.3145 0.5476
0.3612 0.4285
0.8622 0.9141
0.4584 0.6041
0.3702 0.3585
0.5515 0.6869
0.4562 0.5699
0.3801 0.5338
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 21x21 piksel area
heterogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.8117 0.823
0.9557 0.9541
0.9463 0.9521
0.935 0.9401
0.9571 0.9609
0.9244 0.9262
0.7839 0.7929
0.9422 0.9402
0.9393 0.943
0.909 0.9144
0.9521 0.9539
0.9042 0.9105
0.6206 0.6329
0.8496 0.8838
0.9342 0.9366
0.861 0.8691
0.8625 0.8864
0.93 0.933
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.8117 0.8548
0.9557 0.9682
0.9463 0.9589
0.935 0.9516
0.9571 0.9734
0.9244 0.9371
0.7839 0.8313
0.9422 0.9644
0.9393 0.961
0.909 0.9333
0.9521 0.9634
0.9042 0.9426
0.6206 0.7657
0.8496 0.8938
0.9342 0.961
0.861 0.8938
0.8625 0.8791
0.93 0.958
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 31x31 piksel area
heterogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.8117 0.823
0.9557 0.9541
0.9463 0.9521
0.935 0.9401
0.9571 0.9609
0.9244 0.9262
0.7839 0.7929
0.9422 0.9402
0.9393 0.943
0.909 0.9144
0.9521 0.9539
0.9042 0.9105
0.6206 0.6329
0.8585 0.8838
0.9342 0.9366
0.861 0.8691
0.8625 0.8864
0.93 0.933
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.8117 0.8548
0.9557 0.9682
0.9463 0.9589
0.935 0.9516
0.9571 0.9734
0.9244 0.9371
0.7839 0.8313
0.9422 0.9644
0.9393 0.961
0.909 0.9333
0.9521 0.9634
0.9042 0.9426
0.6206 0.7657
0.8585 0.8938
0.9342 0.961
0.861 0.8938
0.8625 0.8791
0.93 0.958
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 41x41 piksel area
heterogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.8117 0.813
0.9557 0.9541
0.9363 0.9421
0.8201 0.8492
0.7386 0.7558
0.9244 0.9262
0.7539 0.7829
0.9422 0.9402
0.9393 0.943
0.909 0.9144
0.9521 0.9539
0.9042 0.9105
0.8755 0.8863
0.9646 0.9764
0.9342 0.9366
0.861 0.8691
0.8625 0.8864
0.93 0.933
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.8117 0.8548
0.9557 0.9682
0.9363 0.9589
0.8201 0.918
0.7386 0.7678
0.9244 0.9371
0.7539 0.8313
0.9422 0.9594
0.9393 0.961
0.909 0.9333
0.9521 0.9634
0.9042 0.9426
0.8755 0.9657
0.9646 0.9068
0.9342 0.961
0.861 0.8938
0.8625 0.8791
0.93 0.958
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 51x51 piksel area
heterogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.8117 0.823
0.9557 0.9541
0.9463 0.9521
0.935 0.9401
0.9571 0.9609
0.9244 0.9262
0.7839 0.7929
0.9422 0.9402
0.9393 0.943
0.909 0.9144
0.9521 0.9539
0.9042 0.9105
0.684 0.7286
0.8646 0.8864
0.9342 0.9366
0.861 0.8691
0.8625 0.8864
0.93 0.933
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.8117 0.8548
0.9557 0.9682
0.9463 0.9589
0.935 0.9516
0.9571 0.9734
0.9244 0.9371
0.7839 0.8313
0.9422 0.9644
0.9393 0.961
0.909 0.9333
0.9521 0.9634
0.9042 0.9426
0.684 0.7993
0.8646 0.9068
0.9342 0.961
0.861 0.8938
0.8625 0.8791
0.93 0.958
- Nilai korelasi untuk citra acuan 11x11 piksel dan citra pencarian 61x61 piksel area
heterogen
nilai korelasi sebelum high pass filter nilai korelasi setelah high pass filter
0.8117 0.823
0.9557 0.9541
0.9463 0.9521
0.935 0.9401
0.9571 0.9609
0.9244 0.9262
0.7839 0.7929
0.9422 0.9402
0.9393 0.943
0.909 0.9144
0.9521 0.9539
0.9042 0.9105
0.684 0.7286
0.8646 0.8864
0.9342 0.9366
0.861 0.8691
0.8625 0.8864
0.93 0.933
nilai korelasi sebelum low pass filter nilai korelasi setelah low pass filter
0.8117 0.8548
0.9557 0.9682
0.9463 0.9589
0.935 0.9516
0.9571 0.9734
0.9244 0.9371
0.7839 0.8313
0.9422 0.9644
0.9393 0.961
0.909 0.9333
0.9521 0.9634
0.9042 0.9426
0.684 0.7993
0.8646 0.9068
0.9342 0.961
0.861 0.8938
0.8625 0.8791
0.93 0.958
LAMPIRAN D
DAFTAR DATA VALIDASI
- Data validasi hasil pengamatan operator berpengalaman
Heterogen
Prem 1
Point ID Photo X Photo Y
1101 TP ITB2-05 1003.0 102.0
1101 TP ITB2-06 373.2 163.8
1102 TP ITB2-05 956.0 388.0
1102 TP ITB2-06 325.4 442.4
Homogen
Prem 1
1201 TP ITB2-05 732.0 88.0
1201 TP ITB2-06 126.0 153.0
1202 TP ITB2-05 799.0 428.0
1202 TP ITB2-06 171.0 484.0
-------------------------------------------
Heterogen
Prem 2
2101 TP ITB2-05 1462.0 173.5
2101 TP ITB2-06 812.1 224.3
2102 TP ITB2-05 1194.0 435.0
2102 TP ITB2-06 554.5 486.5
Homogen
Prem 2
2201 TP ITB2-05 1171.0 186.0
2201 TP ITB2-06 551.5 244.5
2202 TP ITB2-05 1393.0 369.0
2202 TP ITB2-06 741.0 419.0
---------------------------------------------
Heterogen
Prem 3
3101 TP ITB2-05 1836.0 162.0
3101 TP ITB2-06 1217.1 205.5
3102 TP ITB2-05 1769.0 453.5
3102 TP ITB2-06 1128.5 500.5
Homogen
Prem 3
3201 TP ITB2-05 1788.3 117.5
3201 TP ITB2-06 1171.3 162.2
3202 TP ITB2-05 1857.0 308.0
3202 TP ITB2-06 1240.0 352.0
----------------------------------------------
Heterogen
Prem 4
4101 TP ITB2-05 870.0 610.0
4101 TP ITB2-06 229.0 658.8
4102 TP ITB2-05 1040.0 688.8
4102 TP ITB2-06 399.0 736.8
Homogen
Prem 4
4202 TP ITB2-05 898.0 796.0
4202 TP ITB2-06 254.5 839.0
4201 TP ITB2-06 382.5 689.0
4201 TP ITB2-05 1018.5 641.0
----------------------------------------------
Heterogen
Prem 5
5101 TP ITB2-05 1191.8 723.5
5101 TP ITB2-06 548.5 771.0
5102 TP ITB2-05 1483.8 814.0
5102 TP ITB2-06 831.3 863.0
Homogen
Prem 5
5201 TP ITB2-05 1383.0 666.0
5201 TP ITB2-06 737.5 715.0
5202 TP ITB2-05 1296.0 913.0
5202 TP ITB2-06 648.0 960.0
--------------------------------------------
Heterogen
Prem 6
6101 TP ITB2-05 1822.0 838.0
6101 TP ITB2-06 1179.8 889.7
6102 TP ITB2-05 1686.8 789.2
6102 TP ITB2-06 1044.0 839.2
Homogen
Prem 6
6201 TP ITB2-05 1699.0 626.0
6201 TP ITB2-06 1059.8 675.3
6202 TP ITB2-05 1755.0 858.0
6202 TP ITB2-06 1113.3 910.5
---------------------------------------------
Heterogen
Prem 7
7101 TP ITB2-05 933.0 1162.3
7101 TP ITB2-06 282.8 1199.5
7102 TP ITB2-05 937.5 1282.0
7102 TP ITB2-06 293.8 1316.8
Homogen
Prem 7
7201 TP ITB2-05 918.0 1185.0
7201 TP ITB2-06 270.8 1221.3
7202 TP ITB2-05 964.3 1388.0
7202 TP ITB2-06 315.0 1422.3
---------------------------------------------
Heterogen
Prem 8
8101 TP ITB2-05 1244.0 1205.0
8101 TP ITB2-06 596.0 1249.0
8102 TP ITB2-05 1487.0 1330.0
8102 TP ITB2-06 838.0 1380.3
Homogen
Prem 8
8201 TP ITB2-05 1422.0 1031.0
8201 TP ITB2-06 771.7 1079.8
8202 TP ITB2-05 1451.0 1237.0
8202 TP ITB2-06 801.0 1287.5
---------------------------------------------
Heterogen
Prem 9
9101 TP ITB2-05 1712.0 1043.0
9101 TP ITB2-06 1064.0 1097.1
9102 TP ITB2-05 1813.5 1220.0
9102 TP ITB2-06 1170.0 1278.0
Homogen
Prem 9
9202 TP ITB2-05 1711.0 1371.0
9202 TP ITB2-06 1068.5 1429.0
9201 TP ITB2-05 1750.0 1106.0
9201 TP ITB2-06 1107.0 1161.5