File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Uncomment the following line if you are compiling this code in Visual Studio
2
+ // #include "stdafx.h"
3
+
4
+ #include < opencv2/opencv.hpp>
5
+ #include < iostream>
6
+
7
+ using namespace cv ;
8
+ using namespace std ;
9
+
10
+ // Put file name here
11
+ String file_name (" test.jpg" );
12
+
13
+ int main (int argc, char ** argv)
14
+ {
15
+ // Read the image file
16
+ Mat image = imread (file_name, IMREAD_COLOR);
17
+
18
+ // Check for failure
19
+ if (image.empty ())
20
+ {
21
+ cout << " Could not open or find the image" << endl;
22
+ cin.get (); // wait for any key press
23
+ return -1 ;
24
+ }
25
+
26
+ String windowName = " The Guitar" ; // Name of the window
27
+
28
+ namedWindow (windowName); // Create a window
29
+
30
+ imshow (windowName, image); // Show our image inside the created window.
31
+
32
+ waitKey (0 ); // Wait for any keystroke in the window
33
+
34
+ destroyWindow (windowName); // destroy the created window
35
+
36
+ return 0 ;
37
+ }
You can’t perform that action at this time.
0 commit comments