本文整理汇总了Python中Controller.Controller.scan方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.scan方法的具体用法?Python Controller.scan怎么用?Python Controller.scan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controller.Controller
的用法示例。
在下文中一共展示了Controller.scan方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from Controller import Controller [as 别名]
# 或者: from Controller.Controller import scan [as 别名]
if captureMode=='http':
bytes+=capture_uri.read(1024)
a = bytes.find('\xff\xd8')
b = bytes.find('\xff\xd9')
if a!=-1 and b!=-1:
jpg = bytes[a:b+2]
bytes= bytes[b+2:]
controller_frame = cv2.imdecode(np.fromstring(jpg, dtype=np.uint8),cv2.CV_LOAD_IMAGE_COLOR)
else:
ret, controller_frame = capture.read()
#Flip controller_frame
controller_frame = cv2.flip(controller_frame, 1)
#Find the position of the user
users = controller.scan(frame = controller_frame,
backsub = backsub)
#Perform the user's action
controller.vote(users = users,
emulator = emulator)
#Draw the controller on the capture_frame
controller.render(frame = controller_frame)
#Draw the stage
stage.render( stage_frame = stage_frame,
controller_frame = controller_frame,
keylog = emulator.keylog)
#Display the results
cv2.imshow('Stage_frame', stage_frame)