#include <intfeaturespace.h>
Definition at line 38 of file intfeaturespace.h.
| tesseract::IntFeatureSpace::IntFeatureSpace |
( |
| ) |
|
| bool tesseract::IntFeatureSpace::DeSerialize |
( |
bool |
swap, |
|
|
FILE * |
fp |
|
) |
| |
| 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
virtual void truncate(int size)
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
virtual void truncate(int size)
| void tesseract::IntFeatureSpace::Init |
( |
uinT8 |
xbuckets, |
|
|
uinT8 |
ybuckets, |
|
|
uinT8 |
thetabuckets |
|
) |
| |
| INT_FEATURE_STRUCT tesseract::IntFeatureSpace::PositionFromBuckets |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
theta |
|
) |
| const |
|
protected |
Definition at line 127 of file intfeaturespace.cpp.
int DivRounded(int a, int b)
const int kIntFeatureExtent
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
Definition at line 62 of file intfeaturespace.cpp.
65 index % theta_buckets_);
INT_FEATURE_STRUCT PositionFromBuckets(int x, int y, int theta) const
| bool tesseract::IntFeatureSpace::Serialize |
( |
FILE * |
fp | ) |
const |
| int tesseract::IntFeatureSpace::Size |
( |
| ) |
const |
|
inline |
| 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
| int tesseract::IntFeatureSpace::XBucket |
( |
int |
x | ) |
const |
|
inlineprotected |
Definition at line 84 of file intfeaturespace.h.
const int kIntFeatureExtent
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
| int tesseract::IntFeatureSpace::XYToFeatureIndex |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
Definition at line 91 of file intfeaturespace.cpp.
96 for (
int theta = 0; theta <=
MAX_UINT8 && index < 0; ++theta) {
97 feature.
Theta = theta;
98 index =
Index(feature);
101 tprintf(
"(%d,%d) does not exist in feature space!\n", x, y);
105 tprintf(
"Click at (%d, %d) ->(%d, %d), ->(%d, %d)\n",
106 x, y, feature.
X, feature.
Y, x - feature.
X, y - feature.
Y);
110 if (x != 0 || y != 0) {
111 double angle = atan2(static_cast<double>(y), static_cast<double>(x)) +
PI;
113 feature.
Theta =
static_cast<uinT8>(angle + 0.5);
114 index =
Index(feature);
116 tprintf(
"Feature failed to map to a valid index:");
int Index(const INT_FEATURE_STRUCT &f) const
const int kIntFeatureExtent
INT_FEATURE_STRUCT PositionFromIndex(int index) const
DLLSYM void tprintf(const char *format,...)
| int tesseract::IntFeatureSpace::YBucket |
( |
int |
y | ) |
const |
|
inlineprotected |
Definition at line 88 of file intfeaturespace.h.
const int kIntFeatureExtent
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
| uinT8 tesseract::IntFeatureSpace::theta_buckets_ |
|
protected |
| uinT8 tesseract::IntFeatureSpace::x_buckets_ |
|
protected |
| uinT8 tesseract::IntFeatureSpace::y_buckets_ |
|
protected |
The documentation for this class was generated from the following files: