Error while running the sample display image program

asked 2015-06-29 00:44:26 -0600

I am getting an error when i run this sample display image program

import numpy as np
import cv2

img = cv2.imread('G:/space.jpg',0)
cv2.imshow('image',img)
cv2.waitKey(0) & 0xFF
cv2.destroyAllWindows()

in my dell inspiron 15r windows 8.1 64 bit system. And the error which i am getting is

Please help! i am novice in opencv.

edit retag flag offensive close merge delete

Comments

1

please add a check like: if img==None: raise Exception("image was not loaded") after the imread call

berak gravatar imageberak ( 2015-06-29 04:51:13 -0600 )edit

And in the future, copy the message here, do not screengrab it... the resolution is awfull :D

StevenPuttemans gravatar imageStevenPuttemans ( 2015-06-29 06:26:34 -0600 )edit