I’m stuck with OpenCV image read function because somehow he can’t read an image. Yes the path is correct and the image exist. I watched some tutorial on Youtube to display an image to find the problem without success. I also try to debug to check if my path was wrong but it seem to work perfectly fine so i’m kinda lost. enter image description here
Similar issue:
https://github.com/opencv/opencv/issues/24632
https://forum.opencv.org/t/opencv-4-7-c-17-windows-10-imread-warn-cutoff-empty-return/12089
My issue:
[ WARN:[email protected]] global loadsave.cpp:248 cv::findDecoder imread_(”): can’t open/read file: check file path/integrity
OpenCV Exception: OpenCV(4.9.0) C:GHA-OCV-1_workci-gha-workflowci-gha-workflowopencvmoduleshighguisrcwindow.cpp:449: error: (-215:Assertion failed) !winname.empty() in function ‘cv::namedWindow’
Console app
C++ 17 X64 unicode
Compiler: VS 2022
#include <iostream>
#include <opencv2/opencv.hpp>
#include <Windows.h>
int main()
{
try {
cv::Mat img = cv::imread("C:\Users\S06\Downloads\panneau.jpg", cv::IMREAD_COLOR);
cv::namedWindow("Image", cv::WINDOW_AUTOSIZE);
cv::imshow("Image", img);
cv::waitKey(0);
}
catch (const cv::Exception& e) {
std::cerr << "OpenCV Exception: " << e.what() << std::endl;
system("pause");
return -1;
} catch (const std::exception& e) {
std::cerr << "Standard Exception: " << e.what() << std::endl;
system("pause");
return -1;
} catch (...) {
std::cerr << "Unknown Exception" << std::endl;
system("pause");
return -1;
}
system("pause");
return 0;
}