本文整理匯總了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()