Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

imshow just opens a tiny window

import numpy as np import cv2

img = cv2.imread('C:\\Users\\mlarn\\Downloads\\20170818_171339.jpg',0)
#cv2.namedWindow('C:\\Users\\mlarn\\Downloads\\20170818_171339.jpg', cv2.WINDOW_NORMAL)
cv2.imshow('C:\\Users\\mlarn\\Downloads\\20170818_171339.jpg',0)
cv2.waitKey(0) & 0xFF
cv2.destroyAllWindows()

Just opens a window like this link

If I uncomment the WINDOW_NORMAL flag and resize the window, it is just black. link

I've tried it on multiple files of differing types and get the same result.

What am I doing wrong?