code: def generate_center_mask_attrib_maps(self, img_size, text_polys):
      assert isinstance(img_size, tuple)
  
      h, w = img_size
  
      center_lines = []
      center_region_mask = np.zeros((h, w), np.uint8)
      top_height_map = np.zeros((h, w), dtype=np.float32)
      bot_height_map = np.zeros((h, w), dtype=np.float32)
      sin_map = np.zeros((h, w), dtype=np.float32)
      cos_map = np.zeros((h, w), dtype=np.float32)
  
      for poly in text_polys:
          polygon_points = poly
          _, _, top_line, bot_line = self.reorder_poly_edge(
              polygon_points
          )
          (
              resampled_top_line,
              resampled_bot_line,
          ) = self.resample_sidelines(
              top_line, bot_line, self.resample_step
          )
          resampled_bot_line = resampled_bot_line[::-1]
          center_line = (resampled_top_line + resampled_bot_line) / 2
  
          if self.vector_slope(center_line[-1] - center_line[0]) > 2:
              if (center_line[-1] - center_line[0])[1] < 0:
                  center_line = center_line[::-1]
                  resampled_top_line = resampled_top_line[::-1]
                  resampled_bot_line = resampled_bot_line[::-1]
          else:
              if (center_line[-1] - center_line[0])[0] < 0:
                  center_line = center_line[::-1]
                  resampled_top_line = resampled_top_line[::-1]
                  resampled_bot_line = resampled_bot_line[::-1]
  
          line_head_shrink_len = (
              np.clip(
                  (
                      norm(top_line[0] - bot_line[0])
                      * self.comp_w_h_ratio
                  ),
                  self.min_width,
                  self.max_width,
              )
              / 2
          )
          line_tail_shrink_len = (
              np.clip(
                  (
                      norm(top_line[-1] - bot_line[-1])
                      * self.comp_w_h_ratio
                  ),
                  self.min_width,
                  self.max_width,
              )
              / 2
          )
          num_head_shrink = int(
              line_head_shrink_len // self.resample_step
          )
          num_tail_shrink = int(
              line_tail_shrink_len // self.resample_step
          )
          if len(center_line) > num_head_shrink + num_tail_shrink + 2:
              center_line = center_line[
                  num_head_shrink : len(center_line) - num_tail_shrink
              ]
              resampled_top_line = resampled_top_line[
                  num_head_shrink : len(resampled_top_line)
                  - num_tail_shrink
              ]
              resampled_bot_line = resampled_bot_line[
                  num_head_shrink : len(resampled_bot_line)
                  - num_tail_shrink
              ]
          center_lines.append(center_line.astype(np.int32))
  
          self.draw_center_region_maps(
              resampled_top_line,
              resampled_bot_line,
              center_line,
              center_region_mask,
              top_height_map,
              bot_height_map,
              sin_map,
              cos_map,
              self.center_region_shrink_ratio,
          )
  
      return (
          center_lines,
          center_region_mask,
          top_height_map,
          bot_height_map,
          sin_map,
          cos_map,
      )
  
imports: import cv2
  import numpy
  from ppocr.utils.utility import check_install
  from numpy.linalg import norm
label_desc: Use image node_id 13 for calling the DRRGTargets obj's underlying member method code with example usage: obj.generate_center_mask_attrib_maps(img_size, text_polys) and returns: center_lines,  center_region_mask,  top_height_map,  bot_height_map,  sin_map,  cos_map