I am trying to get the pixel coordinate values for the point detected using the open pose. Can someone tell me is this the correct way to identify the pixel coordinates or is there any other particular way to get the pixel coordinates represented as 2 and 5 in the below image?
code:
for pair in POSE_PAIRS:
partA = pair[0]
partB = pair[1]
print("{}".format(partA),"{}".format(partB))
if partA == 2 and partB == 5:
print("heere")
cv2.line(frame, points[partA], points[partB], (0, 0, 0), 2)
cv2.circle(frame, points[partA], 8, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)
else :
cv2.line(frame, points[partA], points[partB], (0, 255, 255), 2)
cv2.circle(frame, points[partA], 8, (0, 0, 255), thickness=-1, lineType=cv2.FILLED)
rc = cv2.minAreaRect(partA)
box = cv2.boxPoints(rc)
for p in box:
pt = (p[0],p[1])
print (pt)
error :
Traceback (most recent call last): File "OpenPoseImage.py", line 92, in rc = cv2.minAreaRect(partA) cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\convhull.cpp:137: error: (-215:Assertion failed) total >= 0 && (depth == CV_32F || depth == CV_32S) in function 'cv::convexHull'