cv3.utils.abs2rel

cv3.utils.abs2rel(*coords, width, height)[source]

Convert absolute coordinates to relative coordinates.

Parameters:
  • *coords – Iterable of coordinates in the form (x0, y0, x1, y1, …, xn, yn).

  • width (int) – Width of the image or reference frame.

  • height (int) – Height of the image or reference frame.

Yields:

float – Relative coordinates in the range [0, 1].

Raises:

AssertionError – If the number of coordinates is not even.