function [] = demoNoiseFiltering();

img = imread('fing1.gif');
fig1 = figure;
imshow(img, [0,60]);
se = strel('disk', 2);
imgO = imopen(img,se);
fig2 = figure;
imshow(imgO, [0,60]);
imgOC = imclose(img,se);
imshow(imgOC, [0,60]);
fig3 = figure;
imshow(imgOC, [0,60]);

imshow(imgOC, [15,40]);
 figure(fig1);
 imshow(img, [15,40]);

 % now do the opposite
figure(fig1);
imshow(img, [0,60]);
imgC = imclose(img,se);
figure(fig2);
imshow(imgC, [0,60]);
imgCO = imopen(img,se);
figure(fig3);
imshow(imgCO, [0,60]);

figure(fig2);
imshow(imgOC, [0,60]);

imshow(imgCO, [15,40]);
 figure(fig1);
 imshow(img, [15,40]);
