I have some C++ code and everything was working fine with OpenCV except the function imread(file). It was finding correctly th
imread(file)
Use FORWARD slash (/), instead of a backward slash (). Even in Windows!
Incorrect:
cv::imread("C:\example\1.jpg");
Correct:
cv::imread("C:/example/1.jpg");