Archive for May, 2008

Portofolio 1

Sunday, May 18th, 2008

Portofolio yang berisi 2 tugas yaitu:

  • Versi biner dari salah satu citra lego dan nilai threshold yang digunakan
  •  Output dari fungsi moments pada beberapa obyek di citra lego

Gambar Asli:

>>Lego1.png

Gambar awal

—-Cara yang digunakan:

im = imread (’G:\Kuliah\ACVK\Port1\lego1.png’);  %membuka gambar

imshow(im);

g = rgb2gray(im);  %membuat citra menjadi abu2

imshow(im);

%———threshold ubah objek jadi warna item———–

thresh=graythresh(g);

bw=im2bw(g,thresh);

bw=im2bw(g,0.65); % objek item dengan nilai threshold =0.65

Gambar:

tugas1-4.jpg

%——–ubah objek jadi warna putih——

negbw=~bw;

[label,jmlobjek]= bwlabel(negbw, 4);

%imagesc(label), colormap (gray);

jmlobjek

pilihobjek = 22;

objek=label==pilihobjek;

figure, imshow(objek)

[area, centroid, theta, roundness] = moments(objek); % memanggil fungsi moments

disp (’Area:’);

disp(area);

disp (’centroid’);

disp (centroid);

disp (’theta’);

disp (theta);

disp (’roundness’);

disp (roundness);

Gambar:

tugas1-hasilakhir.jpg

Hello world!

Sunday, May 18th, 2008

Welcome to ITS Blog. This is your first post. Edit or delete it, then start blogging!