code: def crop_area(self, im, text_polys):
      h, w = im.shape[:2]
      h_array = np.zeros(h, dtype=np.int32)
      w_array = np.zeros(w, dtype=np.int32)
      for points in text_polys:
          points = np.round(points, decimals=0).astype(np.int32)
          minx = np.min(points[:, 0])
          maxx = np.max(points[:, 0])
          w_array[minx:maxx] = 1
          miny = np.min(points[:, 1])
          maxy = np.max(points[:, 1])
          h_array[miny:maxy] = 1
      # ensure the cropped area not across a text
      h_axis = np.where(h_array == 0)[0]
      w_axis = np.where(w_array == 0)[0]
  
      if len(h_axis) == 0 or len(w_axis) == 0:
          return 0, 0, w, h
  
      h_regions = self.split_regions(h_axis)
      w_regions = self.split_regions(w_axis)
  
      for i in range(self.max_tries):
          if len(w_regions) > 1:
              xmin, xmax = self.region_wise_random_select(w_regions, w)
          else:
              xmin, xmax = self.random_select(w_axis, w)
          if len(h_regions) > 1:
              ymin, ymax = self.region_wise_random_select(h_regions, h)
          else:
              ymin, ymax = self.random_select(h_axis, h)
  
          if (
              xmax - xmin < self.min_crop_side_ratio * w
              or ymax - ymin < self.min_crop_side_ratio * h
          ):
              # area too small
              continue
          num_poly_in_rect = 0
          for poly in text_polys:
              if not self.is_poly_outside_rect(
                  poly, xmin, ymin, xmax - xmin, ymax - ymin
              ):
                  num_poly_in_rect += 1
                  break
  
          if num_poly_in_rect > 0:
              return xmin, ymin, xmax - xmin, ymax - ymin
  
      return 0, 0, w, h
  
file_path: PaddleOCR/benchmark/PaddleOCR_DBNet/data_loader/modules/random_crop_data.py
imports: import random
  import cv2
  import numpy
label_desc: Use image node_id 8 for calling the EastRandomCropData obj's underlying member method code with example usage: obj.crop_area(im, text_polys) and returns: int,  int,  w,  h, int,  int,  w,  h, xmin,  ymin,  unknown,  unknown