Why cv2.namedWindow("ORIGINAL") works well under spyder but doesn't work inline [closed]

asked 2017-11-12 12:24:53 -0500

updated 2017-11-12 12:31:41 -0500

berak gravatar image

// Juste this short code in a file "testgui.py"

import cv2

// It works well when executed from spyder (a window titled "ORIGINAL" is opened)

// But when launched inline like this (under linux) $ python testgui.py // It doesn't work. More precisely, the code is executed but there is no visible window.

I hope someone know with

Thanks for your help

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2017-11-12 13:11:09.291072


your script does not do anything, to "hold the window alive"

add a cv.waitKey() (wait forever), and you'll probably see it. it's a matter of program-flow.

berak gravatar imageberak ( 2017-11-12 12:33:54 -0500 )edit

You're right. It seems obvious indeed, but I didn't think to that. Thanks a lot.

gerobum gravatar imagegerobum ( 2017-11-12 12:58:48 -0500 )edit

please also just bookmark this link

berak gravatar imageberak ( 2017-11-12 13:17:33 -0500 )edit