19#ifndef TESSERACT_CLASSIFY_INTFEATURESPACE_H_
20#define TESSERACT_CLASSIFY_INTFEATURESPACE_H_
42 void Init(uint8_t xbuckets, uint8_t ybuckets, uint8_t thetabuckets);
50 return static_cast<int>(x_buckets_) * y_buckets_ * theta_buckets_;
59 return (XBucket(f.
X) * y_buckets_ + YBucket(f.
Y)) * theta_buckets_ + ThetaBucket(f.
Theta);
64 std::vector<int> *mapped_features)
const;
68 std::vector<int> *sorted_features)
const;
71 int XYToFeatureIndex(
int x,
int y)
const;
77 return ClipToRange(bucket, 0,
static_cast<int>(x_buckets_) - 1);
81 return ClipToRange(bucket, 0,
static_cast<int>(y_buckets_) - 1);
87 return Modulo(bucket, theta_buckets_);
const int kIntFeatureExtent
const int kBoostXYBuckets
const int kBoostDirBuckets
int DivRounded(int a, int b)
bool Serialize(FILE *fp, const std::vector< T > &data)
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
int Index(const INT_FEATURE_STRUCT &f) const
int ThetaBucket(int theta) const