I am trying to set up opencv for c++ in visual studio. I have download OpenCV and set it up and can successfully include opencv without any errors. When trying the following code I get and error: "OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)" after line 11.
#include <opencv2\opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
Mat img = imread("C:/Users/Whity/Desktop/OpenCVRoot/OpenCV/Win10BG_Red.png", IMREAD_COLOR);
imshow("Display Window", img);
waitKey(10);
return 0;
}
I have looked at numerous other threads where many much of the discussion was about an incorrect path to the image, or using the wrong file type. (png, jpg, jpeg) I have quadruple checked my path and have tried other paths and other images, all resulting in the same error. Any ideas?