|   | 1 |  initial version  | 
The code i used and it worked for me
using namespace std;
using namespace cv;
int main() {
cv::Mat img = imread("left.jpg");
if (img.empty())
{
cout <<"error" <<endl;
}
else
{
cout <<"image read" <<endl;
}
return 0;
}
Hope this helps you :)
|   | 2 |  No.2 Revision  | 
The code i used and it worked for me
using namespace std;
using namespace cv;
int main() {
cv::Mat img = imread("left.jpg");
if (img.empty())
{
cout <<"error" <<endl;
}
else
{
cout <<"image read" <<endl;
}
return 0;
}
Hope this helps you :)
|   | 3 |  No.3 Revision  | 
The code i used and it worked for me
include opencv2/highgui/highgui.hpp
(include the above files and the rest of the code goes down here)
using namespace std;
using namespace cv;
int main() {
cv::Mat img = imread("left.jpg");
if (img.empty())
{
cout <<"error" <<endl;
}
else
{
cout <<"image read" <<endl;
}
return 0;
}
Hope this helps you :)
|   | 4 |  highlight source code  | 
The code i used and it worked for me
include opencv2/highgui/highgui.hpp
include opencv2/core/core.hpp
include iostream
(include the above files and the rest of the code goes down here)
using namespace cv;
int main() {
if (img.empty())
{
}
else
{
}
return 0;
}
Hope this helps you :)