class_docstr: Convert scores to quadrangles via post processing in PANet. This is
  partially adapted from https://github.com/WenmuZhou/PAN.pytorch.
  
  Args:
      text_repr_type (str): The boundary encoding type 'poly' or 'quad'.
          Defaults to 'poly'.
      score_threshold (float): The minimal text score.
          Defaults to 0.3.
      rescale_fields (list[str]): The bbox/polygon field names to
          be rescaled. If None, no rescaling will be performed. Defaults to
          ['polygons'].
      min_text_confidence (float): The minimal text confidence.
          Defaults to 0.5.
      min_kernel_confidence (float): The minimal kernel confidence.
          Defaults to 0.5.
      distance_threshold (float): The minimal distance between the point to
          mean of text kernel. Defaults to 3.0.
      min_text_area (int): The minimal text instance region area.
          Defaults to 16.
      downsample_ratio (float): Downsample ratio. Defaults to 0.25.
docstr: Convert a text mask represented by point coordinates sequence into a
  text boundary.
  
  Args:
      points (ndarray): Mask index of size (n, 2).
      min_width (int): Minimum bounding box width to be converted. Only
          applicable to 'quad' type. Defaults to 0.
  
  Returns:
      list[float]: The text boundary point coordinates (x, y) list.
      Return [] if no text boundary found.
docstr_tok: ["Convert","a","text","mask","represented","by","point","coordinates","sequence","into","a","text","boundary",".","Args",":","points","(","ndarray",")",":","Mask","index","of","size","(","n",",","2",")",".","min_width","(","int",")",":","Minimum","bounding","box","width","to","be","converted",".","Only","applicable","to","'quad","'","type",".","Defaults","to","0",".","Returns",":","list","[","float","]",":","The","text","boundary","point","coordinates","(","x",",","y",")","list",".","Return","[","]","if","no","text","boundary","found","."]
code: def _points2boundary(
      self, points: np.ndarray, min_width: int = 0
  ) -> List[float]:
      """Convert a text mask represented by point coordinates sequence into a
      text boundary.
  
      Args:
          points (ndarray): Mask index of size (n, 2).
          min_width (int): Minimum bounding box width to be converted. Only
              applicable to 'quad' type. Defaults to 0.
  
      Returns:
          list[float]: The text boundary point coordinates (x, y) list.
          Return [] if no text boundary found.
      """
      assert isinstance(points, np.ndarray)
      assert points.shape[1] == 2
      assert self.text_repr_type in ["quad", "poly"]
  
      if self.text_repr_type == "quad":
          rect = cv2.minAreaRect(points)
          vertices = cv2.boxPoints(rect)
          boundary = []
          if min(rect[1]) >= min_width:
              boundary = [p for p in vertices.flatten().tolist()]
      elif self.text_repr_type == "poly":
          height = np.max(points[:, 1]) + 10
          width = np.max(points[:, 0]) + 10
  
          mask = np.zeros((height, width), np.uint8)
          mask[points[:, 1], points[:, 0]] = 255
  
          contours, _ = cv2.findContours(
              mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE
          )
          boundary = list(contours[0].flatten().tolist())
  
      if len(boundary) < 8:
          return []
  
      return boundary
  
file_path: mmocr/mmocr/models/textdet/postprocessors/pan_postprocessor.py
imports: from typing import List, Sequence
  import cv2
  import numpy
  import torch
  from mmcv.ops import pixel_group
  from mmengine.structures import InstanceData
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from .base import BaseTextDetPostProcessor
label_desc: Use image node_id 3 for calling the PANPostprocessor obj's underlying member method code with example usage: obj._points2boundary(points, min_width) and returns: boundary, list