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
  Problem with using opencv in python Raunak1023984765 21 1,411 Feb-21-2024, 04:25 PM
Last Post: Pedroski55
  Is there a way to call and focus any popup window outside of the main window app? Valjean 6 1,611 Oct-02-2023, 04:11 PM
Last Post: deanhystad
  Why is IDLE not opening on a MacOS Montery 12.6 and using Python 3.10.7? Merlin385 7 1,592 Oct-08-2022, 08:36 PM
Last Post: Merlin385
  Opening CMD from Python Oshadha 2 1,242 Jul-17-2022, 11:22 PM
Last Post: Skaperen
  Pyspark Window: perform sum over a window with specific conditions Shena76 0 1,132 Jun-13-2022, 08:59 AM
Last Post: Shena76
Question Opening small size browser with python selenium not work, need help greenpine 0 1,587 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 2,227 Dec-23-2021, 12:34 PM
Last Post: snippsat
  things that work in terminal mode but not in sublime mode alok 4 2,815 Aug-11-2021, 07:02 PM
Last Post: snippsat
  python keeps opening script directory Tyrel 5 2,936 Aug-06-2021, 10:43 PM
Last Post: snippsat
  Python IDE doesn't see opencv-python package on my Jetson Nano sadhaonnisa 1 3,290 Oct-11-2020, 01:04 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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