avatar
问个算法的问题# Programming - 葵花宝典
x*l
1
请教大家一个算法的问题。在一个图像里有很多互相不相交的封闭曲线(任意形状),
如何判断任意一个点是在这些封闭曲线内,还是在曲线外?
avatar
c*t
2
easy. There is a scan line method.
Basically, let a horizontal line (or any arbitrary line, but horizontal
is easier computationally) go through the point. Then count the # of
interceptions of the curves on this line. If the point is inside the
curves, then the # of interceptions to the left of the point should be
odd.



【在 x*********l 的大作中提到】
: 请教大家一个算法的问题。在一个图像里有很多互相不相交的封闭曲线(任意形状),
: 如何判断任意一个点是在这些封闭曲线内,还是在曲线外?

avatar
g*g
3
任意画条线,数交点单双。



【在 x*********l 的大作中提到】
: 请教大家一个算法的问题。在一个图像里有很多互相不相交的封闭曲线(任意形状),
: 如何判断任意一个点是在这些封闭曲线内,还是在曲线外?

avatar
x*l
4
3x

【在 c*****t 的大作中提到】
: easy. There is a scan line method.
: Basically, let a horizontal line (or any arbitrary line, but horizontal
: is easier computationally) go through the point. Then count the # of
: interceptions of the curves on this line. If the point is inside the
: curves, then the # of interceptions to the left of the point should be
: odd.
:
: ,

avatar
l*u
5
Sounds good. The only thing is that one needs to be careful in determining
if the line is intersecting, not just tangent, with the curve.

【在 c*****t 的大作中提到】
: easy. There is a scan line method.
: Basically, let a horizontal line (or any arbitrary line, but horizontal
: is easier computationally) go through the point. Then count the # of
: interceptions of the curves on this line. If the point is inside the
: curves, then the # of interceptions to the left of the point should be
: odd.
:
: ,

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。