I am trying to get axis-aligned bounding box by commenting out some lines in the original project(https://github.com/foolwood/SiamMask). These lines are -- pbox = cv2.boundingRect(polygon) # Min Max Rectangle box_in_img = pbox. But getting the following error: tuple object doesnot have flatten. but flatten() previously worked with rotated bounding boxes. If I remove flatten to execute the code, the error is gone but I am getting wrong bounding boxes like this--
I have matched results in every steps of axis aligned to rotated bounding box version, they match completely, just the flatten() does not work. Please give some ideas to solve this issue.