-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (38 loc) · 1.37 KB
/
Copy pathmain.cpp
File metadata and controls
42 lines (38 loc) · 1.37 KB
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
#include <iostream>
#include "AugmentedReality.h"
#include "ConfigManager.h"
#include "OpenCVManipulations.hpp"
#include "OpenGLManipulations.hpp"
#include <Colmap.hpp>
using namespace std;
/**
* @brief Main function to run the Augmented Reality application.
* @note This function initializes the Augmented Reality application, loads the configuration from a YAML file, and starts the OpenGL rendering loop if the test mode is set to "OpenGL".
* @see AugmentedReality
* @see IMPORTANT: AFTER COMPILING THE CODE FIRST TIME VERIFY IF CMAKEFILE HAS COMMANDS DESCRIBED IN THE OUTPUT WINDOW.
* @return 0 if the application runs successfully, -1 if there is an error in initialization or configuration.
*/
int main()
{
ConfigManager cfg("../resources/config.yaml");
if (cfg.runMode == "OpenCV") {
OpenCVManipulations::Run(cfg.opencvMode);
return 0;
}
if (cfg.runMode == "OpenGL") {
OpenGLManipulations::Run();
}
if (cfg.runMode == "COLMAP") {
Colmap colmap;
if(cfg.opencvMode == "framing") {
OpenCVManipulations opcvm;
opcvm.SaveVideoFrames(cfg.getString("video_path"), cfg.getString("video_frames_output_path"), cfg.getInt("frame_rate"));
}
colmap.RunCommandLine(cfg);
return 0;
}
else {
std::cerr << "Invalid mode specified in config file. Expected 'OpenGL'." << std::endl;
return -1;
}
}