tesseract
3.05.02
feature_bmp.h
Go to the documentation of this file.
1
/**********************************************************************
2
* File: feature_bmp.h
3
* Description: Declaration of the Bitmap Feature Class
4
* Author: PingPing xiu (xiupingping) & Ahmad Abdulkader
5
* Created: 2007
6
*
7
* (C) Copyright 2008, Google Inc.
8
** Licensed under the Apache License, Version 2.0 (the "License");
9
** you may not use this file except in compliance with the License.
10
** You may obtain a copy of the License at
11
** http://www.apache.org/licenses/LICENSE-2.0
12
** Unless required by applicable law or agreed to in writing, software
13
** distributed under the License is distributed on an "AS IS" BASIS,
14
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
** See the License for the specific language governing permissions and
16
** limitations under the License.
17
*
18
**********************************************************************/
19
20
// The FeatureBmp class implements a Bitmap feature extractor class. It
21
// inherits from the FeatureBase class
22
// The Bitmap feature vectors is the the bitmap of the specified CharSamp
23
// scaled to a fixed grid size and then augmented by a 5 aux features that
24
// describe the size, aspect ration and placement within a word
25
26
#ifndef FEATURE_BMP_H
27
#define FEATURE_BMP_H
28
29
#include "
char_samp.h
"
30
#include "
feature_base.h
"
31
32
namespace
tesseract
{
33
class
FeatureBmp
:
public
FeatureBase
{
34
public
:
35
explicit
FeatureBmp
(
TuningParams
*params);
36
virtual
~FeatureBmp
();
37
// Render a visualization of the features to a CharSamp.
38
// This is mainly used by visual-debuggers
39
virtual
CharSamp
*
ComputeFeatureBitmap
(
CharSamp
*samp);
40
// Compute the features for a given CharSamp
41
virtual
bool
ComputeFeatures
(
CharSamp
*samp,
float
*features);
42
// Returns the count of features
43
virtual
int
FeatureCnt
() {
44
return
5 + (
conv_grid_size_
*
conv_grid_size_
);
45
}
46
47
protected
:
48
// grid size, cached from the TuningParams object
49
int
conv_grid_size_
;
50
};
51
}
52
53
#endif // FEATURE_BMP_H
tesseract::TuningParams
Definition:
tuning_params.h:33
tesseract::CharSamp
Definition:
char_samp.h:39
tesseract::FeatureBmp::FeatureBmp
FeatureBmp(TuningParams *params)
Definition:
feature_bmp.cpp:31
tesseract::FeatureBmp::ComputeFeatureBitmap
virtual CharSamp * ComputeFeatureBitmap(CharSamp *samp)
Definition:
feature_bmp.cpp:41
tesseract::FeatureBmp::conv_grid_size_
int conv_grid_size_
Definition:
feature_bmp.h:49
char_samp.h
tesseract::FeatureBmp::~FeatureBmp
virtual ~FeatureBmp()
Definition:
feature_bmp.cpp:36
tesseract::FeatureBmp::ComputeFeatures
virtual bool ComputeFeatures(CharSamp *samp, float *features)
Definition:
feature_bmp.cpp:46
tesseract
Definition:
baseapi.cpp:81
tesseract::FeatureBmp
Definition:
feature_bmp.h:33
feature_base.h
tesseract::FeatureBmp::FeatureCnt
virtual int FeatureCnt()
Definition:
feature_bmp.h:43
tesseract::FeatureBase
Definition:
feature_base.h:34
cube
feature_bmp.h
Generated on Mon Oct 29 2018 11:27:49 for tesseract by
1.8.14