Shortcuts

mmocr.utils.crop_polygon

mmocr.utils.crop_polygon(polygon, crop_box)[源代码]

Crop polygon to be within a box region.

参数
  • polygon (ndarray) – polygon in shape (N, ).

  • crop_box (ndarray) – target box region in shape (4, ).

返回

Cropped polygon. If the polygon is not within the

crop box, return None.

返回类型

np.array or None