code: def applyEcc(self, raw_frame, detections=None):
      # Initialize
      height, width, _ = raw_frame.shape
      frame = cv2.cvtColor(raw_frame, cv2.COLOR_BGR2GRAY)
      H = np.eye(2, 3, dtype=np.float32)
  
      # Downscale image (TODO: consider using pyramids)
      if self.downscale > 1.0:
          frame = cv2.GaussianBlur(frame, (3, 3), 1.5)
          frame = cv2.resize(
              frame, (width // self.downscale, height // self.downscale)
          )
          width = width // self.downscale
          height = height // self.downscale
  
      # Handle first frame
      if not self.initializedFirstFrame:
          # Initialize data
          self.prevFrame = frame.copy()
  
          # Initialization done
          self.initializedFirstFrame = True
  
          return H
  
      # Run the ECC algorithm. The results are stored in warp_matrix.
      # (cc, H) = cv2.findTransformECC(self.prevFrame, frame, H, self.warp_mode, self.criteria)
      try:
          (cc, H) = cv2.findTransformECC(
              self.prevFrame,
              frame,
              H,
              self.warp_mode,
              self.criteria,
              None,
              1,
          )
      except:
          print("Warning: find transform failed. Set warp as identity")
  
      return H
  
file_path: PaddleDetection/deploy/pptracking/python/mot/motion/gmc.py
imports: import cv2
  import matplotlib.pyplot
  import numpy
  import copy
  import time
label_desc: Use image node_id 3 for calling the GMC obj's underlying member method code with example usage: obj.applyEcc(raw_frame, detections) and returns: H, H