如何找到椭圆和图像中间的垂直线之间的角度?

how to find angle between an ellipse and a vertical line that is in the middle of the image?

我正在使用这段代码: http://blogs.mathworks.com/steve/2010/07/30/visualizing-regionprops-ellipse-measurements/ 围绕一个对象制作一个椭圆。我怎样才能找到从椭圆中心到图像中间垂直线的角度?

椭圆的长轴与 x 轴之间的角度由 regionpropsOrientation 属性 给出。 角度以度为单位,介于 -90° 和 +90° 之间。 我假设您使用的正是上述代码。 Orientation 值已经计算出来并用于绘制椭圆。

你因此获得了

的价值
s(k).Orientation

如果您想获得从长轴到垂直线的角度,只需将该角度加上 90° 即可。结果将在 0° 和 180° 之间的范围内。