Question regarding finding the boundaries (vertices) of a series of data points on a 2D space
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a series of x,y data that form a distinct closed shape (this shape is not a geometrical shape like circle, sphere, etc.). My problem is how to test if a new given point would fall inside or outside this shape. It seems that "inpolygon" function of matlab can answer my question, but that function requires the vertices of the object but my data is x/y info of all points that form the shape. Is there an already available function that I can use to find the vertices of these data? also, do you have any other suggestion instead of "inpolygon" for inside/outside problem? I greatly appreciate your response.
Regards, NF
2 个评论
Sven
2011-11-15
So when you say "my data is x/y info of all points that form the shape", you mean that you *don't* have vertex data of the *boundaries*, you instead have data of every point *inside* the shape?
Are all of your points in a regular grid? Can you use bwboundaries?
It will certainly help if you can show a small piece of code that demonstrates your problem.
回答(1 个)
Image Analyst
2011-11-15
Have you taken a look at the convex hull, convhull()? That will give you the coordinates of the exterior perimeter points, just as if you have wrapped a rubber band around your points.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!