Shortcuts

mmocr.utils.poly_intersection

mmocr.utils.poly_intersection(poly_a, poly_b, invalid_ret=None, return_poly=False)[source]

Calculate the intersection area between two polygons.

Parameters
  • poly_a (Polygon) – Polygon a.

  • poly_b (Polygon) – Polygon b.

  • invalid_ret (float or int, optional) – The return value when the invalid polygon exists. If it is not specified, the function allows the computation to proceed with invalid polygons by cleaning the their self-touching or self-crossing parts. Defaults to None.

  • return_poly (bool) – Whether to return the polygon of the intersection Defaults to False.

Returns

Returns the intersection area or a tuple (area, Optional[poly_obj]), where the area is the intersection area between two polygons and poly_obj is The Polygon object of the intersection area, which will be None if the input is invalid. poly_obj will be returned only if return_poly is True.

Return type

float or tuple(float, Polygon)

Read the Docs v: dev-1.x
Versions
latest
stable
v1.0.1
v1.0.0
0.x
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.