docstr: reference from: https://github.com/jrosebr1/imutils/blob/master/imutils/perspective.py
  # sort the points based on their x-coordinates
docstr_tok: ["reference","from",":","https",":","\/\/github.com\/jrosebr1\/imutils\/blob\/master\/imutils\/perspective.py","#","sort","the","points","based","on","their","x-coordinates"]
code: def order_points_clockwise(self, pts):
      """
      reference from: https://github.com/jrosebr1/imutils/blob/master/imutils/perspective.py
      # sort the points based on their x-coordinates
      """
      xSorted = pts[np.argsort(pts[:, 0]), :]
  
      # grab the left-most and right-most points from the sorted
      # x-roodinate points
      leftMost = xSorted[:2, :]
      rightMost = xSorted[2:, :]
  
      # now, sort the left-most coordinates according to their
      # y-coordinates so we can grab the top-left and bottom-left
      # points, respectively
      leftMost = leftMost[np.argsort(leftMost[:, 1]), :]
      (tl, bl) = leftMost
  
      rightMost = rightMost[np.argsort(rightMost[:, 1]), :]
      (tr, br) = rightMost
  
      rect = np.array([tl, tr, br, bl], dtype="float32")
      return rect
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import ast
  import base64
  import math
  import os
  import time
  from io import BytesIO
  import cv2
  import numpy
  from paddle.inference import Config
  from paddle.inference import create_predictor
  from PIL import Image
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import runnable
  from paddlehub.module.module import serving
  from paddlehub.utils.log import logger
label_desc: Use image node_id 6 for calling the ChineseTextDetectionDBServer obj's underlying member method code with example usage: obj.order_points_clockwise(pts) and returns: rect