Skip to content

Instantly share code, notes, and snippets.

@aravindpai aravindpai/
Created Apr 28, 2020

What would you like to do?
#define a function which return the bottom center of every bbox
def mid_point(img,person,idx):
#get the coordinates
x1,y1,x2,y2 = person[idx]
_ = cv2.rectangle(img, (x1, y1), (x2, y2), (0,0,255), 2)
#compute bottom center of bbox
x_mid = int((x1+x2)/2)
y_mid = int(y2)
mid = (x_mid,y_mid)
_ =, mid, 5, (0, 0, 255), -1)
cv2.putText(img, str(idx), mid, cv2.FONT_HERSHEY_SIMPLEX,1, (255, 255, 255), 2, cv2.LINE_AA)
return mid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.