Answer the question
In order to leave comments, you need to log in
How to fix an error when displaying an image?
When I try to display an image, it throws the following:
#include <iostream>
#include <opencv2/core.hpp>
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
using namespace cv;
using namespace std;
int main()
{
try
{
Mat img = imread("C:/1.jpg", IMREAD_UNCHANGED);
namedWindow("Display window", WINDOW_AUTOSIZE);// Create a window for display.
imshow("Display window", img);
waitKey(0);
}
catch (const std::exception & e)
{
cout << e.what() << std::endl;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question