opencv中如何判断一个点是否在一个多边形中
来源:互联网 发布:淘宝产品卖点怎么写 编辑:程序博客网 时间:2024/06/06 01:18
pointPolygonTest()函数可以实现这个功能。
!
double cvPointPolygonTest(const CvArr* contour, CvPoint2D32f pt, int measure_dist)
参数:contour,多边形。 pt将要判断的点。measure_dist 如果为真,则返回的double类型是点距离轮廓的最近的距离。如果为假,返回的值无意义。
参考资料opencv2refman.pdf 297页。
下面为英文原文。
pointPolygonTest
Performs a point-in-contour test.
C++: double pointPolygonTest(InputArray contour, Point2f pt, bool measureDist)
Python: cv2.pointPolygonTest(contour, pt, measureDist) ! retval
C: double cvPointPolygonTest(const CvArr* contour, CvPoint2D32f pt, int measure_dist)
Python: cv.PointPolygonTest(contour, pt, measure_dist) ! float
Parameters
contour – Input contour.
pt – Point tested against the contour.
measureDist – If true, the function estimates the signed distance from the point to the
nearest contour edge. Otherwise, the function only checks if the point is inside a contour or
not.
The function determines whether the point is inside a contour, outside, or lies on an edge (or coincides with a vertex). It
returns positive (inside), negative (outside), or zero (on an edge) value, correspondingly. When measureDist=false
, the return value is +1, -1, and 0, respectively. Otherwise, the return value is a signed distance between the point and
the nearest contour edge.
See below a sample output of the function where each image pixel is tested against the contour.
- opencv中如何判断一个点是否在一个多边形中
- 判断一个点是否在多边形中
- 判断某个点是否在一个多边形中
- c++中如何判断一个点在多边形内部
- 如何判断一个点是否在一个多边形内部(转)
- 如何判断一个点是否在多边形内部ne?
- 如何判断一个点是否在多边形内部?
- 如何判断一个点是否在多边形内?
- 判断一个点是否在多边形内部
- 判断一个点是否在多边形内
- 判断一个点是否在多边形区域内
- 判断一个点是否在多边形内部
- 判断一个点是否在多边形内
- 判断一个点是否在多边形内
- 判断一个点是否在多边形内部
- 判断一个点是否在多边形区域内
- 判断一个点是否在多边形区域内
- 判断一个点是否在多边形区域内
- Poj 3667 Hotel
- 笨鸟后飞
- NLS_Lang 客户端不能被确定
- Windows 核心编程之 模块基地址重定位
- Xcode 4.1~4.6 + iOS 5、iOS 6免证书(iDP)开发+真机调试+生成IPA全攻略
- opencv中如何判断一个点是否在一个多边形中
- DXP Designer9.0 同网络等长布线方法
- 今天结束了自己的编程生涯
- hdu 1199 Color the Ball(离散化线段树)
- android记录(启动线程,脏活放后面)
- Android 在已有布局中动态添加控件
- SQL SERVER 存储过程基本语法
- C# string 转 int 或 float 类型转换
- Linux TC流量控制HOWTO中文版