Monday, March 21, 2011

Kernel 2x2 pusat 1,1 Citra Dengan Matlab

function kernel
f=[4 4 8 8 4;8 12 4 12 8;8 4 12 4 8;4 12 4 12 8;4 8 4 8 4];
g=[0.25 0.25;0.25 0.25];
d=f;
[baris kolom]=size(f);
for i=1:baris-1
    for j=1:kolom-1
        d(i,j)=(f(i,j)*g(1,1)+f(i,j+1)*g(1,2)+f(i+1,j)*g(2,1)+f(i+1,j+1)*g(2,2));
    end
end
f
d

No comments:

Post a Comment