cv3.utils.xyxy2ccwh

cv3.utils.xyxy2ccwh(x0, y0, x1, y1)[source]

Convert from (x0, y0, x1, y1) to (center_x, center_y, width, height) format.

Parameters:
  • x0 (float) – X-coordinate of the top-left corner.

  • y0 (float) – Y-coordinate of the top-left corner.

  • x1 (float) – X-coordinate of the bottom-right corner.

  • y1 (float) – Y-coordinate of the bottom-right corner.

Returns:

(center_x, center_y, width, height) representation of the rectangle.

Return type:

tuple