[ WARN:0@0.017] global loadsave.cpp:248 cv::findDecoder imread_('D:\Python_Test\pythonGraduation env\Resources\RC.png'): can't open/read file: check file path/integrity
问题描述:读取图像后报错无法输出
代码如下
# Load
img = cv2.imread("D:\Python_Test\pythonGraduation\venv\Resources\RC.png")
print("img read")
# display
cv2.imshow("Output",img)
print("img show")
cv2.waitKey(0)
网上参考问题原因:
1.路径不能有中文
2.路径前加r
解决后代码修改如下
# Load
img = cv2.imread(r"D:\Python_Test\pythonGraduation\venv\Resources\RC.png")
print("img read")
# display
cv2.imshow("Output",img)
print("img show")
cv2.waitKey(0)