Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all;
- clear all;
- IMG_1 = imread('ferrari.bmp');
- SE = strel('square',3);
- erIMG_1 = imerode(IMG_1,SE);
- dyIMG_1 = imdilate(IMG_1,SE);
- opIMG_1 = imopen(IMG_1,SE);
- clIMG_1 = imclose(IMG_1,SE);
- topIMG_1 = imtophat(IMG_1,SE);
- botIMG_1 = imbothat(IMG_1,SE);
- figure(1)
- subplot(3,3,1)
- imshow(IMG_1)
- title('Obraz originalny')
- subplot(3,3,2)
- imshow(erIMG_1)
- title('Obraz po erozji')
- subplot(3,3,3)
- imshow(dyIMG_1)
- title('Obraz po dylatacji')
- subplot(3,3,4)
- imshow(opIMG_1)
- title('Obraz po otwarciu')
- subplot(3,3,5)
- imshow(clIMG_1)
- title('Obraz po zamknieciu')
- subplot(3,3,6)
- imshow(topIMG_1)
- title('Obraz po top-hat')
- subplot(3,3,7)
- imshow(botIMG_1)
- title('Obraz po bot-hat')
- %udało sie odkryć zarys(kontury) samochodu
- IMG_2 = imread('rice.png');
- SE_2 = strel('disk',10);
- topIMG_2 = imtophat(IMG_2,SE);
- figure(2)
- subplot(1,2,1)
- imshow(IMG_2)
- title('Obraz originalny')
- subplot(1,2,2)
- imshow(topIMG_2)
- title('Obraz po operacji top-hat')
- %zniszczyło obraz, jest cały ciemny, widać tylko pojedyncze kropki, można
- %zakladać że nie ma już oświetlenia
Advertisement
Add Comment
Please, Sign In to add comment