边界椭圆约束到水平/垂直轴 [英] Bounding ellipse constrained to horizontal/vertical axes

查看:138
本文介绍了边界椭圆约束到水平/垂直轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文:我想要夹一的地形图到围绕着一些风力涡轮机的最小尺寸的椭圆形,以减少地图的大小。程序执行此地图裁剪可以夹在椭圆的,但只与轴椭圆沿x轴和y轴对齐。

Context: I'm trying to clip a topographic map into the minimum-size ellipse around a number of wind turbines, to minimize the size of the map. The program doing this map clipping can clip in ellipses, but only ellipses with axes aligned along the x and y axes.

我知道算法边界椭圆问题(发现的最小面积椭圆包围的一组点)。

I know the algorithm for the bounding ellipse problem (finding the smallest-area ellipse that encloses a set of points).

但如何约束本算法(或使不同的算法),使得所得到的椭圆需要具有其长轴取向水平或垂直,取其给出最小的椭圆 - 永不以角度θ

But how do I constrain this algorithm (or make a different algorithm) such that the resulting ellipse is required to have its major axis oriented either horizontally or vertically, whichever gives the smallest ellipse -- and never at an angle?

当然,这种限制使得生成的椭圆比它需要大要附上所有的点,但是这是约束仍然。

Of course, this constraint makes the resulting ellipse larger than it "needs" to be to enclose all the points, but that's the constraint nonetheless.

推荐答案

描述的算法这里(在你提供的链接引用)是关于解决以下优化问题:

The algorithm described here (referenced in the link you provided) is about solving the following optimization problem:

minimize log(det(A))
s.t. (P_i - c)'*A*(P_i - c)<= 1

一个可以扩展的不平等的这个系统具有下列约束条件(V是椭圆旋转矩阵,详细信息请参考上面的链接):

One can extend this system of inequalities with the following constraint (V is the ellipse rotation matrix, for detailed info refer the link above):

V == [[1, 0], [0, 1]] // horizontal ellipse

V == [[0, -1], [1, 0]] // vertical ellipse

解决与其中任一约束的优化问题和计算产生的椭圆广场会给你所需的结果。

Solving the optimization problem with either of these constraints and calculating the square of the resulting ellipses will give you the required result.

这篇关于边界椭圆约束到水平/垂直轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆