end
end
% figure,imshow(I) ;
T1=I;
T2=I;
for i=1:x
for j=1:y
T2(i,j)=0;
end
end

w=11;

for i=1:x
for j=1:y

if(T2(i,j)==0)
l1=i;
l2=j;
ll1=l1;
ll2=l2;
rl=1;
while(rl==1)
ll1=ll1+1;
ll2=ll2+1;
if(ll1<=x&&ll2<=y)
for ii=l1:ll1
for jj=l2:ll2
if(I(ii,jj)~=I(l1,l2))
rl=0;
end
end
end
else
rl=0;
end
end
if(ll1<=x&&ll2<=y)
for ii=l1:ll1
for jj=l2:ll2

T1(ii,jj)=w;
if(I(i,j)~=0)
T2(ii,jj)=I(i,j);
else
T2(ii,jj)=1;
end
end
end
end