-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
executable file
·41 lines (33 loc) · 1.13 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
#include <iostream>
#include "src/LineSegmentation/LineSegmentation.h"
#include "src/WordSegmentation/WordSegmentation.h"
#include "src/CharacterSegmentation/CharacterSegmentation.h"
void
clear_output_folders();
int
main() {
// ToDo: Read action from main args
int action = 0; // 0 -> Segment, 1 -> Post process
if (action == 0) {
// Clear folders first
clear_output_folders();
// Call line segmentation
LineSegmentation lineSegmentation(INPUT_IMG);
lineSegmentation.segment();
// Call word segmentation
WordSegmentation wordSegmentation;
wordSegmentation.segment();
// Call character segmentation
CharacterSegmentation::segment();
} else {
}
return 0;
}
void
clear_output_folders() {
system(("exec rm -r " + string(LINE_OUTPUT_PATH) + "*").c_str());
system(("exec rm -r " + string(WORD_OUTPUT_PATH) + "*").c_str());
system(("exec rm -r " + string(CHARACTER_OUTPUT_PATH) + "*").c_str());
system(("exec rm -r " + string(CLASSIFIER_OUTPUT_PATH) + "*").c_str());
system(("exec rm -r " + string(CODE_OUTPUT_PATH) + "*").c_str());
}