Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Display a streamed video in full screen Opencv3

I am new to Opencv. The current version I am using is Opencv 3.3 with Python 3.5.
Lately, I wanted to try streaming video in full screen, but I got a full white screen and the streamed video takes just a part of this full white screen.
This is the code I used:

import cv2

cap = cv2.VideoCapture(0)
while(True):
    ret, frame = cap.read()
    cv2.namedWindow('frame', cv2.WINDOW_NORMAL)
    cv2.setWindowProperty('frame', cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)
    cv2.imshow('frame', frame)
    if(cv2.waitKey(1) & 0xFF == ord('e')):
        break
cap.release()
cv2.destroyAllWindows()

This is a screenshot about what I got after running the program:

image description

Anyone please has an idea about how to display the video on full screen?

Display a streamed video in full screen Opencv3

I am new to Opencv. The current version I am using is Opencv 3.3 with Python 3.5.
Lately, I wanted to try streaming video in full screen, but I got a full white screen and the streamed video takes just a part of this full white screen.
This is the code I used:

import cv2

cap = cv2.VideoCapture(0)
while(True):
    ret, frame = cap.read()
    cv2.namedWindow('frame', cv2.WINDOW_NORMAL)
    cv2.setWindowProperty('frame', cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)
    cv2.imshow('frame', frame)
    if(cv2.waitKey(1) & 0xFF == ord('e')):
        break
cap.release()
cv2.destroyAllWindows()

This is a screenshot about what I got after running the program:

image description

Anyone please has an idea about how to display the video on full screen?

EDIT:
I used this code with two different OS: Ubuntu and Raspbian. OS: Ubuntu and Raspbain For Ubuntu: the output of cv2.getBuildInformation() is:

GUI: 
    QT:                          YES (ver 4.8.7 EDITION = OpenSource)  
    QT OpenGL support:         NO  
    GTK+:                        NO  
    VTK support:                 NO

As for Raspbian the output is:

GUI: 
    QT:                              NO
    GTK+ 3.x:                    YES (ver 3.22.11)
    GThread :                    YES (ver 2.50.3)
    GtkGlExt:                     NO
    OpenGL support:          NO
    VTK support:                NO