Answer the question
In order to leave comments, you need to log in
How to open an image in open cv?
I am trying to open an image with the following code
cv::Mat UploadImage()
{
cv::Mat image;
while (image.empty())
{
std::string path;
std::cout << "Enter image path: ";
std::cin >> path;
image = cv::imread(path);
if (image.empty())
{
std::cout << "No image\n\n";
}
}
return image;
}
Answer the question
In order to leave comments, you need to log in
I just changed the project and everything started to function normally, I don’t know what it was connected with, but the problem was solved.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question