16 #ifndef TESSERACT_TRAINING_TRAININGSAMPLE_H_ 17 #define TESSERACT_TRAINING_TRAININGSAMPLE_H_ 22 #include "intmatcher.h" 26 #include "shapetable.h" 27 #include "unicharset.h" 34 class IntFeatureSpace;
94 int cn_type,
int geo_type,
250 #endif // TESSERACT_TRAINING_TRAININGSAMPLE_H_ int page_num() const
Definition: trainingsample.h:128
TrainingSample * Copy() const
Definition: trainingsample.cpp:181
int font_id() const
Definition: trainingsample.h:122
void set_page_num(int page)
Definition: trainingsample.h:131
MicroFeature * micro_features_
Definition: trainingsample.h:219
Definition: intfeaturespace.h:38
UNICHAR_ID class_id_
Definition: trainingsample.h:200
const INT_FEATURE_STRUCT * features() const
Definition: trainingsample.h:143
const GenericVector< int > & mapped_features() const
Definition: trainingsample.h:182
void set_class_id(int id)
Definition: trainingsample.h:119
INT_FEATURE_STRUCT * features_
Definition: trainingsample.h:217
int geo_feature(int index) const
Definition: trainingsample.h:158
Pix * GetSamplePix(int padding, Pix *page_pix) const
Definition: trainingsample.cpp:328
void set_bounding_box(const TBOX &box)
Definition: trainingsample.h:137
int outline_length_
Definition: trainingsample.h:215
static const double kScaleValues[kSampleScaleSize]
Definition: trainingsample.h:243
void set_font_id(int id)
Definition: trainingsample.h:125
FEATURE_STRUCT * GetCNFeature() const
Definition: trainingsample.cpp:152
Definition: unicharset.h:146
void MapFeatures(const IntFeatureMap &feature_map)
Definition: trainingsample.cpp:285
static const int kYShiftValues[kSampleYShiftSize]
Definition: trainingsample.h:242
void set_is_error(bool value)
Definition: trainingsample.h:193
Definition: intfeaturemap.h:48
uint32_t num_micro_features_
Definition: trainingsample.h:211
bool features_are_indexed_
Definition: trainingsample.h:236
Definition: baseapi.cpp:94
static const int kNumCNParams
Definition: trainingsample.h:38
static TrainingSample * DeSerializeCreate(bool swap, FILE *fp)
Definition: trainingsample.cpp:78
int page_num_
Definition: trainingsample.h:205
Definition: ocrfeatures.h:60
Pix * RenderToPix(const UNICHARSET *unicharset) const
Definition: trainingsample.cpp:295
bool features_are_mapped_
Definition: trainingsample.h:237
uint32_t num_micro_features() const
Definition: trainingsample.h:146
double weight_
Definition: trainingsample.h:228
TBOX bounding_box_
Definition: trainingsample.h:207
void ExtractCharDesc(int feature_type, int micro_type, int cn_type, int geo_type, CHAR_DESC_STRUCT *char_desc)
Definition: trainingsample.cpp:204
int geo_feature_[GeoCount]
Definition: trainingsample.h:224
static const int kSampleScaleSize
Definition: trainingsample.h:42
float cn_feature(int index) const
Definition: trainingsample.h:155
int font_id_
Definition: trainingsample.h:203
void set_max_dist(double value)
Definition: trainingsample.h:170
GenericVector< int > mapped_features_
Definition: trainingsample.h:235
static TrainingSample * CopyFromFeatures(const INT_FX_RESULT_STRUCT &fx_info, const TBOX &bounding_box, const INT_FEATURE_STRUCT *features, int num_features)
Definition: trainingsample.cpp:124
void set_sample_index(int value)
Definition: trainingsample.h:176
static const int kSampleYShiftSize
Definition: trainingsample.h:40
bool DeSerialize(bool swap, FILE *fp)
Definition: trainingsample.cpp:87
double max_dist() const
Definition: trainingsample.h:167
int outline_length() const
Definition: trainingsample.h:152
float cn_feature_[kNumCNParams]
Definition: trainingsample.h:221
uint32_t num_features() const
Definition: trainingsample.h:140
static const int kSampleRandomSize
Definition: trainingsample.h:50
void IndexFeatures(const IntFeatureSpace &feature_space)
Definition: trainingsample.cpp:275
double max_dist_
Definition: trainingsample.h:231
void DisplayFeatures(ScrollView::Color color, ScrollView *window) const
Definition: trainingsample.cpp:315
void set_weight(double value)
Definition: trainingsample.h:164
int sample_index() const
Definition: trainingsample.h:173
int sample_index_
Definition: trainingsample.h:233
const MicroFeature * micro_features() const
Definition: trainingsample.h:149
Definition: intproto.h:132
bool Serialize(FILE *fp) const
Definition: trainingsample.cpp:54
const GenericVector< int > & indexed_features() const
Definition: trainingsample.h:186
Definition: featdefs.h:40
const TBOX & bounding_box() const
Definition: trainingsample.h:134
bool is_error_
Definition: trainingsample.h:239
Definition: trainingsample.h:53
uint32_t num_features_
Definition: trainingsample.h:209
~TrainingSample()
Definition: trainingsample.cpp:45
bool features_are_mapped() const
Definition: trainingsample.h:179
UNICHAR_ID class_id() const
Definition: trainingsample.h:116
bool is_error() const
Definition: trainingsample.h:190
TrainingSample()
Definition: trainingsample.h:55
double weight() const
Definition: trainingsample.h:161
TrainingSample * RandomizedCopy(int index) const
Definition: trainingsample.cpp:162