-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsimple.cpp
More file actions
26 lines (20 loc) · 744 Bytes
/
Copy pathsimple.cpp
File metadata and controls
26 lines (20 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
using namespace cv;
using namespace std;
int main( int argc, const char** argv )
{
cout << "Starting up!\n";
Mat img = imread("fwm-small.jpg", CV_LOAD_IMAGE_COLOR);
if (img.empty()) //check whether the image is loaded or not
{
cout << "Error : Image cannot be loaded..!!" << endl;
return -1;
}
namedWindow("MyWindow", CV_WINDOW_AUTOSIZE); //create a window with the name "MyWindow"
imshow("MyWindow", img); //display the image which is stored in the 'img' in the "MyWindow" window
waitKey(0);
destroyWindow("MyWindow"); //destroy the window with the name, "MyWindow"
return 0;
}