1 year ago
#371371
Fina Noviantika
what is mean of x1=w/2, y1=h/2, cx=x+x1, cy=y+y1 to count the value of bounding box?
for cnt in contours:
(x,y,w,h) = cv2.boundingRect(cnt)
if w > 20 and h > 20:
cv2.rectangle(img, (x,y), (x+w,y+h), (0,255,0), 2)
x1=w/2
y1=h/2
cx=x+x1
cy=y+y1
a.append([cx,cy])
python
opencv
contour
bounding-box
0 Answers
Your Answer