本文整理汇总了Python中cv2.WINDOW_FULLSCREEN属性的典型用法代码示例。如果您正苦于以下问题:Python cv2.WINDOW_FULLSCREEN属性的具体用法?Python cv2.WINDOW_FULLSCREEN怎么用?Python cv2.WINDOW_FULLSCREEN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cv2
的用法示例。
在下文中一共展示了cv2.WINDOW_FULLSCREEN属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_display
# 需要导入模块: import cv2 [as 别名]
# 或者: from cv2 import WINDOW_FULLSCREEN [as 别名]
def set_display(window_name, full_scrn):
"""Set disply window to either full screen or normal."""
if full_scrn:
cv2.setWindowProperty(window_name, cv2.WND_PROP_FULLSCREEN,
cv2.WINDOW_FULLSCREEN)
else:
cv2.setWindowProperty(window_name, cv2.WND_PROP_FULLSCREEN,
cv2.WINDOW_NORMAL)
示例2: set_full_screen
# 需要导入模块: import cv2 [as 别名]
# 或者: from cv2 import WINDOW_FULLSCREEN [as 别名]
def set_full_screen(full_scrn):
"""Set display window to full screen or not."""
prop = cv2.WINDOW_FULLSCREEN if full_scrn else cv2.WINDOW_NORMAL
cv2.setWindowProperty(WINDOW_NAME, cv2.WND_PROP_FULLSCREEN, prop)
示例3: main
# 需要导入模块: import cv2 [as 别名]
# 或者: from cv2 import WINDOW_FULLSCREEN [as 别名]
def main():
angle = 0
scale = 0.1
windowName = "Video Rotation"
cv2.namedWindow(windowName, cv2.WINDOW_FULLSCREEN)
capture = cv2.VideoCapture(0)
if capture.isOpened():
flag, frame = capture.read()
else:
flag = False
rows, cols, channels = frame.shape
while flag:
if angle > 360:
angle = 0
if scale < 2:
scale = scale + 0.1
else:
scale = 0.1
flag, frame = capture.read()
rotationmatrix = cv2.getRotationMatrix2D((cols / 2, rows / 2), angle, scale)
transformedoutput = cv2.warpAffine(frame, rotationmatrix, (cols, rows))
cv2.imshow(windowName, transformedoutput)
angle = angle + 1
time.sleep(0.01)
if cv2.waitKey(1) & 0xFF == 27:
break
cv2.destroyAllWindows()
capture.release()