本文整理汇总了Python中background.Background.capture_frame方法的典型用法代码示例。如果您正苦于以下问题:Python Background.capture_frame方法的具体用法?Python Background.capture_frame怎么用?Python Background.capture_frame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类background.Background
的用法示例。
在下文中一共展示了Background.capture_frame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from background import Background [as 别名]
# 或者: from background.Background import capture_frame [as 别名]
#.........这里部分代码省略.........
def camera(self):
print("Camera in setup")
# background folder
directory = 'backgrounds/' + self.source.base_name
create_dir(directory)
self.status = True
init_setup_new(self.main_window)
self.source.setup_frames = cv2.VideoCapture(config['camera'])
self.get_data()
self.populate_setup()
self.address_window = AddressWindow(self, self.main_window)
self.polygon = Polygon(self, self.source)
self.draw_status = False
self.play = Play(self.source, self)
self.play.run_setup()
self.background = Background(self.source)
def click_setup_play_btn(self):
print("Clicked setup play button!")
self.play.setup_status = True
self.play.setup_timer.start()
self.main_window.setup_pause_btn.setEnabled(True)
self.main_window.setup_play_btn.setEnabled(False)
def click_setup_pause_btn(self):
print("Clicked setup pause button!")
self.play.setup_status = False
self.play.setup_timer.stop()
self.main_window.setup_pause_btn.setEnabled(False)
self.main_window.setup_play_btn.setEnabled(True)
def click_setup_bg_btn(self):
print("Clicked capture background button")
self.background.capture_frame()
def click_draw_btn(self):
print("Clicked draw button")
self.line_status = False
self.draw_status = True
if self.play.setup_status == False:
self.play.run_setup_pause()
self.main_window.setup_draw_btn.setEnabled(False)
self.main_window.setup_line_btn.setEnabled(True)
# get area of polygon
area = self.polygon.compute_area()
self.main_window.area_lbl.setText(str(self.polygon.area))
def click_line_btn(self):
print("Clicked line button")
self.line_status = True
self.draw_status = False
if self.play.setup_status == False:
self.play.run_setup_pause()
self.main_window.setup_line_btn.setEnabled(False)
self.main_window.setup_draw_btn.setEnabled(True)
self.main_window.area_lbl.setText("")
def click_reset_btn(self):
print("Clicked reset button")
self.polygon.reset()
if self.play.setup_status == False:
self.play.run_setup_reset()
self.main_window.setup_reset_btn.setEnabled(False)
self.main_window.setup_line_btn.setEnabled(False)
self.main_window.setup_draw_btn.setEnabled(False)
self.line_status = False