Created
April 28, 2020 18:48
-
-
Save aravindpai/f0b48efe693956bff63540faa919a896 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) | |
_ = cv2.circle(img, 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