-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathexple.cpp
72 lines (63 loc) · 3.14 KB
/
exple.cpp
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*============================================================================*/
/* File Description */
/*============================================================================*/
/**
* @file load_display.cpp
* @author P. FOUBERT
* @brief OpenCV project to show how to load and display an image
*/
/*============================================================================*/
/*============================================================================*/
/* Includes */
/*============================================================================*/
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
/*============================================================================*/
/* Defines */
/*============================================================================*/
/*============================================================================*/
/* Local Constants */
/*============================================================================*/
/*============================================================================*/
/* Local Types */
/*============================================================================*/
/*============================================================================*/
/* Static Variables */
/*============================================================================*/
/*============================================================================*/
/* Static Functions Prototype */
/*============================================================================*/
/******************************************************************************/
/* Public Functions */
/******************************************************************************/
/*============================================================================*/
/* Function Description */
/*============================================================================*/
/**
* @brief Main
* @param[in] argc : Number of arguments
* @param[in] argv : Arguments list
* @return <0 if error, 0 if success, >0 if warning
*/
/*============================================================================*/
int main(int /*argc*/, char** /*argv*/)
{
int res(0);
const char filename[] = "../opencv.jpg";
cv::Mat img = cv::imread(filename, cv::IMREAD_COLOR/*IMREAD_GRAYSCALE*/);
if(img.empty())
{
std::cout << "Cannot load image!" << std::endl;
res = -1;
std::cout << "Toto";
std::cout << "Toto2";
}
else
{
cv::namedWindow("image", cv::WINDOW_AUTOSIZE);
cv::imshow("image", img);
cv::waitKey(0);
}
return res;
}