code: def get_sim_matrix(
      cid_tid_dict,
      cid_tids,
      use_ff=True,
      use_rerank=True,
      use_st_filter=False,
  ):
      # Note: camera releated get_sim_matrix function,
      # which is different from the one in utils.py.
      count = len(cid_tids)
  
      q_arr = np.array(
          [cid_tid_dict[cid_tids[i]]["mean_feat"] for i in range(count)]
      )
      g_arr = np.array(
          [cid_tid_dict[cid_tids[i]]["mean_feat"] for i in range(count)]
      )
      q_arr = normalize(q_arr, axis=1)
      g_arr = normalize(g_arr, axis=1)
  
      st_mask = np.ones((count, count), dtype=np.float32)
      st_mask = intracam_ignore(st_mask, cid_tids)
  
      # different from utils.py
      if use_st_filter:
          st_mask = st_filter(st_mask, cid_tids, cid_tid_dict)
  
      visual_sim_matrix = visual_rerank(
          q_arr, g_arr, cid_tids, use_ff=use_ff, use_rerank=use_rerank
      )
      visual_sim_matrix = visual_sim_matrix.astype("float32")
  
      np.set_printoptions(precision=3)
      sim_matrix = visual_sim_matrix * st_mask
  
      np.fill_diagonal(sim_matrix, 0)
      return sim_matrix
  
file_path: PaddleDetection/deploy/pptracking/python/mot/mtmct/camera_utils.py
imports: import numpy
  from .utils import get_dire, get_match, get_cid_tid, combin_feature, combin_cluster
  from .utils import normalize, intracam_ignore, visual_rerank
label_desc: Use image node_id 4 for calling a global function with example usage: get_sim_matrix(cid_tid_dict, cid_tids, use_ff, use_rerank, use_st_filter) and returns: sim_matrix