1

我需要转换坐标。我有这种格式<left> <top> <width> <height> 而且我需要x_center y_center width height这种格式。我该怎么做?

4

1 回答 1

1

中心只是边界框的中间。因此,只需将边界框宽度或高度的一半添加到您的左上角坐标。宽度和高度保持不变

x_center = left + width / 2
y_center = top + height / 2
于 2021-06-18T11:21:57.997 回答