本文整理汇总了Python中state.State.draw方法的典型用法代码示例。如果您正苦于以下问题:Python State.draw方法的具体用法?Python State.draw怎么用?Python State.draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类state.State
的用法示例。
在下文中一共展示了State.draw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import draw [as 别名]
def main(video_path):
file = open(annotate.getFileName(video_path))
cap = cv2.VideoCapture(video_path)
frameNum = 0
cap.read()
_, first_frame = cap.read()
next_frame = 0
ball_positions = None
file_done = False
parameters = importlib.import_module("parameters.will1")
state = State(parameters)
line = file.readline()
next_frame,ball_positions = processLine(line)
while(cap.isOpened()):
frameNum += 1
_, frame = cap.read()
if frameNum >= next_frame and not file_done:
if line == '':
file_done = True
if not file_done:
utils.updateBallPositions(state,ball_positions)
next_frame,ball_positions = processLine(line)
line = file.readline()
state.draw(frame,frame_number=frameNum)
cv2.imshow('final',frame)
if cv2.waitKey(0) == ord('q'):
break
示例2: draw
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import draw [as 别名]
def draw(self, screen):
State.draw(self, screen)
if self.child_state:
self.child_state.draw(screen)
return
示例3: draw
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import draw [as 别名]
def draw(self, screen):
if self.parent:
ElementCollection.draw(self, screen)
else:
State.draw(self, screen)
return