cgvict / roLabelImg

Label Rotated Rect On Images for training
824 stars 223 forks source link

Cannot figure out which axis is reference for rotation angle #24

Closed handenurc closed 3 years ago

handenurc commented 3 years ago

When I draw rotated boxes, I'd like to have it an angle between 0 and 2pi. However, I still couldn't figure out which axis was taken as reference and how the rotation angle is calculated. Any help would be appreciated.

LeCongThuong commented 3 years ago

I have the same problem, @handenurc have you figured out how to calculate the rotation angle?

handenurc commented 3 years ago

To test it, I started with a thin horizontal box and created a set of new boxes in which I rotate incrementally by counter clockwise for each new box. Although I still couldn't figure out the exact relation between the reference axis and angles but at least I found a way to properly got consistent angle values for the boxes. For instance, If I'd like to achieve 330 degrees (counter-cw) (by taking y- axis as reference) instead of 30 degrees (cw), I rotated my box counter clockwise (by pressing x on keyboard as shortcut) until I reach 330. I applied same rotation direction for creating all of the boxes. Hope I could be able to explain my way and it helps.