16 #ifndef TESSERACT_TRAINING_TRAININGSAMPLE_H__
17 #define TESSERACT_TRAINING_TRAININGSAMPLE_H__
34 class IntFeatureSpace;
38 static const int kNumCNParams = 4;
40 static const int kSampleYShiftSize = 5;
42 static const int kSampleScaleSize = 3;
50 static const int kSampleRandomSize = kSampleYShiftSize * kSampleScaleSize - 2;
56 : class_id_(INVALID_UNICHAR_ID), font_id_(0), page_num_(0),
57 num_features_(0), num_micro_features_(0),
58 features_(
NULL), micro_features_(
NULL), weight_(1.0),
59 max_dist_(0.0), sample_index_(0),
60 features_are_indexed_(false), features_are_mapped_(false),
91 int cn_type,
int geo_type,
132 return bounding_box_;
138 return num_features_;
144 return num_micro_features_;
147 return micro_features_;
150 return cn_feature_[index];
153 return geo_feature_[index];
168 return sample_index_;
171 sample_index_ = value;
174 return features_are_mapped_;
178 return mapped_features_;
182 return mapped_features_;
205 int num_micro_features_;
211 float cn_feature_[kNumCNParams];
226 bool features_are_indexed_;
227 bool features_are_mapped_;
232 static const int kYShiftValues[kSampleYShiftSize];
233 static const double kScaleValues[kSampleScaleSize];
240 #endif // TESSERACT_TRAINING_TRAININGSAMPLE_H__