ovl.math.image module

ovl.math.image.distance_from_frame(point, image_dimensions)[source]

Calculates the distance of a given point from the frame of the image based on the vector from the center and the point

Parameters:
  • point – point (x,y tuple) or contour (numpy array)
  • image_dimensions – the size of the image, (width, height)
Returns:

the distance

ovl.math.image.image_center(image_dimensions)[source]

Calculates the center pixels of a given image dimension

Parameters:image_dimensions – (width, height) tuple of the size of the image
Returns:the (x, y) center of the image
ovl.math.image.image_size(image: numpy.ndarray) → int[source]

Calculates the size of the given image in pixels

Parameters:image – ndarray image in pixels
Returns:the image size