本文整理匯總了Python中motor.Motor.track方法的典型用法代碼示例。如果您正苦於以下問題:Python Motor.track方法的具體用法?Python Motor.track怎麽用?Python Motor.track使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類motor.Motor
的用法示例。
在下文中一共展示了Motor.track方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: round
# 需要導入模塊: from motor import Motor [as 別名]
# 或者: from motor.Motor import track [as 別名]
dlib_tracker.x1 = boundingbox[0]
dlib_tracker.y1 = boundingbox[1]
dlib_tracker.x2 = boundingbox[2]
dlib_tracker.y2 = boundingbox[3]
dlib_tracker.center = (round((dlib_tracker.x1 + dlib_tracker.x2) / 2), round((dlib_tracker.y1 + dlib_tracker.y2) / 2))
cv2.rectangle(frame_draw,(dlib_tracker.x1,dlib_tracker.y1), (dlib_tracker.x2,dlib_tracker.y2), (255,0,0), 1)
cv2.drawMarker(frame_draw, tuple(dlib_tracker.center), (255,0,0))
# request_to_track_flag = True
else:
pass
if request_to_track_flag is True:
request_to_track_flag = False
if kcf_tracker.enable:
motor.track(kcf_tracker.center, zoom.current_zoom)
if autozoom_flag:
zoom.autozoom(width = kcf_tracker.mean_width, height = kcf_tracker.mean_height)
if tracking_window['dragging'] == True:
pt1 = (tracking_window['x1'], tracking_window['y1'])
pt2 = (tracking_window['x2'], tracking_window['y2'])
if capture is None:
capture = np.copy(frame)
frame_draw = np.copy(capture)
cv2.rectangle(frame_draw, pt1, pt2, (0, 255, 0,), 1)
cv2.imshow(cfg['TITLE'], frame_draw)
cv2.line(frame_draw, (cfg['HALF_WIDTH'], 0), (cfg['HALF_WIDTH'], cfg['HEIGHT']), (200, 200, 200), 0)