class_docstr: Polygon to Rotated Box, using new OpenCV definition since 4.5.1
  
  Args:
      filter_threshold (int, float): threshold to filter annotations
      filter_mode (str): filter mode, ['area', 'edge']
      rbox_type (str): rbox type, ['le135', 'oc']
class_docstr_tok: ["Polygon","to","Rotated","Box",",","using","new","OpenCV","definition","since","4.5.1","Args",":","filter_threshold","(","int",",","float",")",":","threshold","to","filter","annotations","filter_mode","(","str",")",":","filter","mode",",","[","'area","'",",","'edge","'","]","rbox_type","(","str",")",":","rbox","type",",","[","'le135","'",",","'oc","'","]"]
code: def get_rbox(self, polys):
      valid_ids, rboxes, bboxes = [], [], []
      for i, poly in enumerate(polys):
          cx, cy, w, h, angle = self.rbox_fn(poly)
          if self.filter_fn((w, h)):
              continue
          rboxes.append(
              np.array([cx, cy, w, h, angle], dtype=np.float32)
          )
          valid_ids.append(i)
          xmin, ymin = min(poly[0::2]), min(poly[1::2])
          xmax, ymax = max(poly[0::2]), max(poly[1::2])
          bboxes.append(
              np.array([xmin, ymin, xmax, ymax], dtype=np.float32)
          )
  
      if len(valid_ids) == 0:
          rboxes = np.zeros((0, 5), dtype=np.float32)
          bboxes = np.zeros((0, 4), dtype=np.float32)
      else:
          rboxes = np.stack(rboxes)
          bboxes = np.stack(bboxes)
  
      return rboxes, bboxes, valid_ids
  
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  from numbers import Number, Integral
  import cv2
  import numpy
  import math
  import copy
  from .operators import register_op, BaseOperator
  from ppdet.modeling.rbox_utils import poly2rbox_le135_np, poly2rbox_oc_np, rbox2poly_np
  from ppdet.utils.logger import setup_logger
  from ppdet.utils.compact import imagedraw_textsize_c
label_desc: Use image node_id 3 for calling the Poly2RBox obj's underlying member method code with example usage: obj.get_rbox(polys) and returns: rboxes,  bboxes,  valid_ids