forked from lluisgomez/text_extraction
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregion_classifier.h
More file actions
43 lines (30 loc) · 915 Bytes
/
region_classifier.h
File metadata and controls
43 lines (30 loc) · 915 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
38
39
40
41
42
43
#ifndef REGION_CLASSIFIER_H
#define REGION_CLASSIFIER_H
#include <opencv/cv.h>
#include <opencv/ml.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include "region.h"
using namespace cv;
using namespace std;
class RegionClassifier
{
public:
/// Constructor.
/// @param[in] trained_boost_filename
/// @param[in] decision_threshold
RegionClassifier(char *trained_boost_filename, float prediction_threshold=0.);
/// Classify a region. Returns true iif region is classified as a text character
/// @param[in] regions A pointer to the region to be classified.
bool operator()(Region *region);
/// Classify a region. Returns the average classification votes
/// @param[in] regions A pointer to the region to be classified.
float get_votes(Region *region);
private:
// Boosted tree classifier
CvBoost boost_;
// Classification parameter
float decision_threshold_;
};
#endif