本文整理汇总了Python中polygon.Polygon.reset方法的典型用法代码示例。如果您正苦于以下问题:Python Polygon.reset方法的具体用法?Python Polygon.reset怎么用?Python Polygon.reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类polygon.Polygon
的用法示例。
在下文中一共展示了Polygon.reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from polygon import Polygon [as 别名]
# 或者: from polygon.Polygon import reset [as 别名]
class Setup:
def __init__(self, source):
self.source = source
self.files = source.setup_list
self.main_window = source.main_window
self.dbs = source.dbs
self.admin = source.admin
self.pointer = 0
self.sentinel = len(self.files)
self.line_status = False
self.draw_status = False
self.status = False
self.analysis = None
# init setup ui
init_address(self.main_window)
# enable address button
self.main_window.setup_address_btn.setEnabled(True)
# signals
# connect setup save button
self.main_window.connect(self.main_window.setup_save_btn, \
SIGNAL("clicked()"), self.save_setup)
self.main_window.setup_save_btn.setEnabled(True)
# connect address button
self.main_window.connect(self.main_window.setup_address_btn, \
SIGNAL("clicked()"), self.click_address_btn)
# setup play button
self.main_window.connect(self.main_window.setup_play_btn, \
SIGNAL("clicked()"), self.click_setup_play_btn)
# setup pause button
self.main_window.connect(self.main_window.setup_pause_btn, \
SIGNAL("clicked()"), self.click_setup_pause_btn)
# setup background button
self.main_window.connect(self.main_window.setup_bg_btn, \
SIGNAL("clicked()"), self.click_setup_bg_btn)
# setup reset button
self.main_window.connect(self.main_window.setup_reset_btn, \
SIGNAL("clicked()"), self.click_reset_btn)
# setup draw button
self.main_window.connect(self.main_window.setup_draw_btn, \
SIGNAL("clicked()"), self.click_draw_btn)
# setup line button
self.main_window.connect(self.main_window.setup_line_btn, \
SIGNAL("clicked()"), self.click_line_btn)
# setup frame mousePressEvent overide
self.main_window.setup_frame.mousePressEvent = \
self.setup_frame_click
def get_data(self):
if self.source.media == "file":
print("Gathering video properties")
self.path = self.file
self.metadata = get_metadata(self.file)
self.base_name = get_base_name(self.file)
self.fps = get_fps(self.metadata)
self.duration = get_duration(self.metadata)
self.resolution = get_resolution(self.metadata)
self.format = get_format(self.metadata)
if self.source.media == "camera":
self.base_name = self.source.base_name
self.path = self.source.path
self.metadata = None
self.fps = None
self.duration = None
self.resolution = None
self.format = None
def valid_setup(self):
rv = True
message = ''
# address
if self.address_window.valid_address():
print("Creating address for video in db")
self.address_window.create_address()
self.address = self.address_window.address
else:
message = message + "Address is incomplete!\n"
rv = False
# background
if self.background.path is None:
message = message + "Background image is None!\n"
rv = False
# polygon
if self.polygon.no_of_points <= 3:
message = message + "Polygon is not yet set!\n"
rv = False
if rv is False:
print(message)
self.dialog = DialogWindow("Setup", message)
return rv
def save_db(self):
file = self.base_name
path = self.path
background = self.background.path
fps = self.fps
duration = None
#.........这里部分代码省略.........