#include <intfeaturemap.h>
Definition at line 48 of file intfeaturemap.h.
◆ IntFeatureMap()
tesseract::IntFeatureMap::IntFeatureMap |
( |
| ) |
|
Definition at line 34 of file intfeaturemap.cpp.
35 : mapping_changed_(
true), compact_size_(0) {
36 for (
int dir = 0; dir < kNumOffsetMaps; ++dir) {
37 offset_plus_[dir] =
nullptr;
38 offset_minus_[dir] =
nullptr;
◆ ~IntFeatureMap()
tesseract::IntFeatureMap::~IntFeatureMap |
( |
| ) |
|
◆ compact_size()
int tesseract::IntFeatureMap::compact_size |
( |
| ) |
const |
|
inline |
◆ DebugMapFeatures()
void tesseract::IntFeatureMap::DebugMapFeatures |
( |
const GenericVector< int > & |
map_features | ) |
const |
Definition at line 172 of file intfeaturemap.cpp.
174 for (
int i = 0; i < map_features.
size(); ++i) {
INT_FEATURE_STRUCT InverseMapFeature(int map_feature) const
◆ DeleteMapFeature()
void tesseract::IntFeatureMap::DeleteMapFeature |
( |
int |
map_feature | ) |
|
Definition at line 63 of file intfeaturemap.cpp.
64 feature_map_.
Merge(-1, map_feature);
65 mapping_changed_ =
true;
bool Merge(int compact_index1, int compact_index2)
◆ feature_map()
const IndexMapBiDi& tesseract::IntFeatureMap::feature_map |
( |
| ) |
const |
|
inline |
◆ feature_space()
◆ FinalizeMapping()
Definition at line 159 of file intfeaturemap.cpp.
160 if (mapping_changed_) {
164 it->MapSampleFeatures(*
this);
166 mapping_changed_ =
false;
168 return compact_size_;
◆ FindNZFeatureMapping()
int tesseract::IntFeatureMap::FindNZFeatureMapping |
( |
SampleIterator * |
it | ) |
|
◆ IndexAndSortFeatures()
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
◆ IndexFeature()
Definition at line 47 of file intfeaturemap.cpp.
48 return feature_space_.
Index(f);
int Index(const INT_FEATURE_STRUCT &f) const
◆ Init()
void tesseract::IntFeatureMap::Init |
( |
const IntFeatureSpace & |
feature_space | ) |
|
Definition at line 73 of file intfeaturemap.cpp.
75 mapping_changed_ =
false;
82 if (dir.
x() == 0.0f && dir.
y() == 0.0f)
85 for (
int dir = 0; dir < kNumOffsetMaps; ++dir) {
86 delete [] offset_plus_[dir];
87 delete [] offset_minus_[dir];
91 for (
int dir = 1; dir <= kNumOffsetMaps; ++dir) {
93 int offset_index = ComputeOffsetFeature(i, dir);
94 offset_plus_[dir - 1][i] = offset_index;
95 offset_index = ComputeOffsetFeature(i, -dir);
96 offset_minus_[dir - 1][i] = offset_index;
FCOORD FeatureDirection(uint8_t theta)
const IntFeatureSpace & feature_space() const
void Init(int size, bool all_mapped)
◆ InverseIndexFeature()
INT_FEATURE_STRUCT tesseract::IntFeatureMap::InverseIndexFeature |
( |
int |
index_feature | ) |
const |
Definition at line 56 of file intfeaturemap.cpp.
INT_FEATURE_STRUCT PositionFromIndex(int index) const
◆ InverseMapFeature()
Definition at line 59 of file intfeaturemap.cpp.
int CompactToSparse(int compact_index) const
INT_FEATURE_STRUCT PositionFromIndex(int index) const
◆ IsMapFeatureDeleted()
bool tesseract::IntFeatureMap::IsMapFeatureDeleted |
( |
int |
map_feature | ) |
const |
◆ MapFeature()
Definition at line 50 of file intfeaturemap.cpp.
int Index(const INT_FEATURE_STRUCT &f) const
virtual int SparseToCompact(int sparse_index) const
◆ MapIndexedFeatures()
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
◆ MapIndexFeature()
int tesseract::IntFeatureMap::MapIndexFeature |
( |
int |
index_feature | ) |
const |
Definition at line 53 of file intfeaturemap.cpp.
virtual int SparseToCompact(int sparse_index) const
◆ OffsetFeature()
int tesseract::IntFeatureMap::OffsetFeature |
( |
int |
index_feature, |
|
|
int |
dir |
|
) |
| const |
Definition at line 113 of file intfeaturemap.cpp.
114 if (dir > 0 && dir <= kNumOffsetMaps)
115 return offset_plus_[dir - 1][index_feature];
116 else if (dir < 0 && -dir <= kNumOffsetMaps)
117 return offset_minus_[-dir - 1][index_feature];
119 return index_feature;
◆ sparse_size()
int tesseract::IntFeatureMap::sparse_size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: