Program matlab smoothing citra


function smoothing
A=imread('cameraman.tif');
%m=[0 -1 0;-1 4 -1;0 -1 0];
%m=[1/16 1/8 1/16;1/8 1/4 1/16 ;1/16 1/8 1/16]
m=[1/10 1/10 1/10;1/10 1/5 1/10;1/10 1/10 1/10];
%m=[-1 -1 -1;-1 9 -1;-1 -1 -1];
A=double(A);
d=A;
[baris kolom]=size(A);
for i=2:baris-1;
    for j=2:kolom-1;
        d(i,j)=A(i-1,j-1)*m(1,1)+A(i-1,j)*m(1,2)+A(i-1,j+1)*m(1,3)+A(i,j-1)*m(2,1)+A(i,j)*m(2,2)+A(i,j+1)*m(2,3)+A(i+1,j-1)*m(3,1)+A(i+1,j)*m(3,2)+A(i+1,j+1)*m(3,3);
        if d(i,j)>255
            d(i,j)=255;
        else if d(i,j)
                d(i,j)=0;
            end
        end
    end
end
C=uint8(A);
subplot (2,2,1), imshow(C);
subplot (2,2,2), imhist(C);
D=uint8(d)
subplot (2,2,3), imshow(D);
subplot (2,2,4), imhist(D);

Previous
Next Post »

1 comments:

Click here for comments
haganjainel
admin
5 Maret 2022 pukul 05.31 ×

Casino Games And The Jackpot City - JMHub
Enjoy exciting slots games at JTM! New slot 진주 출장안마 games at 시흥 출장마사지 JTM! New slot games at JTM! New 제주 출장마사지 slot games at JTM! New slot 구리 출장샵 games at JTM! New slot games at 경상남도 출장마사지 JTM! New slot games at JTM!

Congrats bro haganjainel you got PERTAMAX...! hehehehe...
Reply
avatar