code: def get_sim_matrix(
      cid_tid_dict,
      cid_tids,
      use_ff=True,
      use_rerank=True,
      use_st_filter=False,
  ):
      # Note: camera independent get_sim_matrix function,
      # which is different from the one in camera_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)
  
      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
  
imports: import os
  import re
  import cv2
  import gc
  import numpy
  import pandas
  from tqdm import tqdm
  import warnings
label_desc: Use image node_id 27 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