當前位置: 首頁>>代碼示例>>Python>>正文


Python cv2.WINDOW_FULLSCREEN屬性代碼示例

本文整理匯總了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) 
開發者ID:jkjung-avt,項目名稱:tensorrt_demos,代碼行數:10,代碼來源:display.py

示例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) 
開發者ID:dataplayer12,項目名稱:homesecurity,代碼行數:6,代碼來源:xavier_surveillance.py

示例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() 
開發者ID:amarlearning,項目名稱:Finger-Detection-and-Tracking,代碼行數:42,代碼來源:VideoRotation.py


注:本文中的cv2.WINDOW_FULLSCREEN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。