cv2.imshow() doesn't work correctly without a named window (Bug #2146)


Added by Gareth Webber almost 5 years ago. Updated over 1 year ago.


Status:Open Start date:2012-07-06
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:highgui-gui
Target version:Next Hackathon
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Hi,

I'm using opencv 2.4.2, python 2.7 and installed the bindings from here

The following code created a window of the correct size, but its contents is just blank (grey):

img = cv2.imread(r'D:\opencv\samples\c\box.png')
#cv2.namedWindow("gray", 1)
cv2.imshow("gray", img)
cv2.waitKey()

It only works as expected with a named window being created first, which was not the case in previous versions. This stops certain samples from working for me as well, such as stereo_match.py.


History

Updated by Andrey Kamaev over 4 years ago

  • Category changed from highgui-images to highgui-gui

Updated by Vadim Pisarevsky over 4 years ago

  • Target version deleted ()
  • Assignee deleted (Vadim Pisarevsky)

Updated by Kirill Kornyakov over 4 years ago

  • Target version set to Next Hackathon

Updated by Emily Dunham almost 4 years ago

Tested this and found that it does not happen with the latest OpenCV installed from source on Linux, but is still a problem in Windows 7 with the closest version (opencv 2.4.5) from the site linked in the description.

Updated by Maksim Shabunin over 1 year ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4389

Also available in: Atom PDF