ifndef PRODMARK_INTEGRATOR_ H_INCLUDED define PRODMARK_INTEGRATOR_ H_I

 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
#ifndef PRODMARK_INTEGRATOR_H_INCLUDED
#define PRODMARK_INTEGRATOR_H_INCLUDED
#include <vector>
#include <map>
#include "recognition.h"
#include "postprocessing.h"
namespace prodmark {
class Integrator {
public:
Integrator();
~Integrator();
int Reset();
int AddResult(const std::string& type,
const std::string& subtype,
std::vector<DocumentZoneRecognitionResult>& result,
bool& may_finish);
const std::vector<DocumentZoneRecognitionResult>& GetIntegratedResult();
const std::string GetType() const;
const std::string GetSubType() const;
private:
std::map<std::string, std::vector<std::pair< std::vector<DocumentZoneRecognitionResult>, int> > > type_;
std::map<std::string, std::vector<std::vector <double> > > max_confidence_of_row;
std::map<std::string, std::vector<std::vector <double> > > max_confidence_of_place;
std::pair<std::string, int> best_result_;
std::vector<DocumentZoneRecognitionResult> cur_result;
std::map<std::string, std::vector<int> > count_of_good_result;
};
} // namespace prodmark
#endif // PRODMARK_INTEGRATOR_H_INCLUDED