I have a below python code which detect person in frame. Once detected, it get the bounding box of the person which is person_box. From person_box I can get the startX, startY and width height of the bounding box. But in below code, in for loop, I am getting error as numpy.int32 object is not iterable
person_box = person_detections[0, 0, i, 3:7] * np.array([W, H, W, H])
person_box = person_box.astype(int)
print(person_box)
(startX, startY, endX, endY) = person_box.astype("int")
width = endX - startX
height = endY - startY
for (startX, startY, width, height) in person_box:
person_box = np.array([startX, startY, startX + width, startY + height])
output
[159 156 451 431]
I am not able to understand the error much as I am not much experienced with numpy arrays. Please help. Thanks.