First time here? Check out the FAQ!

Ask Your Question
0

imshow opens window to be grey and freezes

asked Jan 31 '0

updated Jan 31 '0

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)
cv2.waitKey(0)

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

Any pointers would be appreciated.

Preview: (hide)

1 answer

Sort by » oldest newest most voted
4

answered Jan 31 '0

mvuori gravatar image

You are opening image, not img...

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Jan 31 '0

Seen: 3,364 times

Last updated: Jan 31 '20