unable to use cv2.imread(cv2.samples.findfile("lena.jpg")) in opencv
I have installed OpenCV in pycharm and when i use image=cv2.imread(cv2.samples.findfile("lena.jpg"))
in my code it gives the following error
[ WARN:0] global C:\projects\opencv-python\opencv\modules\core\src\utils\samples.cpp (59) cv::samples::findFile cv::samples::findFile('lena.jpg') => ''
Traceback (most recent call last):
File "D:/all_libraries/main.py", line 5, in <module>
image=cv2.imread(cv2.samples.findFile("lena.jpg"))
cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\core\src\utils\samples.cpp:62: error:
(-2:Unspecified error) OpenCV samples: Can't find required data file: lena.jpg in function 'cv::samples::findFile'
Sorry, I don't know where your missing file is...
@Gourav.The error telling you that you can't used
cv2.samples.findfile
to search in your current folder.try NOT to use pycharm. (considered harmful)
@Gourav. Are you using python 2 or python 3?
I am usign python 3