[英]find the smallest containing convex polygon with a given number of points
given a convex polgyon and a number N, how do I find the smallest polygon that 给定一个凸polgyon和一个数字N,我如何找到最小的多边形
For example, suppose I have a set of points and compute the convex hull for them (green). 例如,假设我有一组点并计算它们的凸包(绿色)。 Now I want to find the smallest quadrangle that contains all the points (red)
现在我想找到包含所有点的最小四边形(红色)
It is easy to see that any other polygon with 4 corners would either be bigger or fail to contain all the points. 很容易看出,任何其他具有4个角的多边形要么更大,要么不能包含所有点。 But how do I find this polygon in the general case?
但是如何在一般情况下找到这个多边形呢?
EDIT: 编辑:
With smallest polygon I mean the the one that covers the smallest area, although I am not sure whether the smallest circumference would give different results. 最小的多边形是指覆盖最小区域的多边形,但我不确定最小的圆周是否会产生不同的结果。
I added two more example pictures that unfortunately do not seem to work with the 'remove edges' approach in one of the answers 我添加了另外两个示例图片,遗憾的是,这些图片似乎与其中一个答案中的“删除边缘”方法无关
Some background information: 一些背景资料:
The goal is to accurately determine shapes with image recognition. 目标是通过图像识别准确地确定形状。 For example take a foto of a cuboid.
例如拍摄一个长方体的照片。 All points inside the box in the 2D-photo will be contained in a 6-corner convex polygon.
2D照片中框内的所有点都将包含在6角凸多边形中。 However since real-world shapes do not have perfect corners, and the camera adds some blur, the edges of this polygon will be rounded.
然而,由于真实世界的形状没有完美的角落,并且相机增加了一些模糊,因此该多边形的边缘将是圆形的。 See the attached image from the question Getting corners from convex points
请参阅问题从凸点获取角落的附图
You need to define the notion of "smallest" in your question. 您需要在问题中定义“最小”的概念。 Whatever your definition, this question has been heavily studied in the computational geometry literature.
无论您的定义是什么,这个问题都在计算几何文献中得到了深入的研究。 The key search phrase is minimal enclosing k-gon :
关键搜索短语是最小的封闭k-gon :
The general algorithms are not simple (although algorithms for min area triangles or rectangles are simple). 一般算法并不简单(尽管最小区域三角形或矩形的算法很简单)。 Depending on your goals, you might have to abandon any mathematical notion of "smallest" and head for a heuristic.
根据您的目标,您可能不得不放弃任何“最小”的数学概念并前往启发式。
While number of edges > N do
remove the shortest edge by replacing its endpoints
with the intersection point of the adjacent edges
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.