小编Zei*_*rif的帖子

Error (-215) size.width>0 && size.height>0 occurred when attempting to display an image using OpenCV

I am trying to run a simple program that reads an image from OpenCV. However, I am getting this error:

error: ......\modules\highgui\src\window.cpp:281: error: (-215) size.width>0 && size.height>0 in function cv::imshow
Run Code Online (Sandbox Code Playgroud)

Any idea what this error means?

Here is my code:

from matplotlib import pyplot as plt
import numpy as np
import cv2

img = cv2.imread('C:\\Utilisateurs\\Zeineb\\Bureau\\image.jpg',0)
cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Run Code Online (Sandbox Code Playgroud)

python opencv

8
推荐指数
2
解决办法
12万
查看次数

标签 统计

opencv ×1

python ×1