code: def do_intra_matching2(self, mot_list, sub_list):
      new_zone_dict = dict()
  
      def get_trac_info(tracklet1):
          t1_f = list(tracklet1)
          t1_f.sort()
          t1_fs = t1_f[0]
          t1_fe = t1_f[-1]
          t1_zs = tracklet1[t1_fs]["zone"]
          t1_ze = tracklet1[t1_fe]["zone"]
          t1_boxs = tracklet1[t1_fs]["bbox"]
          t1_boxe = tracklet1[t1_fe]["bbox"]
          t1_boxs = [
              (t1_boxs[2] + t1_boxs[0]) / 2,
              (t1_boxs[3] + t1_boxs[1]) / 2,
          ]
          t1_boxe = [
              (t1_boxe[2] + t1_boxe[0]) / 2,
              (t1_boxe[3] + t1_boxe[1]) / 2,
          ]
          return t1_fs, t1_fe, t1_zs, t1_ze, t1_boxs, t1_boxe
  
      for t1id in sub_list:
          tracklet1 = sub_list[t1id]
          if tracklet1 == -1:
              continue
          t1_fs, t1_fe, t1_zs, t1_ze, t1_boxs, t1_boxe = get_trac_info(
              tracklet1
          )
          sim_dict = dict()
          for t2id in mot_list:
              tracklet2 = mot_list[t2id]
              (
                  t2_fs,
                  t2_fe,
                  t2_zs,
                  t2_ze,
                  t2_boxs,
                  t2_boxe,
              ) = get_trac_info(tracklet2)
              if t1_ze == t2_zs:
                  if (
                      abs(t2_fs - t1_fe) < 5
                      and abs(t2_boxe[0] - t1_boxs[0]) < 50
                      and abs(t2_boxe[1] - t1_boxs[1]) < 50
                  ):
                      t1_feat = tracklet1[t1_fe]["feat"]
                      t2_feat = tracklet2[t2_fs]["feat"]
                      sim_dict[t2id] = np.matmul(t1_feat, t2_feat)
              if t1_zs == t2_ze:
                  if (
                      abs(t2_fe - t1_fs) < 5
                      and abs(t2_boxs[0] - t1_boxe[0]) < 50
                      and abs(t2_boxs[1] - t1_boxe[1]) < 50
                  ):
                      t1_feat = tracklet1[t1_fs]["feat"]
                      t2_feat = tracklet2[t2_fe]["feat"]
                      sim_dict[t2id] = np.matmul(t1_feat, t2_feat)
          if len(sim_dict) > 0:
              max_sim = 0
              max_id = 0
              for t2id in sim_dict:
                  if sim_dict[t2id] > max_sim:
                      sim_dict[t2id] = max_sim
                      max_id = t2id
              if max_sim > 0.5:
                  t2 = mot_list[max_id]
                  for t1f in tracklet1:
                      if t1f not in t2:
                          tracklet1[t1f]["id"] = max_id
                          t2[t1f] = tracklet1[t1f]
                  mot_list[max_id] = t2
                  sub_list[t1id] = -1
      return mot_list, sub_list
  
file_path: PaddleDetection/deploy/pptracking/python/mot/mtmct/zone.py
imports: import os
  import cv2
  import numpy
label_desc: Use image node_id 9 for calling the Zone obj's underlying member method code with example usage: obj.do_intra_matching2(mot_list, sub_list) and returns: mot_list,  sub_list, t1_fs,  t1_fe,  t1_zs,  t1_ze,  t1_boxs,  t1_boxe