class_docstr: SynthText Text Detection Annotation Parser.
  
  Args:
      split (str): The split of the dataset. It is usually set automatically
          and users do not need to set it manually in config file in most
          cases.
      nproc (int): Number of processes to process the data. Defaults to 1.
          It is usually set automatically and users do not need to set it
          manually in config file in most cases.
      separator (str): The separator between each element in a line. Defaults
          to ','.
      ignore (str): The text to be ignored. Defaults to '###'.
      format (str): The format of the annotation. Defaults to
          'x1,y1,x2,y2,x3,y3,x4,trans'.
      encoding (str): The encoding of the annotation file. Defaults to
          'utf-8-sig'.
      remove_strs (List[str], Optional): Used to remove redundant strings in
          the transcription. Defaults to None.
      mode (str, optional): The mode of the box converter. Supported modes
          are 'xywh' and 'xyxy'. Defaults to None.
class_docstr_tok: ["SynthText","Text","Detection","Annotation","Parser",".","Args",":","split","(","str",")",":","The","split","of","the","dataset",".","It","is","usually","set","automatically","and","users","do","not","need","to","set","it","manually","in","config","file","in","most","cases",".","nproc","(","int",")",":","Number","of","processes","to","process","the","data",".","Defaults","to","1",".","It","is","usually","set","automatically","and","users","do","not","need","to","set","it","manually","in","config","file","in","most","cases",".","separator","(","str",")",":","The","separator","between","each","element","in","a","line",".","Defaults","to","'",",","'",".","ignore","(","str",")",":","The","text","to","be","ignored",".","Defaults","to","'","#","#","#","'",".","format","(","str",")",":","The","format","of","the","annotation",".","Defaults","to","'x1",",","y1",",","x2",",","y2",",","x3",",","y3",",","x4",",","trans","'",".","encoding","(","str",")",":","The","encoding","of","the","annotation","file",".","Defaults","to","'utf-8-sig","'",".","remove_strs","(","List","[","str","]",",","Optional",")",":","Used","to","remove","redundant","strings","in","the","transcription",".","Defaults","to","None",".","mode","(","str",",","optional",")",":","The","mode","of","the","box","converter",".","Supported","modes","are","'xywh","'","and","'xyxy","'",".","Defaults","to","None","."]
docstr: Trace the boundary point of text.
  
  Args:
      char_boxes (list[ndarray]): The char boxes for one text. Each
          element is 4x2 ndarray.
  
  Returns:
      ndarray: The boundary point sets with size nx2.
docstr_tok: ["Trace","the","boundary","point","of","text",".","Args",":","char_boxes","(","list","[","ndarray","]",")",":","The","char","boxes","for","one","text",".","Each","element","is","4x2","ndarray",".","Returns",":","ndarray",":","The","boundary","point","sets","with","size","nx2","."]
code: def _trace_boundary(self, char_boxes: List[np.ndarray]) -> np.ndarray:
      """Trace the boundary point of text.
  
      Args:
          char_boxes (list[ndarray]): The char boxes for one text. Each
              element is 4x2 ndarray.
  
      Returns:
          ndarray: The boundary point sets with size nx2.
      """
      assert is_type_list(char_boxes, np.ndarray)
  
      # from top left to to right
      p_top = [box[0:2] for box in char_boxes]
      # from bottom right to bottom left
      p_bottom = [
          char_boxes[idx][[2, 3], :]
          for idx in range(len(char_boxes) - 1, -1, -1)
      ]
  
      p = p_top + p_bottom
  
      boundary = np.concatenate(p).astype(int)
  
      return boundary
  
file_path: mmocr/mmocr/datasets/preparers/parsers/synthtext_parser.py
imports: import os.path
  from typing import List, Optional, Tuple, Union
  import numpy
  from mmengine import track_parallel_progress
  from scipy.io import loadmat
  from mmocr.utils import is_type_list
  from ..data_preparer import DATA_PARSERS
  from .base import BaseParser
label_desc: Use image node_id 2 for calling the SynthTextAnnParser obj's underlying member method code with example usage: obj._trace_boundary(char_boxes) and returns: boundary