#include <intfeaturemap.h>
List of all members.
Detailed Description
Definition at line 48 of file intfeaturemap.h.
Constructor & Destructor Documentation
tesseract::IntFeatureMap::IntFeatureMap |
( |
| ) |
|
Definition at line 35 of file intfeaturemap.cpp.
: mapping_changed_(true), compact_size_(0) {
for (int dir = 0; dir < kNumOffsetMaps; ++dir) {
offset_plus_[dir] =
NULL;
offset_minus_[dir] =
NULL;
}
}
tesseract::IntFeatureMap::~IntFeatureMap |
( |
| ) |
|
Member Function Documentation
int tesseract::IntFeatureMap::compact_size |
( |
| ) |
const |
|
inline |
void tesseract::IntFeatureMap::DebugMapFeatures |
( |
const GenericVector< int > & |
map_features | ) |
const |
void tesseract::IntFeatureMap::DeleteMapFeature |
( |
int |
map_feature | ) |
|
const IndexMapBiDi& tesseract::IntFeatureMap::feature_map |
( |
| ) |
const |
|
inline |
Definition at line 160 of file intfeaturemap.cpp.
{
if (mapping_changed_) {
#ifdef EXPERIMENT_ON
it->MapSampleFeatures(*this);
#endif
mapping_changed_ = false;
}
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 |
void tesseract::IntFeatureMap::Init |
( |
const IntFeatureSpace & |
feature_space | ) |
|
Definition at line 74 of file intfeaturemap.cpp.
{
mapping_changed_ = false;
feature_map_.
Init(sparse_size,
true);
if (dir.
x() == 0.0f && dir.
y() == 0.0f)
for (int dir = 0; dir < kNumOffsetMaps; ++dir) {
delete [] offset_plus_[dir];
delete [] offset_minus_[dir];
}
for (int dir = 1; dir <= kNumOffsetMaps; ++dir) {
int offset_index = ComputeOffsetFeature(i, dir);
offset_plus_[dir - 1][i] = offset_index;
offset_index = ComputeOffsetFeature(i, -dir);
offset_minus_[dir - 1][i] = offset_index;
}
}
}
INT_FEATURE_STRUCT tesseract::IntFeatureMap::InverseIndexFeature |
( |
int |
index_feature | ) |
const |
bool tesseract::IntFeatureMap::IsMapFeatureDeleted |
( |
int |
map_feature | ) |
const |
int tesseract::IntFeatureMap::MapIndexedFeatures |
( |
const GenericVector< int > & |
index_features, |
|
|
GenericVector< int > * |
map_features |
|
) |
| const |
|
inline |
int tesseract::IntFeatureMap::MapIndexFeature |
( |
int |
index_feature | ) |
const |
int tesseract::IntFeatureMap::OffsetFeature |
( |
int |
index_feature, |
|
|
int |
dir |
|
) |
| const |
Definition at line 114 of file intfeaturemap.cpp.
{
if (dir > 0 && dir <= kNumOffsetMaps)
return offset_plus_[dir - 1][index_feature];
else if (dir < 0 && -dir <= kNumOffsetMaps)
return offset_minus_[-dir - 1][index_feature];
else if (dir == 0)
return index_feature;
else
return -1;
}
int tesseract::IntFeatureMap::sparse_size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: