Program Pemotongan Aras Keabuan

Coding :
function [img] = potong(citra,f1,f2)
img=imread(citra);  
[jum_baris,jum_kolom]=size(img);
for baris=1 : jum_baris
for kolom=1 : jum_kolom
 if img(baris, kolom ) <=f1
 img(baris,kolom)=0;
 end
  if img(baris,kolom) >=f2
  img(baris,kolom)=255;
  end
end
end
end   %akhir fungsi
h=potong('c:\image\danii.png',30,140);
imshow(h)
p=imread('c:\image\danii.png');
subplot(1,2,1);imshow(p)
subplot(1,2,2);imshow(h)

Hasil :

Komentar

Postingan Populer