20 #ifndef TESSERACT_CLASSIFY_INTFEATURESPACE_H__ 21 #define TESSERACT_CLASSIFY_INTFEATURESPACE_H__ 48 bool Serialize(FILE* fp)
const;
53 bool DeSerialize(
bool swap, FILE* fp);
57 return static_cast<int>(x_buckets_) * y_buckets_ * theta_buckets_;
66 return (XBucket(f.
X) * y_buckets_ + YBucket(f.
Y)) * theta_buckets_ +
80 int XYToFeatureIndex(
int x,
int y)
const;
86 return ClipToRange(bucket, 0, static_cast<int>(x_buckets_) - 1);
90 return ClipToRange(bucket, 0, static_cast<int>(y_buckets_) - 1);
96 return Modulo(bucket, theta_buckets_);
110 #endif // TESSERACT_CLASSIFY_INTFEATURESPACE_H__
T ClipToRange(const T &x, const T &lower_bound, const T &upper_bound)
const int kBoostXYBuckets
int Index(const INT_FEATURE_STRUCT &f) const
int DivRounded(int a, int b)
const int kBoostDirBuckets
int ThetaBucket(int theta) const
const int kIntFeatureExtent