How to get set of outermost points out of given data set

34 views (last 30 days)
I have a planar data set of points. I want to points which are outermost points of the data set. For more clarification pleasee attached images.
1) Availabe data set.
2) Expected output
I hope this clarifies my question.
I tried using boundary function but it lacks accurecy even at shink coeff = 1.
Anyone know how to get tight boundary around points data set?
Thank you.
  4 Comments

Sign in to comment.

Answers (2)

darova
darova on 7 May 2020
I calculated angle of each point. Sortet by angle to put them in some order
Used polyxpoly to find intersection points
polyxpoly also return indices/numbers of points/segments are intersected
result
  2 Comments
John D'Errico
John D'Errico on 7 May 2020
Edited: John D'Errico on 7 May 2020
+1. Best to do is as suggested here. Treat it as two polygons, then combine them into one. As a thought, this might be doable using polyshapes.

Sign in to comment.


John D'Errico
John D'Errico on 6 May 2020
Edited: John D'Errico on 6 May 2020
Has nobody answered you? Oh well. here goes. Part of the problem is you only showed a picture of your data. A picture may be worth a thousands words, but some data too? Way more, at least if you seriously want help. That is, I would probably have answered your question a day or so ago, if you did. I'm not going to make up some data though that is similar to what you have, so if you want better help, then make it easier to provide help.
I would use an alpha shape. You need to be careful though. Don't use too small of a value for the alpha radius. You also need to control how it deals with internal holes.
You can find the alpha shape tool in MATLAB as just alphaShape. You can then find the boundary polygon as one of the methods offered for the alpha shape. That will be what you need.
There will be only one problem - the internal cusp where the elliptical curve crosses the other curve. That will be difficult to resolve using an alpha shape on this data.
  2 Comments
Kaustubh Tiwarekar
Kaustubh Tiwarekar on 7 May 2020
Edited: Kaustubh Tiwarekar on 7 May 2020
Thank you for your suggestion John.
I tried using alphShape function but I am unable to get rid of internal points. Please see if that can be achieved. I have also attached data set in the question, you can use the data in x-z plane (y is a constant value).
Thank you.
John D'Errico
John D'Errico on 7 May 2020
Hmm. It looks like an alpha shape does not do your data justice. That is because parts of your data are too sparse, too widely separated from their neighbors, while the intersection that you will need to resolve is a sharp internal cusp. An alpha shape will be a poor solution here.
Use what Darova is suggesting instead.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!