-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
52 lines (43 loc) · 1.55 KB
/
main.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
/* **************************************************************************************** */
/* main.cpp -- Projet [Kro]bot 2015/2016 */
/* -- By Valentin Leboeuf & Olivier Leveque */
/* **************************************************************************************** */
#include "detectSimpleShapes.h"
// Global variables
SimpleShapes shapes;
int edgeThresh = 1;
int low_Threshold = 50;
const int max_lowThreshold = 100;
/**
* Main
*/
int main() {
/*****
//load a picture
src = imread("/examples_img/shapes.png");
if (src.empty()) { // Verification
cout << "Error : Image cannot be loaded" <<endl;
return -1;
}
*****/
//windows
namedWindow("Image Traitee", CV_WINDOW_AUTOSIZE);
namedWindow("Image Canny", CV_WINDOW_AUTOSIZE);
//trackbar "RATIO" in "bw"
createTrackbar("Min Threshold:", "Image Canny", &low_Threshold, max_lowThreshold);
while(true){
//Extration of simple shape (triangles/rectangles/circles) from the frame
shapes = detectShapes(0, low_Threshold);
//viewing
imshow("Image Traitee", shapes.img_dst);
imshow("Image Canny", shapes.img_bw);
//ESC -- exit the loop
if (waitKey(30) == 27) {
destroyWindow("Image Traitee");
destroyWindow("Image Canny");
destroyAllWindows();
cout << "esc key is pressed by user" << endl;
return 0;
}
}
}