mt.geo2d.iou

Intersection over Union. In the current primitive form, it is treated as a separate module.

Functions

  • iou(): Computes the Intersection-over-Union ratio of two (sets of non-overlapping) 2D geometry objects. Right now we only accept Rect and Polygon.

mt.geo2d.iou.iou(geo2d_obj1, geo2d_obj2)

Computes the Intersection-over-Union ratio of two (sets of non-overlapping) 2D geometry objects. Right now we only accept Rect and Polygon.

Parameters:
  • geo2d_obj1 (Rect or Polygon or list of non-overlapping geometric objects of these types) – the first 2D geometry object

  • geo2d_obj2 (Rect or Polygon or list of non-overlapping geometric objects of these types) – the second 2D geometry object

Returns:

the IoU ratio of the two objects, regardless of whether they are sepcified in clockwise or counter-clockwise order

Return type:

float