class_docstr: Generate the ground truth targets of FCENet: Fourier Contour Embedding
  for Arbitrary-Shaped Text Detection.
  
  [https://arxiv.org/abs/2104.10442]
  
  Args:
      fourier_degree (int): The maximum Fourier transform degree k.
      resample_step (float): The step size for resampling the text center
          line (TCL). It's better not to exceed half of the minimum width.
      center_region_shrink_ratio (float): The shrink ratio of text center
          region.
      level_size_divisors (tuple(int)): The downsample ratio on each level.
      level_proportion_range (tuple(tuple(int))): The range of text sizes
          assigned to each level.
docstr: Resample one polygon with n points on its boundary.
  
  Args:
      polygon (list[float]): The input polygon.
      n (int): The number of resampled points.
  Returns:
      resampled_polygon (list[float]): The resampled polygon.
docstr_tok: ["Resample","one","polygon","with","n","points","on","its","boundary",".","Args",":","polygon","(","list","[","float","]",")",":","The","input","polygon",".","n","(","int",")",":","The","number","of","resampled","points",".","Returns",":","resampled_polygon","(","list","[","float","]",")",":","The","resampled","polygon","."]
code: def resample_polygon(self, polygon, n=400):
      """Resample one polygon with n points on its boundary.
  
      Args:
          polygon (list[float]): The input polygon.
          n (int): The number of resampled points.
      Returns:
          resampled_polygon (list[float]): The resampled polygon.
      """
      length = []
  
      for i in range(len(polygon)):
          p1 = polygon[i]
          if i == len(polygon) - 1:
              p2 = polygon[0]
          else:
              p2 = polygon[i + 1]
          length.append(
              ((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2) ** 0.5
          )
  
      total_length = sum(length)
      n_on_each_line = (np.array(length) / (total_length + 1e-8)) * n
      n_on_each_line = n_on_each_line.astype(np.int32)
      new_polygon = []
  
      for i in range(len(polygon)):
          num = n_on_each_line[i]
          p1 = polygon[i]
          if i == len(polygon) - 1:
              p2 = polygon[0]
          else:
              p2 = polygon[i + 1]
  
          if num == 0:
              continue
  
          dxdy = (p2 - p1) / num
          for j in range(num):
              point = p1 + dxdy * j
              new_polygon.append(point)
  
      return np.array(new_polygon)
  
imports: import cv2
  import numpy
  from numpy.fft import fft
  from numpy.linalg import norm
  import sys
label_desc: Use image node_id 8 for calling the FCENetTargets obj's underlying member method code with example usage: obj.resample_polygon(polygon, n) and returns: np