x*********l 发帖数: 594 | 1 请教大家一个算法的问题。在一个图像里有很多互相不相交的封闭曲线(任意形状),
如何判断任意一个点是在这些封闭曲线内,还是在曲线外? | c*****t 发帖数: 1879 | 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 的大作中提到】 : 请教大家一个算法的问题。在一个图像里有很多互相不相交的封闭曲线(任意形状), : 如何判断任意一个点是在这些封闭曲线内,还是在曲线外?
| g*****g 发帖数: 34805 | 3 任意画条线,数交点单双。
,
【在 x*********l 的大作中提到】 : 请教大家一个算法的问题。在一个图像里有很多互相不相交的封闭曲线(任意形状), : 如何判断任意一个点是在这些封闭曲线内,还是在曲线外?
| x*********l 发帖数: 594 | 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. : : ,
| l******u 发帖数: 1174 | 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. : : ,
|
|