Python Forum
Python OpenCV window not opening in fullscreen mode
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python OpenCV window not opening in fullscreen mode
#1
I have some basic code to receive a camera stream as a numpy array and display it as a fullscreen window. I'm able to receive and display the camera, but 75% of the time the fullscreening doesn't work and instead of scaling it nicely and centering it on the screen, it displays smaller in the corner. Any clue why?
from numpysocket import NumpySocket
import cv2

host_ip = '169.254.53.20'  # change me

npSocket = NumpySocket()
npSocket.startClient(host_ip, 9999)

cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)

# Read until video is completed
def watch():
    # Capture frame-by-frame
    frame = npSocket.recieve()
    cv2.imshow("window", frame)
    if cv2.waitKey(25) & 0xFF == ord('q'):
        quit()
    
if __name__=="__main__":
    while True:
        watch()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Why is IDLE not opening on a MacOS Montery 12.6 and using Python 3.10.7? Merlin385 7 352 Oct-08-2022, 08:36 PM
Last Post: Merlin385
  Opening CMD from Python Oshadha 2 529 Jul-17-2022, 11:22 PM
Last Post: Skaperen
  Pyspark Window: perform sum over a window with specific conditions Shena76 0 432 Jun-13-2022, 08:59 AM
Last Post: Shena76
Question Opening small size browser with python selenium not work, need help greenpine 0 768 Feb-07-2022, 11:36 AM
Last Post: greenpine
  Help for the shortest way to install a suitable version of Python, Numpy, and OpenCV. Ezzat 2 1,139 Dec-23-2021, 12:34 PM
Last Post: snippsat
  things that work in terminal mode but not in sublime mode alok 4 1,843 Aug-11-2021, 07:02 PM
Last Post: snippsat
  python keeps opening script directory Tyrel 5 1,951 Aug-06-2021, 10:43 PM
Last Post: snippsat
  Python IDE doesn't see opencv-python package on my Jetson Nano sadhaonnisa 1 2,455 Oct-11-2020, 01:04 AM
Last Post: Larz60+
  pip3 install opencv-python fails on 'skbuild' Pedroski55 2 4,350 Sep-15-2020, 11:33 AM
Last Post: snippsat
  python and openCV installation dejhost 16 7,397 Aug-04-2020, 02:23 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020