%% skrypt przetwarzajacy obrazek morfologicznie
obr=imread('circbw.tif');
clf;
hold on;
obr1=imerode(obr,strel('square',1));
obr2=imdilate(obr,strel('square',1));
obr3=imopen(obr,strel('square',1));
obr4=imclose(obr,strel('square',1));
subplot(4,2,1);
title('erode square')
imshow(obr1);
subplot(4,2,2);
title('dilate square')
imshow(obr2);
subplot(4,2,3);
title('open square')
imshow(obr3);
subplot(4,2,4);
title('close square')
imshow(obr4);
obr1=imerode(obr,strel('rectangle',[3 1]));
obr2=imdilate(obr,strel('rectangle',[3 1]));
obr3=imopen(obr,strel('rectangle',[3 1]));
obr4=imclose(obr,strel('rectangle',[3 1]));
subplot(4,2,5);
title('erode rect 3 1')
imshow(obr1);title('erode rect 3 1')
subplot(4,2,6);
title('dilate rect 3 1')
imshow(obr2);
subplot(4,2,7);
title('open rect 3 1')
imshow(obr3);
subplot(4,2,8);
title('close rect 3 1')
imshow(obr4);
hold off;