Hi friends i just now installed opencv and checking the basic code but it results in error. The code is
import numpy as np
import cv2
img=cv2.imread('C:\Users\Pravin\Desktop\a.jpeg',1)
cv2.namedWindow('img',cv2.WINDOW_NORMAL)
cv2.Waitkey(10000)
cv2.imshow('cv2.WINDOW_NORMAL',img)
cv2.destoryAllWindows()
The error for cv2.imshow() is
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
cv2.imshow('image',img)
error: ..\..\..\src\opencv\modules\highgui\src\window.cpp:261: error: (-215)
size.width>0 && size.height>0
It was very helpful to me with your answer. Thanks in advance
Most likely, the imread call didn't succeed. Make sure the image "C:\Users\Pravin\Desktop\a.jpeg" exists. (The extension .jpeg seems unusual, maybe it has to be .jpg?)
Also, as Hyperboreus suggests, please, try using forward slashes in the filename "C:/Users/Pravin/Desktop/a.jpg", or escape backslashes
"C:\\Users\\Pravin\\Desktop\\a.jpg"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With