#include <intfeaturespace.h>
Definition at line 38 of file intfeaturespace.h.
◆ IntFeatureSpace()
tesseract::IntFeatureSpace::IntFeatureSpace |
( |
| ) |
|
◆ DeSerialize()
bool tesseract::IntFeatureSpace::DeSerialize |
( |
bool |
swap, |
|
|
FILE * |
fp |
|
) |
| |
◆ Index()
◆ IndexAndSortFeatures()
void tesseract::IntFeatureSpace::IndexAndSortFeatures |
( |
const INT_FEATURE_STRUCT * |
features, |
|
|
int |
num_features, |
|
|
GenericVector< int > * |
sorted_features |
|
) |
| const |
Definition at line 80 of file intfeaturespace.cpp.
84 for (
int f = 0; f < num_features; ++f)
86 sorted_features->
sort();
int Index(const INT_FEATURE_STRUCT &f) const
◆ IndexFeatures()
Definition at line 70 of file intfeaturespace.cpp.
74 for (
int f = 0; f < num_features; ++f)
int Index(const INT_FEATURE_STRUCT &f) const
◆ Init()
void tesseract::IntFeatureSpace::Init |
( |
uinT8 |
xbuckets, |
|
|
uinT8 |
ybuckets, |
|
|
uinT8 |
thetabuckets |
|
) |
| |
◆ PositionFromBuckets()
INT_FEATURE_STRUCT tesseract::IntFeatureSpace::PositionFromBuckets |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
theta |
|
) |
| const |
|
protected |
◆ PositionFromIndex()
Definition at line 62 of file intfeaturespace.cpp.
INT_FEATURE_STRUCT PositionFromBuckets(int x, int y, int theta) const
◆ Serialize()
bool tesseract::IntFeatureSpace::Serialize |
( |
FILE * |
fp | ) |
const |
◆ Size()
int tesseract::IntFeatureSpace::Size |
( |
| ) |
const |
|
inline |
◆ ThetaBucket()
int tesseract::IntFeatureSpace::ThetaBucket |
( |
int |
theta | ) |
const |
|
inlineprotected |
Definition at line 94 of file intfeaturespace.h.
int DivRounded(int a, int b)
const int kIntFeatureExtent
◆ XBucket()
int tesseract::IntFeatureSpace::XBucket |
( |
int |
x | ) |
const |
|
inlineprotected |
Definition at line 84 of file intfeaturespace.h.
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
const int kIntFeatureExtent
◆ XYToFeatureIndex()
int tesseract::IntFeatureSpace::XYToFeatureIndex |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
Definition at line 91 of file intfeaturespace.cpp.
95 for (
int theta = 0; theta <=
MAX_UINT8 && index < 0; ++theta) {
96 feature.Theta = theta;
97 index =
Index(feature);
100 tprintf(
"(%d,%d) does not exist in feature space!\n", x, y);
104 tprintf(
"Click at (%d, %d) ->(%d, %d), ->(%d, %d)\n",
105 x, y, feature.X, feature.Y, x - feature.X, y - feature.Y);
109 if (x != 0 || y != 0) {
110 double angle = atan2(static_cast<double>(y), static_cast<double>(x)) +
PI;
112 feature.Theta =
static_cast<uinT8>(angle + 0.5);
113 index =
Index(feature);
115 tprintf(
"Feature failed to map to a valid index:");
int Index(const INT_FEATURE_STRUCT &f) const
INT_FEATURE_STRUCT PositionFromIndex(int index) const
const int kIntFeatureExtent
◆ YBucket()
int tesseract::IntFeatureSpace::YBucket |
( |
int |
y | ) |
const |
|
inlineprotected |
Definition at line 88 of file intfeaturespace.h.
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
const int kIntFeatureExtent
◆ theta_buckets_
uinT8 tesseract::IntFeatureSpace::theta_buckets_ |
|
protected |
◆ x_buckets_
uinT8 tesseract::IntFeatureSpace::x_buckets_ |
|
protected |
◆ y_buckets_
uinT8 tesseract::IntFeatureSpace::y_buckets_ |
|
protected |
The documentation for this class was generated from the following files: