Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3 | PointedEar | 1 | /*------------------------------------------------------------------------------------------*\ |
2 | This file contains material supporting chapter 1 of the cookbook: |
||
3 | Computer Vision Programming using the OpenCV Library. |
||
4 | by Robert Laganiere, Packt Publishing, 2011. |
||
5 | |||
6 | This program is free software; permission is hereby granted to use, copy, modify, |
||
7 | and distribute this source code, or portions thereof, for any purpose, without fee, |
||
8 | subject to the restriction that the copyright notice may not be removed |
||
9 | or altered from any source or altered source distribution. |
||
10 | The software is released on an as-is basis and without any warranties of any kind. |
||
11 | In particular, the software is not guaranteed to be fault-tolerant or free from failure. |
||
12 | The author disclaims all warranties with regard to this software, any use, |
||
13 | and any consequent failure, is purely the responsibility of the user. |
||
14 | |||
15 | Copyright (C) 2010-2011 Robert Laganiere, www.laganiere.name |
||
16 | \*------------------------------------------------------------------------------------------*/ |
||
17 | |||
18 | #include <opencv2/core/core.hpp> |
||
19 | #include <opencv2/highgui/highgui.hpp> |
||
20 | |||
21 | int main() { |
||
22 | |||
23 | // read an image |
||
5 | PointedEar | 24 | cv::Mat image= cv::imread("baboon1.jpg"); |
3 | PointedEar | 25 | // create image window named "My Image" |
26 | cv::namedWindow("My Image"); |
||
27 | // show the image on window |
||
28 | cv::imshow("My Image", image); |
||
29 | // wait key for 5000 ms |
||
30 | cv::waitKey(5000); |
||
31 | |||
32 | return 1; |
||
33 | } |