How do I convert multiple discontinuous lines into a single polyshape?
Afficher commentaires plus anciens
For the image attached, I have the coordinates of the points along each individual line, with these lines having been extracted from a contour map. The blue lines show the low amplitude boundaries, while the yellow lines indicate the direction of increasing amplitude. From these line coordinates I am hoping to create polyshapes.

The issue I'm having is that because some of the lines are discontinuous, going beyond the axes limits, when I fill them in they only fill the region bound by that line, not considering the other lines around them. As such, I was wondering if there was an easy way to have Matlab automatically join up the lines that should contribute to the same region (i.e. the 2 seen in the top left or the 3 at the bottom of the figure below) so that I can get polyshapes of the regions I'm interested in?

Thank you in advance for any help you can offer!
3 commentaires
Star Strider
le 14 Oct 2022
It would help to have the data and the necesary code, including the contour call and the code that extracted the lines. Are the two roughly parallel lines at the lower end supposed to have the area between them filled, instead of the way they’re plotted here?
Also, is it necessary that they all be polyshapes, or do you just want to fill in the areas?
Fraser Douglas
le 14 Oct 2022
Modifié(e) : Fraser Douglas
le 14 Oct 2022
Matt J
le 14 Oct 2022
it isn't entirely necessary to make them into polyshapes, although I was wanting to do this so that I can easily track their centroids.
regionprops(im>0.41,'Centroid')
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Elementary Polygons 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!
