Anda di halaman 1dari 3

>> img = imread('D:/gambar/mala.

JPG');

>> mask = [-1 -1 -1; -1 8 -1; -1 -1 -1];

>> gray=rgb2gray(img);

>> thresh=graythresh(gray);

>> imbw=im2bw(gray,thresh);

>> result=conv2(double(imbw),mask,'valid');

>> subplot(1,2,1);

>> imshow(img);

>> title('Gambar ASli');

>> subplot(1,2,2);

>> imshow(result);

>> title('HAsil Konvolusi');


>> img = imread('D:/gambar/mala.JPG');

>> %brightnest

>> terang = img + 210;


>> gelap = img - 210;

>> subplot(1,3,2), imshow (img), title('normal');

>> subplot(1,3,3), imshow (terang), title('ditambah brightness');

>> subplot(1,3,3), imshow (gelap), title(' brightness dikurang');

>> img = imread('D:/gambar/mala.JPG');

>> subplot(2,1,1)

>> gray = rgb2gray(img);

>> imshow(gray);

>> subplot(2,1,2)

>> imhist(gray);

Anda mungkin juga menyukai