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
  python keeps opening script directory Tyrel 0 22 40 minutes ago
Last Post: Tyrel
  Python IDE doesn't see opencv-python package on my Jetson Nano sadhaonnisa 1 710 Oct-11-2020, 01:04 AM
Last Post: Larz60+
  pip3 install opencv-python fails on 'skbuild' Pedroski55 2 1,947 Sep-15-2020, 11:33 AM
Last Post: snippsat
  python and openCV installation dejhost 16 3,110 Aug-04-2020, 02:23 AM
Last Post: snippsat
  Python Fullscreen finndude 5 971 May-03-2020, 01:30 PM
Last Post: buran
  How to detect the text above lines using OpenCV in Python pframe 0 955 Apr-14-2020, 09:53 AM
Last Post: pframe
  cv2.imshow Python is not opening the window on top Petko 0 1,004 Feb-21-2020, 11:11 AM
Last Post: Petko
  Python opening a new command window m_lokeshkumar 1 685 Jan-05-2020, 09:01 PM
Last Post: Larz60+
  Developing Python with OpenCV into an Android App AviationFreak 1 3,504 Sep-29-2019, 08:55 AM
Last Post: wavic
  Error -3 when opening matlab file in python python_newbie09 0 947 Aug-02-2019, 11:51 AM
Last Post: python_newbie09

Forum Jump:

User Panel Messages

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