Hello
I’m practicing coding in opencv pycham.
I want to load the image, and I specified the exact path name,
The image window does not appear.
I’ve tried various methods, but I can’t load all the images.
Please help me. Thank you.
import cv2
import numpy as np
src = cv2.imread("newproject/Lena.png")
cv2.imshow('src', src)
cv2.waitKey(0)
cv2.destroyAllWindows()
and error is
C:\Users\ㅇㅇㅇ\PycharmProjects\newproject\venv\Scripts\python.exe C:\Users\ㅇㅇㅇ\PycharmProjects\newproject\openopic.py
[ WARN:0@0.027] global loadsave.cpp:244 cv::findDecoder imread_(‘newproject/Lena.png’): can’t open/read file: check file path/integrity
Traceback (most recent call last):
File “C:\Users\ㅇㅇㅇ\PycharmProjects\newproject\openopic.py”, line 8, in
cv2.imshow(‘src’, src)
cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:971: error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘cv::imshow’
Process finished with exit code 1