本文整理汇总了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)