Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all;
- clear all;
- IMG_1 = imread('calculator.png');
- SE = ones(1,71);
- erode = imerode(IMG_1,SE);
- obr = imreconstruct(erode,IMG_1);
- obr_1 = imopen(IMG_1,SE);
- tep = IMG_1-obr;
- topIMG_1 = imtophat(IMG_1,SE);
- figure(1)
- subplot(3,3,1)
- imshow(IMG_1)
- title('Obraz originalny')
- subplot(3,3,2)
- imshow(obr)
- title('Obraz po operacji otwarcia przez rekonstrucje')
- subplot(3,3,3)
- imshow(obr_1)
- title('Obraz po operacji otwarcia przez rekonstrucje')
- subplot(3,3,4)
- imshow(tep)
- title('Obraz po operacji odejmowania')
- subplot(3,3,5)
- imshow(topIMG_1)
- title('Obraz po operacji top-hat')
- %-----------------------------------------------------
- SE_1 = ones(1,11);
- erode_1 = imerode(IMG_1,SE_1);
- obr_1 = imreconstruct(erode_1,IMG_1);
- subplot(3,3,6)
- imshow(obr_1)
- title('Obraz po operacji rekonstrukcji(ones 1,11)+erozji')
- %-------------------------------------------------------
- SE_2 = ones(1,21);
- erode_2 = imdilate(IMG_1,SE_2);
- obr_2 = imreconstruct(erode_2,topIMG_1);
- obr_3 = imreconstruct(erode_2,imdilate(IMG_1,SE_1));
- subplot(3,3,7)
- imshow(obr_2)
- title('Obraz po operacji rekonstrukcji')
- subplot(3,3,8)
- imshow(obr_3)
- title('Obraz po operacji rekonstrukcji')
- %Tak udało się otrzymać zamierzony efekt, widać to na wykresie "Obraz po
- %odejmowaniu"
Advertisement
Add Comment
Please, Sign In to add comment