本文介绍了如何检测一个点是否包含在一个边界矩形内 - opecv &Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
a,b 是矩形的左上角坐标,(c,d) 是它的宽度和高度.OpenCV 轮廓特征立> 判断一个点(x0,y0)是否在矩形内,只要检查a <x0<a+c 和 b
我有一组点 [(x0,y0), (x1,y1), .. ]
I have a set of points [(x0,y0), (x1,y1), .. ]
以及使用 cv2.boundingRect(someContour) 函数生成的一组边界矩形.其中每个边界框都是一个具有四个坐标 (a,b,c,d) 的可迭代对象.我的问题是:
And a set of bounding rectangles produced using the cv2.boundingRect(someContour) function. Where each bounding box is an iterable object with four coordinates (a,b,c,d). My questions are:
这四个数字是什么意思?
what is the meaning of these four numbers?.
如何检查每个给定点是否包含在边界矩形内?
how to check if each given point is contained within the bounding rect?
我知道 C++ 的 opencv 有 'contains' 方法,但它不存在于 python.
I know that opencv for C++ has the 'contains' method but it doesnt exist for python.
推荐答案更多推荐
如何检测一个点是否包含在一个边界矩形内
发布评论