-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.cpp
More file actions
37 lines (31 loc) · 741 Bytes
/
Copy pathexample.cpp
File metadata and controls
37 lines (31 loc) · 741 Bytes
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
#include "preproc.hpp"
#include "ocr.hpp"
#include "parser.hpp"
using namespace std;
using namespace cv;
void get_data(string path)
{
stringstream text;
fstream res;
/* the result will be saved to file with the same name, but .csv */
string name = get_name(path);
// Mat im = imread(path);
// /* scan from image */
// scan(im, im);
Mat im;
/* scan from path */
scan(path, im);
res.open(name + ".csv", fstream::out);
/* text contains the ocr's output */
ocr(im, text);
/* saves the output into a .csv file: item,price */
process(text, res);
res.close();
}
int main()
{
/* path to the image file */
string path = "image.png";
get_data(path);
return 0;
}