Mean line of object boundary
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Montree
il 2 Gen 2015
Commentato: Image Analyst
il 5 Gen 2015
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146663/image.jpeg)
I have sample picture as above. I want to find average line of this object. Who have any idea to do that?
1 Commento
Risposta accettata
Mohammad Abouali
il 4 Gen 2015
Another Approach could be this:
B1=bwmorph(logical( round( double(imread('1_1.bmp'))/255 ) ),'skel','inf');
B2=bwmorph(logical( round( double(imread('1_2.bmp'))/255 ) ),'skel','inf');
B3=bwmorph(logical( round( double(imread('1_3.bmp'))/255 ) ),'skel','inf');
D1=bwdist(B1);
D2=bwdist(B2);
D3=bwdist(B3);
D=D1+D2+D3;
mask=bwmorph(bwmorph(D<50,'thin','inf'),'spur',100);
FinalImage(:,:,1)=B1+mask;
FinalImage(:,:,2)=B2+mask;
FinalImage(:,:,3)=B3+mask;
Although I have to mention that this is not averaging the borders. The resulting border is the white line in the following image:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172758/image.jpeg)
2 Commenti
Image Analyst
il 5 Gen 2015
Looks like you're all set. If you do want the average though, you can still use my code.
Più risposte (1)
Image Analyst
il 3 Gen 2015
How about this method:
Convert to binary images and AND them then find the centroid and send out rays from the centroid to each perimeter to find the radii. Then average the radii. Could use cart2pol and pol2cart to help.
Can you supply the 3 lists of (x,y) or (row, column) coordinates?
6 Commenti
Vedere anche
Categorie
Scopri di più su Lighting, Transparency, and Shading in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!