Ask Your Question

imshow opens window to be grey and freezes

asked 2020-01-31 06:06:35 -0600

updated 2020-01-31 06:51:06 -0600

berak gravatar image

I'm new to opencv and starting by reading in an image, and trying to display. from the command prompt:

cd to the project directory, then:

import cv2

# Load a color image in grayscale
img = cv2.imread('oyster.jpg',0)
cv2.imshow('img', image)

it opens a windows10 window which is just grey and freezes.

Any pointers would be appreciated.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-01-31 08:12:57 -0600

mvuori gravatar image

You are opening image, not img...

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-01-31 06:06:35 -0600

Seen: 2,793 times

Last updated: Jan 31 '20