Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Explain this code, what happen for field_11 ?? i can not understand this code

1 visualización (últimos 30 días)
mohammed alany
mohammed alany el 5 de Abr. de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
% im2 = binary image;
field_l1 = bwmorph(im2,'thin',inf);
while(1)
E_pts=[];
for i=2:size(field_l1,1)-1
for j=2:size(field_l1,2)-1
if(field_l1(i,j)==1)
A=double(field_l1(i-1:i+1,j-1:j+1));
if(sum(A(:))==2)
E_pts=[E_pts;i j];
end
end
end
end
if(isempty(E_pts))
break
end
for i=1:size(E_pts,1)
curr_pt=E_pts(i,:);
field_l1(curr_pt(1),curr_pt(2))=0;
flag=0;
while(1)
pts=[];
for j=-1:1
for k=-1:1
if(field_l1(curr_pt(1)+j,curr_pt(2)+k)==1)
pts=[pts;curr_pt(1)+j curr_pt(2)+k];
end
end
end
if(isempty(pts))
break
end
if(size(pts,1)>1)
break;
else
curr_pt=pts(1,:);
field_l1(curr_pt(1),curr_pt(2))=0;
end
% figure(3)
% imshow(field_l1)
% drawnow
% pause(0.1)
end
end
se=strel('disk',1);
field_l1=imdilate(field_l1,se);
field_l1 = bwmorph(field_l1,'thin',inf);
end

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by