Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

SEPERATING CONNECTED COMPONENTS IN AN IMAGE

1 Ansicht (letzte 30 Tage)
BALIREDDY
BALIREDDY am 30 Jan. 2014
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I have binarised an image and found all the connected components..now i have to find the largest connected component,its height to width ratio and its centroid..for that i had written a code but it is showing errors
[l,n]=bwconncomp(binaryimagename,8);
for k1=1:n
[r,c]=find(l==k1);
rbar=mean(r(k1));
cbar=mean(c(k1));
r1(k1)=max(r(k1));
c1(k1)=max(c(k1));
r2(k1)=min(r(k1));
c2(k1)=min(c(k1));
len(k1)=r1(k1)-r2(k1);
wid(k1)=c1(k1)-c2(k1);
end

Antworten (1)

Image Analyst
Image Analyst am 30 Jan. 2014
Use regionprops for that. See my tutorial in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by