问题遇到的现象和发生背景
在pycharm上下载了opencv-python想尝试一下但是运行不了
用代码块功能插入代码,请勿粘贴截图
import cv2 as cv
img = cv.imread('face.jpg')
cv.imshow('read_ing',img)
cv.waitKey(0)
cv.destroyWindow()
运行结果及报错内容
F:\python\python.exe F:\python-xmu\opencv.py
[ WARN:0@0.011] global D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('face.jpg'): can't open/read file: check file path/integrity
Traceback (most recent call last):
File "F:\python-xmu\opencv.py", line 3, in <module>
cv.imshow('read_ing',img)
cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:967: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'
我想要达到的结果
希望大家有时间能帮忙解答一下