Fix `None` `prevKeyPoints` for multi-object tracking (#9386)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
main
Moses 1 year ago committed by GitHub
parent 1ca14a9ad0
commit 6a25fb243d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/trackers/utils/gmc.py

@ -319,7 +319,7 @@ class GMC:
keypoints = cv2.goodFeaturesToTrack(frame, mask=None, **self.feature_params)
# Handle first frame
if not self.initializedFirstFrame:
if not self.initializedFirstFrame or self.prevKeyPoints is None:
self.prevFrame = frame.copy()
self.prevKeyPoints = copy.copy(keypoints)
self.initializedFirstFrame = True

Loading…
Cancel
Save