clear all;
close all;
 
bw = imread('uErosion.bmp');

[pRow,pCol] = size(bw);
uErosion = zeros(pRow,pCol, 'uint8');
imshow(bw, 'InitialMagnification', 100);
figure;
se = strel('disk', 1);

 se = strel('disk', 1);
tt1 = bw;
tt2 = imerode(tt1,se);
[X,Y] = ind2sub(size(tt1), find(tt2>0));
tt3 = bwselect(tt1,X,Y,4);


[I,J] = ind2sub(siz,IND) returns the matrices I and 
J containing the equivalent row and column subscripts 
corresponding to each linear index in the matrix IND 
for a matrix of size siz. siz is a 2-element vector, 
    where siz(1) is the number of rows and siz(2) is 
    the number of columns.