Ask Your Question

Revision history [back]

Error 1: in the line

cout<<"image not found or read!<<endl; <="" br=""> return -1;

before the ; a " should be there.

Like

 cout<<"image not found or read!<<endl; <="" br=""> return -1";

Error 2: there is nothing called as waitkey,it is waitKey

Error 3:The line #include < iostream > is incorrect,there should be no spaces in between,its like

#include <iostream>

The code(revised):

#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

using namespace std;
using namespace cv;

int main(int argc, char** argv)
{
Mat img = imread(argv[1], -1);

if(img.empty())
{
cout<<"image not found or read!<<endl; <="" br=""> return -1";
}

namedWindow("Picture Displayer", WINDOW_AUTOSIZE);
imshow("Picture Displayer", img);
waitKey(0);
destroyWindow("Picture Displayer");

return 0;

}

Hope this helps you :)