tesseract
3.04.00
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
cubeclassifier.h
Go to the documentation of this file.
1
// Copyright 2011 Google Inc. All Rights Reserved.
2
// Author: rays@google.com (Ray Smith)
4
// File: cubeclassifier.h
5
// Description: Cube implementation of a ShapeClassifier.
6
// Author: Ray Smith
7
// Created: Wed Nov 23 10:36:32 PST 2011
8
//
9
// (C) Copyright 2011, Google Inc.
10
// Licensed under the Apache License, Version 2.0 (the "License");
11
// you may not use this file except in compliance with the License.
12
// You may obtain a copy of the License at
13
// http://www.apache.org/licenses/LICENSE-2.0
14
// Unless required by applicable law or agreed to in writing, software
15
// distributed under the License is distributed on an "AS IS" BASIS,
16
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
// See the License for the specific language governing permissions and
18
// limitations under the License.
19
//
21
22
#ifndef THIRD_PARTY_TESSERACT_CCMAIN_CUBECLASSIFIER_H_
23
#define THIRD_PARTY_TESSERACT_CCMAIN_CUBECLASSIFIER_H_
24
25
#include "
shapeclassifier.h
"
26
27
namespace
tesseract
{
28
29
class
Classify;
30
class
CubeRecoContext;
31
class
ShapeTable;
32
class
TessClassifier;
33
class
Tesseract;
34
class
TrainingSample;
35
struct
UnicharRating;
36
37
// Cube implementation of a ShapeClassifier.
38
class
CubeClassifier
:
public
ShapeClassifier
{
39
public
:
40
explicit
CubeClassifier
(
Tesseract
*
tesseract
);
41
virtual
~CubeClassifier
();
42
43
// Classifies the given [training] sample, writing to results.
44
// See ShapeClassifier for a full description.
45
virtual
int
UnicharClassifySample
(
const
TrainingSample
&
sample
, Pix* page_pix,
46
int
debug,
UNICHAR_ID
keep_this,
47
GenericVector<UnicharRating>
* results);
48
// Provides access to the ShapeTable that this classifier works with.
49
virtual
const
ShapeTable
*
GetShapeTable
()
const
;
50
51
private
:
52
// Cube objects.
53
CubeRecoContext
* cube_cntxt_;
54
const
ShapeTable
& shape_table_;
55
};
56
57
// Combination of Tesseract class pruner with scoring by cube.
58
class
CubeTessClassifier
:
public
ShapeClassifier
{
59
public
:
60
explicit
CubeTessClassifier
(
Tesseract
*
tesseract
);
61
virtual
~
CubeTessClassifier
();
62
63
// Classifies the given [training] sample, writing to results.
64
// See ShapeClassifier for a full description.
65
virtual
int
UnicharClassifySample
(
const
TrainingSample
&
sample
, Pix* page_pix,
66
int
debug,
UNICHAR_ID
keep_this,
67
GenericVector<UnicharRating>
* results);
68
// Provides access to the ShapeTable that this classifier works with.
69
virtual
const
ShapeTable
*
GetShapeTable
()
const
;
70
71
private
:
72
// Cube objects.
73
CubeRecoContext
* cube_cntxt_;
74
const
ShapeTable
& shape_table_;
75
TessClassifier
* pruner_;
76
};
77
78
}
// namespace tesseract
79
80
#endif
/* THIRD_PARTY_TESSERACT_CCMAIN_CUBECLASSIFIER_H_ */
tesseract
Definition:
baseapi.cpp:83
tesseract::TessClassifier
Definition:
tessclassifier.h:36
tesseract::CubeClassifier::CubeClassifier
CubeClassifier(Tesseract *tesseract)
Definition:
cubeclassifier.cpp:35
tesseract::CubeClassifier
Definition:
cubeclassifier.h:38
tesseract::CubeTessClassifier
Definition:
cubeclassifier.h:58
shapeclassifier.h
tesseract::ShapeClassifier
Definition:
shapeclassifier.h:43
UNICHAR_ID
int UNICHAR_ID
Definition:
unichar.h:33
tesseract::CubeClassifier::~CubeClassifier
virtual ~CubeClassifier()
Definition:
cubeclassifier.cpp:39
GenericVector< UnicharRating >
sample
Definition:
cluster.h:32
tesseract::Tesseract
Definition:
tesseractclass.h:170
tesseract::ShapeTable
Definition:
shapetable.h:264
tesseract::CubeClassifier::GetShapeTable
virtual const ShapeTable * GetShapeTable() const
Definition:
cubeclassifier.cpp:74
tesseract::CubeClassifier::UnicharClassifySample
virtual int UnicharClassifySample(const TrainingSample &sample, Pix *page_pix, int debug, UNICHAR_ID keep_this, GenericVector< UnicharRating > *results)
Definition:
cubeclassifier.cpp:44
tesseract::CubeRecoContext
Definition:
cube_reco_context.h:43
tesseract::TrainingSample
Definition:
trainingsample.h:53
ccmain
cubeclassifier.h
Generated by
1.8.11