change the output representation
Afficher commentaires plus anciens
In this code for convex hull.... the output image has a white border around the image.... as i have shown in the link....
what should i do to the code so that i dont want the border.... i want the output as
The code i used is...
function convexhull
a=imread('impcon.bmp');
a=a(:,:,3);
o=a;
subplot(2,2,1)
imshow(o)
title('original image');
[r,c]=size(a);
c=[1 0 0;1 0 0;1 0 0 ]
c1=[1 1 1;0 0 0;0 0 0 ];
c2=[0 0 1; 0 0 1;0 0 1];
c3=[0 0 0;0 0 0;1 1 1];
b=a;
for u=1:10
d=(imerode(b,c))|a;
if(b==d)
break;
end
b=d;
end
%-------------
m=a;
for u=1:10
n=(imerode(m,c1))|a;
if(m==n)
break;
end
m=n;
end
%-------------
p=a;
for u=1:10
l=(imerode(p,c2))|a;
if(p==l)
break;
end
p=l;
end
%-------------
z=a;
for u=1:10
v=(imerode(z,c3))|a;
if(z==v)
break;
end
z=v;
end
%-------------
H=z|p|m|b;
subplot(2,2,2)
imshow(H)
title('convex Hull of image');
Please show me where to change the code.... so that i get the output as shown in the second link.....please do reply....
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Geometric Transformation and Image Registration dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!