ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
52.37k stars 13.36k forks source link

opencv读取图像报错:352 环境为win10+pycharm+python3.7+opencv4.1.0 ,希望得到解决 #902

Open RehobothRoselle opened 4 years ago

RehobothRoselle commented 4 years ago

import cv2 as cv import numpy as np

print("-------hello python---------") scr = cv.imread(r"C://Users//ASUS//Pictures//Saved Pictures//d.jpg") cv.namedWindow("input image", cv.WINDOW_AUTOSIZE) cv.imshow("input image", scr) cv.waitKey(0)

cv.destroyAllWindows()

报错:cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

RehobothRoselle commented 4 years ago

已经解决

fang0814 commented 4 years ago

import cv2 as cv import numpy as np

print("-------hello python---------") scr = cv.imread(r"C://Users//ASUS//Pictures//Saved Pictures//d.jpg") cv.namedWindow("input image", cv.WINDOW_AUTOSIZE) cv.imshow("input image", scr) cv.waitKey(0)

cv.destroyAllWindows()

报错:cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

我也报了这个问题,可以帮帮我吗?

RehobothRoselle commented 4 years ago

你的代码是什么样的发来看看可以吗

fang0814 commented 4 years ago

不好意思啊对不起 好久没看GitHub

moneyleaf commented 4 years ago

你好,请问你是怎么解决这个问题的

WenBoNie commented 4 years ago

I think the path of your picture is incorrect

xuzhichang commented 4 years ago

@WenBoNie I Think you are correct