code: def embedding_distance(matched_not_init_trackers, unmatched_trackers):
      snd_embedding = unmatched_trackers.last_detection.embedding
  
      if snd_embedding is None:
          for detection in reversed(unmatched_trackers.past_detections):
              if detection.embedding is not None:
                  snd_embedding = detection.embedding
                  break
          else:
              return 1
  
      for detection_fst in matched_not_init_trackers.past_detections:
          if detection_fst.embedding is None:
              continue
  
          distance = 1 - cv2.compareHist(
              snd_embedding, detection_fst.embedding, cv2.HISTCMP_CORREL
          )
          if distance < 0.5:
              return distance
      return 1
  
file_path: norfair/demos/reid/src/demo.py
imports: import random
  import cv2
  import numpy
  import typer
  from utils import get_hist
  from video_generator import generate_video
  from norfair import Tracker, Video, draw_points, draw_tracked_objects, get_cutout
  from norfair.filter import OptimizedKalmanFilterFactory
label_desc: Use image node_id 1 for calling a global function with example usage: embedding_distance(matched_not_init_trackers, unmatched_trackers) and returns: int, int, distance