mvoelk/ssd_detectors

polygon_to_rbox3 average height

eugene123tw opened this issue · 1 comments

I am wondering why the average height is compute as h = (norm(np.cross(dt, tl-br)) + norm(np.cross(dt, tr-bl))) / (2*(norm(dt)+eps)) in polygon_to_rbox3 function? Why didn't just compute like this (norm(tr - br) + norm(tl - bl))/2?

Original code reference: https://github.com/mvoelk/ssd_detectors/blob/master/utils/bboxes.py#L60

If I remember correctly, it compensates better for distorted rectangles. As an example, you have an image with size 800x600 and oriented bounding boxes defined as polygons. After resizing the image to 512x512, the aspect ratio changes and you end up with distorted rectangles.