code: def convert_bbox_to_z(bbox):
      """
      Takes a bounding box in the form [x1,y1,x2,y2] and returns z in the form
        [x,y,s,r] where x,y is the centre of the box and s is the scale/area and r is
        the aspect ratio
      """
      w = bbox[2] - bbox[0]
      h = bbox[3] - bbox[1]
      x = bbox[0] + w / 2.0
      y = bbox[1] + h / 2.0
      s = w * h  # scale is just area
      r = w / float(h + 1e-6)
      return np.array([x, y, s, r]).reshape((4, 1))
  
file_path: PaddleDetection/deploy/pptracking/python/mot/tracker/ocsort_tracker.py
imports: import time
  import numpy
  from ..matching.ocsort_matching import associate, linear_assignment, iou_batch, associate_only_iou
  from ..motion.ocsort_kalman_filter import OCSORTKalmanFilter
label_desc: Use image node_id 2 for calling a global function with example usage: convert_bbox_to_z(bbox) and returns: np