How to detect if a point is contained within a bounding rect - opecv & python

后端 未结 2 1251
后悔当初
后悔当初 2021-02-20 03:51

I have a set of points [(x0,y0), (x1,y1), .. ]

And a set of bounding rectangles produced using the cv2.boundingRect(someContour) function. Where each boundi

2条回答
  •  忘掉有多难
    2021-02-20 04:09

    1. a,b are the top-left coordinate of the rectangle and (c,d) be its width and height. OpenCV Contour Features
    2. to judge a point(x0,y0) is in the rectangle, just to check if a < x0 < a+c and b < y0 < b + d

提交回复
热议问题