Issue
I need to convert the coordinates. I have this format <left> <top> <width> <height>
And I need x_center y_center width height
in this format. How can I do it?
Solution
The center is just the middle of your bounding box. So just add half of the bounding box width or height to yout top-left coordinate. Width and height remain unchanged
x_center = left + width / 2
y_center = top + height / 2
Answered By - Sanoronas
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.