#include <intfeaturemap.h>
Definition at line 48 of file intfeaturemap.h.
tesseract::IntFeatureMap::IntFeatureMap |
( |
| ) |
|
Definition at line 35 of file intfeaturemap.cpp.
36 : mapping_changed_(
true), compact_size_(0) {
37 for (
int dir = 0; dir < kNumOffsetMaps; ++dir) {
38 offset_plus_[dir] =
NULL;
39 offset_minus_[dir] =
NULL;
tesseract::IntFeatureMap::~IntFeatureMap |
( |
| ) |
|
int tesseract::IntFeatureMap::compact_size |
( |
| ) |
const |
|
inline |
void tesseract::IntFeatureMap::DebugMapFeatures |
( |
const GenericVector< int > & |
map_features | ) |
const |
Definition at line 173 of file intfeaturemap.cpp.
175 for (
int i = 0; i < map_features.
size(); ++i) {
INT_FEATURE_STRUCT InverseMapFeature(int map_feature) const
void tesseract::IntFeatureMap::DeleteMapFeature |
( |
int |
map_feature | ) |
|
Definition at line 64 of file intfeaturemap.cpp.
65 feature_map_.
Merge(-1, map_feature);
66 mapping_changed_ =
true;
bool Merge(int compact_index1, int compact_index2)
const IndexMapBiDi& tesseract::IntFeatureMap::feature_map |
( |
| ) |
const |
|
inline |
Definition at line 160 of file intfeaturemap.cpp.
161 if (mapping_changed_) {
165 it->MapSampleFeatures(*
this);
167 mapping_changed_ =
false;
169 return compact_size_;
int tesseract::IntFeatureMap::FindNZFeatureMapping |
( |
SampleIterator * |
it | ) |
|
void tesseract::IntFeatureMap::IndexAndSortFeatures |
( |
const INT_FEATURE_STRUCT * |
features, |
|
|
int |
num_features, |
|
|
GenericVector< int > * |
sorted_features |
|
) |
| const |
|
inline |
Definition at line 104 of file intfeaturemap.h.
void IndexAndSortFeatures(const INT_FEATURE_STRUCT *features, int num_features, GenericVector< int > *sorted_features) const
Definition at line 48 of file intfeaturemap.cpp.
49 return feature_space_.
Index(f);
int Index(const INT_FEATURE_STRUCT &f) const
void tesseract::IntFeatureMap::Init |
( |
const IntFeatureSpace & |
feature_space | ) |
|
Definition at line 74 of file intfeaturemap.cpp.
76 mapping_changed_ =
false;
78 feature_map_.
Init(sparse_size,
true);
83 if (dir.
x() == 0.0f && dir.
y() == 0.0f)
86 for (
int dir = 0; dir < kNumOffsetMaps; ++dir) {
87 delete [] offset_plus_[dir];
88 delete [] offset_minus_[dir];
92 for (
int dir = 1; dir <= kNumOffsetMaps; ++dir) {
94 int offset_index = ComputeOffsetFeature(i, dir);
95 offset_plus_[dir - 1][i] = offset_index;
96 offset_index = ComputeOffsetFeature(i, -dir);
97 offset_minus_[dir - 1][i] = offset_index;
void Init(int size, bool all_mapped)
FCOORD FeatureDirection(uinT8 theta)
const IntFeatureSpace & feature_space() const
INT_FEATURE_STRUCT tesseract::IntFeatureMap::InverseIndexFeature |
( |
int |
index_feature | ) |
const |
Definition at line 57 of file intfeaturemap.cpp.
INT_FEATURE_STRUCT PositionFromIndex(int index) const
Definition at line 60 of file intfeaturemap.cpp.
INT_FEATURE_STRUCT PositionFromIndex(int index) const
int CompactToSparse(int compact_index) const
bool tesseract::IntFeatureMap::IsMapFeatureDeleted |
( |
int |
map_feature | ) |
const |
Definition at line 51 of file intfeaturemap.cpp.
virtual int SparseToCompact(int sparse_index) const
int Index(const INT_FEATURE_STRUCT &f) const
int tesseract::IntFeatureMap::MapIndexedFeatures |
( |
const GenericVector< int > & |
index_features, |
|
|
GenericVector< int > * |
map_features |
|
) |
| const |
|
inline |
Definition at line 115 of file intfeaturemap.h.
117 return feature_map_.
MapFeatures(index_features, map_features);
int MapFeatures(const GenericVector< int > &sparse, GenericVector< int > *compact) const
int tesseract::IntFeatureMap::MapIndexFeature |
( |
int |
index_feature | ) |
const |
Definition at line 54 of file intfeaturemap.cpp.
virtual int SparseToCompact(int sparse_index) const
int tesseract::IntFeatureMap::OffsetFeature |
( |
int |
index_feature, |
|
|
int |
dir |
|
) |
| const |
Definition at line 114 of file intfeaturemap.cpp.
115 if (dir > 0 && dir <= kNumOffsetMaps)
116 return offset_plus_[dir - 1][index_feature];
117 else if (dir < 0 && -dir <= kNumOffsetMaps)
118 return offset_minus_[-dir - 1][index_feature];
120 return index_feature;
int tesseract::IntFeatureMap::sparse_size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: