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 apply(self, sample, context=None):
      rboxes, bboxes, valid_ids = self.get_rbox(sample["gt_poly"])
      sample["gt_rbox"] = rboxes
      sample["gt_bbox"] = bboxes
      for k in [
          "gt_class",
          "gt_score",
          "gt_poly",
          "is_crowd",
          "difficult",
      ]:
          if k in sample:
              sample[k] = sample[k][valid_ids]
  
      return sample
  
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 4 for calling the Poly2RBox obj's underlying member method code with example usage: obj.apply(sample, context) and returns: sample