Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要转换坐标。我有这种格式<left> <top> <width> <height> 而且我需要x_center y_center width height这种格式。我该怎么做?
<left> <top> <width> <height>
x_center y_center width height
中心只是边界框的中间。因此,只需将边界框宽度或高度的一半添加到您的左上角坐标。宽度和高度保持不变
x_center = left + width / 2 y_center = top + height / 2