當前位置: 首頁>>代碼示例>>Python>>正文


Python Motor.track方法代碼示例

本文整理匯總了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)
開發者ID:zooliet,項目名稱:UWTracking,代碼行數:33,代碼來源:main.py


注:本文中的motor.Motor.track方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。