#include <intfeaturespace.h>
Definition at line 38 of file intfeaturespace.h.
◆ IntFeatureSpace()
tesseract::IntFeatureSpace::IntFeatureSpace |
( |
| ) |
|
◆ Index()
◆ IndexAndSortFeatures()
void tesseract::IntFeatureSpace::IndexAndSortFeatures |
( |
const INT_FEATURE_STRUCT * |
features, |
|
|
int |
num_features, |
|
|
GenericVector< int > * |
sorted_features |
|
) |
| const |
Definition at line 67 of file intfeaturespace.cpp.
71 for (
int f = 0; f < num_features; ++f)
73 sorted_features->
sort();
int Index(const INT_FEATURE_STRUCT &f) const
◆ IndexFeatures()
Definition at line 57 of file intfeaturespace.cpp.
61 for (
int f = 0; f < num_features; ++f)
int Index(const INT_FEATURE_STRUCT &f) const
◆ Init()
void tesseract::IntFeatureSpace::Init |
( |
uint8_t |
xbuckets, |
|
|
uint8_t |
ybuckets, |
|
|
uint8_t |
thetabuckets |
|
) |
| |
◆ PositionFromBuckets()
INT_FEATURE_STRUCT tesseract::IntFeatureSpace::PositionFromBuckets |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
theta |
|
) |
| const |
|
protected |
◆ PositionFromIndex()
Definition at line 49 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 89 of file intfeaturespace.h.
const int kIntFeatureExtent
int DivRounded(int a, int b)
◆ XBucket()
int tesseract::IntFeatureSpace::XBucket |
( |
int |
x | ) |
const |
|
inlineprotected |
Definition at line 79 of file intfeaturespace.h.
const int kIntFeatureExtent
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
◆ XYToFeatureIndex()
int tesseract::IntFeatureSpace::XYToFeatureIndex |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
Definition at line 78 of file intfeaturespace.cpp.
82 for (
int theta = 0; theta <= UINT8_MAX && index < 0; ++theta) {
83 feature.Theta = theta;
84 index =
Index(feature);
87 tprintf(
"(%d,%d) does not exist in feature space!\n", x, y);
91 tprintf(
"Click at (%d, %d) ->(%d, %d), ->(%d, %d)\n",
92 x, y, feature.X, feature.Y, x - feature.X, y - feature.Y);
96 if (x != 0 || y != 0) {
97 double angle = atan2(static_cast<double>(y), static_cast<double>(x)) + M_PI;
99 feature.Theta =
static_cast<uint8_t
>(angle + 0.5);
100 index =
Index(feature);
102 tprintf(
"Feature failed to map to a valid index:");
const int kIntFeatureExtent
DLLSYM void tprintf(const char *format,...)
int Index(const INT_FEATURE_STRUCT &f) const
INT_FEATURE_STRUCT PositionFromIndex(int index) const
◆ YBucket()
int tesseract::IntFeatureSpace::YBucket |
( |
int |
y | ) |
const |
|
inlineprotected |
Definition at line 83 of file intfeaturespace.h.
const int kIntFeatureExtent
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
◆ theta_buckets_
uint8_t tesseract::IntFeatureSpace::theta_buckets_ |
|
protected |
◆ x_buckets_
uint8_t tesseract::IntFeatureSpace::x_buckets_ |
|
protected |
◆ y_buckets_
uint8_t tesseract::IntFeatureSpace::y_buckets_ |
|
protected |
The documentation for this class was generated from the following files: