import cv2
import numpy as np
img = np.random.rand(400, 600)
tracker = cv2.TrackerKCF_create()
x, y, w, h = 50, 100, 40, 60
tracker.init(img, (x, y, w, h))
new_img = np.random.rand(400, 600)
tracker.update(new_img)
new_img = np.random.rand(400, 600)
tracker.update(new_img)
网友评论