#include <intfeaturemap.h>
Definition at line 48 of file intfeaturemap.h.
◆ IntFeatureMap()
tesseract::IntFeatureMap::IntFeatureMap |
( |
| ) |
|
Definition at line 33 of file intfeaturemap.cpp.
33 : mapping_changed_(
true), compact_size_(0) {
34 for (
int dir = 0; dir < kNumOffsetMaps; ++dir) {
35 offset_plus_[dir] =
nullptr;
36 offset_minus_[dir] =
nullptr;
◆ ~IntFeatureMap()
tesseract::IntFeatureMap::~IntFeatureMap |
( |
| ) |
|
◆ compact_size()
int tesseract::IntFeatureMap::compact_size |
( |
| ) |
const |
|
inline |
◆ DebugMapFeatures()
void tesseract::IntFeatureMap::DebugMapFeatures |
( |
const std::vector< int > & |
map_features | ) |
const |
Definition at line 168 of file intfeaturemap.cpp.
169 for (
int map_feature : map_features) {
INT_FEATURE_STRUCT InverseMapFeature(int map_feature) const
◆ DeleteMapFeature()
void tesseract::IntFeatureMap::DeleteMapFeature |
( |
int |
map_feature | ) |
|
Definition at line 61 of file intfeaturemap.cpp.
62 feature_map_.
Merge(-1, map_feature);
63 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 155 of file intfeaturemap.cpp.
156 if (mapping_changed_) {
160 it->MapSampleFeatures(*
this);
162 mapping_changed_ =
false;
164 return compact_size_;
◆ FindNZFeatureMapping()
int tesseract::IntFeatureMap::FindNZFeatureMapping |
( |
SampleIterator * |
it | ) |
|
◆ IndexAndSortFeatures()
void tesseract::IntFeatureMap::IndexAndSortFeatures |
( |
const INT_FEATURE_STRUCT * |
features, |
|
|
int |
num_features, |
|
|
std::vector< int > * |
sorted_features |
|
) |
| const |
|
inline |
Definition at line 104 of file intfeaturemap.h.
void IndexAndSortFeatures(const INT_FEATURE_STRUCT *features, int num_features, std::vector< int > *sorted_features) const
◆ IndexFeature()
Definition at line 45 of file intfeaturemap.cpp.
46 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 71 of file intfeaturemap.cpp.
73 mapping_changed_ =
false;
80 if (dir.x() == 0.0f && dir.y() == 0.0f) {
84 for (
int dir = 0; dir < kNumOffsetMaps; ++dir) {
85 delete[] offset_plus_[dir];
86 delete[] offset_minus_[dir];
90 for (
int dir = 1; dir <= kNumOffsetMaps; ++dir) {
92 int offset_index = ComputeOffsetFeature(i, dir);
93 offset_plus_[dir - 1][i] = offset_index;
94 offset_index = ComputeOffsetFeature(i, -dir);
95 offset_minus_[dir - 1][i] = offset_index;
FCOORD FeatureDirection(uint8_t theta)
void Init(int size, bool all_mapped)
const IntFeatureSpace & feature_space() const
◆ InverseIndexFeature()
INT_FEATURE_STRUCT tesseract::IntFeatureMap::InverseIndexFeature |
( |
int |
index_feature | ) |
const |
Definition at line 54 of file intfeaturemap.cpp.
INT_FEATURE_STRUCT PositionFromIndex(int index) const
◆ InverseMapFeature()
◆ IsMapFeatureDeleted()
bool tesseract::IntFeatureMap::IsMapFeatureDeleted |
( |
int |
map_feature | ) |
const |
◆ MapFeature()
Definition at line 48 of file intfeaturemap.cpp.
int SparseToCompact(int sparse_index) const override
◆ MapIndexedFeatures()
int tesseract::IntFeatureMap::MapIndexedFeatures |
( |
const std::vector< int > & |
index_features, |
|
|
std::vector< int > * |
map_features |
|
) |
| const |
|
inline |
Definition at line 113 of file intfeaturemap.h.
115 return feature_map_.
MapFeatures(index_features, map_features);
int MapFeatures(const std::vector< int > &sparse, std::vector< int > *compact) const
◆ MapIndexFeature()
int tesseract::IntFeatureMap::MapIndexFeature |
( |
int |
index_feature | ) |
const |
◆ OffsetFeature()
int tesseract::IntFeatureMap::OffsetFeature |
( |
int |
index_feature, |
|
|
int |
dir |
|
) |
| const |
Definition at line 112 of file intfeaturemap.cpp.
113 if (dir > 0 && dir <= kNumOffsetMaps) {
114 return offset_plus_[dir - 1][index_feature];
115 }
else if (dir < 0 && -dir <= kNumOffsetMaps) {
116 return offset_minus_[-dir - 1][index_feature];
117 }
else if (dir == 0) {
118 return index_feature;
◆ sparse_size()
int tesseract::IntFeatureMap::sparse_size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: