Signapse
main.cpp
Go to the documentation of this file.
1#include <opencv2/core.hpp>
2#include <opencv2/videoio.hpp>
3#include <opencv2/imgproc.hpp>
4
5#include <iostream>
6#include <stdio.h>
7#include <queue>
8
9#include "Camera.h"
10#include "CNNProcessor.h"
11#include "stdlib.h"
12#include "Gui.h"
13#include "PreProcessor.h"
14#include "SignapseUtils.h"
15#include "LinkSplitter.h"
16
17using namespace cv;
18using namespace std;
19
20int main(int argc, char* argv[]){
21 SignapseUtils::welcomeMessage();
22
23 //init Qt and Ui
24 QApplication app(argc, argv);
25 QMainWindow window;
26 Ui_MainWindow ui;
27
28 //make pipeline components
29 CameraSettings cameraSettings;
30 Camera camera(cameraSettings);
31 PreProcessorSettings preProcessorSettings;
32 PreProcessor preProcessor(preProcessorSettings);
33 LinkSplitter linkSplitter;
34 CNNProcessorSettings cnnSettings;
35 CNNProcessor cnn(cnnSettings);
36 Gui gui(&window, &ui);
37
38 //register callbacks (link pipeline)
39 camera.RegisterCallback(&preProcessor);
40 preProcessor.RegisterCallback(&linkSplitter);
41 linkSplitter.RegisterCallback(&cnn);
42 linkSplitter.RegisterSecondaryCallback(&gui);
43 cnn.RegisterCallback(&gui);
44
45 //start camera and cnn
46 cnn.Start();
47 camera.Start();
48
49 //start gui
50 gui.SetVisible(true);
51 app.exec(); //loops main thread
52
53 //stop camera and cnn
54 camera.Stop();
55 cnn.Stop();
56
57 //exit
58 return 0;
59}
60
Definition: Camera.h:15
void Start()
Definition: Camera.cpp:53
void Stop()
Definition: Camera.cpp:61
Definition: Gui.h:22
void SetVisible(bool visible)
Definition: Gui.cpp:47
void RegisterSecondaryCallback(SceneCallback *scb)
int main(int argc, char *argv[])
Definition: main.cpp:20