tesseract  5.0.0-alpha-619-ge9db
tesseract::TrainingSample Class Reference

#include <trainingsample.h>

Inheritance diagram for tesseract::TrainingSample:
ELIST_LINK

Public Member Functions

 TrainingSample ()
 
 ~TrainingSample ()
 
FEATURE_STRUCTGetCNFeature () const
 
TrainingSampleRandomizedCopy (int index) const
 
TrainingSampleCopy () const
 
bool Serialize (FILE *fp) const
 
bool DeSerialize (bool swap, FILE *fp)
 
void ExtractCharDesc (int feature_type, int micro_type, int cn_type, int geo_type, CHAR_DESC_STRUCT *char_desc)
 
void IndexFeatures (const IntFeatureSpace &feature_space)
 
void MapFeatures (const IntFeatureMap &feature_map)
 
Pix * RenderToPix (const UNICHARSET *unicharset) const
 
void DisplayFeatures (ScrollView::Color color, ScrollView *window) const
 
Pix * GetSamplePix (int padding, Pix *page_pix) const
 
UNICHAR_ID class_id () const
 
void set_class_id (int id)
 
int font_id () const
 
void set_font_id (int id)
 
int page_num () const
 
void set_page_num (int page)
 
const TBOXbounding_box () const
 
void set_bounding_box (const TBOX &box)
 
uint32_t num_features () const
 
const INT_FEATURE_STRUCTfeatures () const
 
uint32_t num_micro_features () const
 
const MicroFeaturemicro_features () const
 
int outline_length () const
 
float cn_feature (int index) const
 
int geo_feature (int index) const
 
double weight () const
 
void set_weight (double value)
 
double max_dist () const
 
void set_max_dist (double value)
 
int sample_index () const
 
void set_sample_index (int value)
 
bool features_are_mapped () const
 
const GenericVector< int > & mapped_features () const
 
const GenericVector< int > & indexed_features () const
 
bool is_error () const
 
void set_is_error (bool value)
 
- Public Member Functions inherited from ELIST_LINK
 ELIST_LINK ()
 
 ELIST_LINK (const ELIST_LINK &)
 
void operator= (const ELIST_LINK &)
 

Static Public Member Functions

static TrainingSampleCopyFromFeatures (const INT_FX_RESULT_STRUCT &fx_info, const TBOX &bounding_box, const INT_FEATURE_STRUCT *features, int num_features)
 
static TrainingSampleDeSerializeCreate (bool swap, FILE *fp)
 

Detailed Description

Definition at line 53 of file trainingsample.h.

Constructor & Destructor Documentation

◆ TrainingSample()

tesseract::TrainingSample::TrainingSample ( )
inline

Definition at line 55 of file trainingsample.h.

56  : class_id_(INVALID_UNICHAR_ID), font_id_(0), page_num_(0),
57  num_features_(0), num_micro_features_(0), outline_length_(0),
58  features_(nullptr), micro_features_(nullptr), weight_(1.0),
59  max_dist_(0.0), sample_index_(0),
60  features_are_indexed_(false), features_are_mapped_(false),
61  is_error_(false) {
62  }

◆ ~TrainingSample()

tesseract::TrainingSample::~TrainingSample ( )

Definition at line 46 of file trainingsample.cpp.

46  {
47  delete [] features_;
48  delete [] micro_features_;
49 }

Member Function Documentation

◆ bounding_box()

const TBOX& tesseract::TrainingSample::bounding_box ( ) const
inline

Definition at line 134 of file trainingsample.h.

134  {
135  return bounding_box_;
136  }

◆ class_id()

UNICHAR_ID tesseract::TrainingSample::class_id ( ) const
inline

Definition at line 116 of file trainingsample.h.

116  {
117  return class_id_;
118  }

◆ cn_feature()

float tesseract::TrainingSample::cn_feature ( int  index) const
inline

Definition at line 155 of file trainingsample.h.

155  {
156  return cn_feature_[index];
157  }

◆ Copy()

TrainingSample * tesseract::TrainingSample::Copy ( ) const

Definition at line 182 of file trainingsample.cpp.

182  {
183  auto* sample = new TrainingSample;
184  sample->class_id_ = class_id_;
185  sample->font_id_ = font_id_;
186  sample->weight_ = weight_;
187  sample->sample_index_ = sample_index_;
188  sample->num_features_ = num_features_;
189  if (num_features_ > 0) {
190  sample->features_ = new INT_FEATURE_STRUCT[num_features_];
191  memcpy(sample->features_, features_, num_features_ * sizeof(features_[0]));
192  }
193  sample->num_micro_features_ = num_micro_features_;
194  if (num_micro_features_ > 0) {
195  sample->micro_features_ = new MicroFeature[num_micro_features_];
196  memcpy(sample->micro_features_, micro_features_,
197  num_micro_features_ * sizeof(micro_features_[0]));
198  }
199  memcpy(sample->cn_feature_, cn_feature_, sizeof(*cn_feature_) * kNumCNParams);
200  memcpy(sample->geo_feature_, geo_feature_, sizeof(*geo_feature_) * GeoCount);
201  return sample;
202 }

◆ CopyFromFeatures()

TrainingSample * tesseract::TrainingSample::CopyFromFeatures ( const INT_FX_RESULT_STRUCT fx_info,
const TBOX bounding_box,
const INT_FEATURE_STRUCT features,
int  num_features 
)
static

Definition at line 125 of file trainingsample.cpp.

129  {
130  auto* sample = new TrainingSample;
131  sample->num_features_ = num_features;
132  sample->features_ = new INT_FEATURE_STRUCT[num_features];
133  sample->outline_length_ = fx_info.Length;
134  memcpy(sample->features_, features, num_features * sizeof(features[0]));
135  sample->geo_feature_[GeoBottom] = bounding_box.bottom();
136  sample->geo_feature_[GeoTop] = bounding_box.top();
137  sample->geo_feature_[GeoWidth] = bounding_box.width();
138 
139  // Generate the cn_feature_ from the fx_info.
140  sample->cn_feature_[CharNormY] =
142  sample->cn_feature_[CharNormLength] =
144  sample->cn_feature_[CharNormRx] = MF_SCALE_FACTOR * fx_info.Rx;
145  sample->cn_feature_[CharNormRy] = MF_SCALE_FACTOR * fx_info.Ry;
146 
147  sample->features_are_indexed_ = false;
148  sample->features_are_mapped_ = false;
149  return sample;
150 }

◆ DeSerialize()

bool tesseract::TrainingSample::DeSerialize ( bool  swap,
FILE *  fp 
)

Definition at line 88 of file trainingsample.cpp.

88  {
89  if (fread(&class_id_, sizeof(class_id_), 1, fp) != 1) return false;
90  if (fread(&font_id_, sizeof(font_id_), 1, fp) != 1) return false;
91  if (fread(&page_num_, sizeof(page_num_), 1, fp) != 1) return false;
92  if (!bounding_box_.DeSerialize(swap, fp)) return false;
93  if (fread(&num_features_, sizeof(num_features_), 1, fp) != 1) return false;
94  if (fread(&num_micro_features_, sizeof(num_micro_features_), 1, fp) != 1)
95  return false;
96  if (fread(&outline_length_, sizeof(outline_length_), 1, fp) != 1)
97  return false;
98  if (swap) {
99  ReverseN(&class_id_, sizeof(class_id_));
100  ReverseN(&num_features_, sizeof(num_features_));
101  ReverseN(&num_micro_features_, sizeof(num_micro_features_));
102  ReverseN(&outline_length_, sizeof(outline_length_));
103  }
104  // Arbitrarily limit the number of elements to protect against bad data.
105  if (num_features_ > UINT16_MAX) return false;
106  if (num_micro_features_ > UINT16_MAX) return false;
107  delete [] features_;
108  features_ = new INT_FEATURE_STRUCT[num_features_];
109  if (fread(features_, sizeof(*features_), num_features_, fp)
110  != num_features_)
111  return false;
112  delete [] micro_features_;
113  micro_features_ = new MicroFeature[num_micro_features_];
114  if (fread(micro_features_, sizeof(*micro_features_), num_micro_features_,
115  fp) != num_micro_features_)
116  return false;
117  if (fread(cn_feature_, sizeof(*cn_feature_), kNumCNParams, fp) !=
118  kNumCNParams) return false;
119  if (fread(geo_feature_, sizeof(*geo_feature_), GeoCount, fp) != GeoCount)
120  return false;
121  return true;
122 }

◆ DeSerializeCreate()

TrainingSample * tesseract::TrainingSample::DeSerializeCreate ( bool  swap,
FILE *  fp 
)
static

Definition at line 79 of file trainingsample.cpp.

79  {
80  auto* sample = new TrainingSample;
81  if (sample->DeSerialize(swap, fp)) return sample;
82  delete sample;
83  return nullptr;
84 }

◆ DisplayFeatures()

void tesseract::TrainingSample::DisplayFeatures ( ScrollView::Color  color,
ScrollView window 
) const

Definition at line 316 of file trainingsample.cpp.

317  {
318  #ifndef GRAPHICS_DISABLED
319  for (uint32_t f = 0; f < num_features_; ++f) {
320  RenderIntFeature(window, &features_[f], color);
321  }
322  #endif // GRAPHICS_DISABLED
323 }

◆ ExtractCharDesc()

void tesseract::TrainingSample::ExtractCharDesc ( int  feature_type,
int  micro_type,
int  cn_type,
int  geo_type,
CHAR_DESC_STRUCT char_desc 
)

Definition at line 205 of file trainingsample.cpp.

209  {
210  // Extract the INT features.
211  delete[] features_;
212  FEATURE_SET_STRUCT* char_features = char_desc->FeatureSets[int_feature_type];
213  if (char_features == nullptr) {
214  tprintf("Error: no features to train on of type %s\n",
216  num_features_ = 0;
217  features_ = nullptr;
218  } else {
219  num_features_ = char_features->NumFeatures;
220  features_ = new INT_FEATURE_STRUCT[num_features_];
221  for (uint32_t f = 0; f < num_features_; ++f) {
222  features_[f].X =
223  static_cast<uint8_t>(char_features->Features[f]->Params[IntX]);
224  features_[f].Y =
225  static_cast<uint8_t>(char_features->Features[f]->Params[IntY]);
226  features_[f].Theta =
227  static_cast<uint8_t>(char_features->Features[f]->Params[IntDir]);
228  features_[f].CP_misses = 0;
229  }
230  }
231  // Extract the Micro features.
232  delete[] micro_features_;
233  char_features = char_desc->FeatureSets[micro_type];
234  if (char_features == nullptr) {
235  tprintf("Error: no features to train on of type %s\n",
237  num_micro_features_ = 0;
238  micro_features_ = nullptr;
239  } else {
240  num_micro_features_ = char_features->NumFeatures;
241  micro_features_ = new MicroFeature[num_micro_features_];
242  for (uint32_t f = 0; f < num_micro_features_; ++f) {
243  for (int d = 0; d < MFCount; ++d) {
244  micro_features_[f][d] = char_features->Features[f]->Params[d];
245  }
246  }
247  }
248  // Extract the CN feature.
249  char_features = char_desc->FeatureSets[cn_type];
250  if (char_features == nullptr) {
251  tprintf("Error: no CN feature to train on.\n");
252  } else {
253  ASSERT_HOST(char_features->NumFeatures == 1);
254  cn_feature_[CharNormY] = char_features->Features[0]->Params[CharNormY];
255  cn_feature_[CharNormLength] =
256  char_features->Features[0]->Params[CharNormLength];
257  cn_feature_[CharNormRx] = char_features->Features[0]->Params[CharNormRx];
258  cn_feature_[CharNormRy] = char_features->Features[0]->Params[CharNormRy];
259  }
260  // Extract the Geo feature.
261  char_features = char_desc->FeatureSets[geo_type];
262  if (char_features == nullptr) {
263  tprintf("Error: no Geo feature to train on.\n");
264  } else {
265  ASSERT_HOST(char_features->NumFeatures == 1);
266  geo_feature_[GeoBottom] = char_features->Features[0]->Params[GeoBottom];
267  geo_feature_[GeoTop] = char_features->Features[0]->Params[GeoTop];
268  geo_feature_[GeoWidth] = char_features->Features[0]->Params[GeoWidth];
269  }
270  features_are_indexed_ = false;
271  features_are_mapped_ = false;
272 }

◆ features()

const INT_FEATURE_STRUCT* tesseract::TrainingSample::features ( ) const
inline

Definition at line 143 of file trainingsample.h.

143  {
144  return features_;
145  }

◆ features_are_mapped()

bool tesseract::TrainingSample::features_are_mapped ( ) const
inline

Definition at line 179 of file trainingsample.h.

179  {
180  return features_are_mapped_;
181  }

◆ font_id()

int tesseract::TrainingSample::font_id ( ) const
inline

Definition at line 122 of file trainingsample.h.

122  {
123  return font_id_;
124  }

◆ geo_feature()

int tesseract::TrainingSample::geo_feature ( int  index) const
inline

Definition at line 158 of file trainingsample.h.

158  {
159  return geo_feature_[index];
160  }

◆ GetCNFeature()

FEATURE_STRUCT * tesseract::TrainingSample::GetCNFeature ( ) const

Definition at line 153 of file trainingsample.cpp.

153  {
154  FEATURE feature = NewFeature(&CharNormDesc);
155  for (int i = 0; i < kNumCNParams; ++i)
156  feature->Params[i] = cn_feature_[i];
157  return feature;
158 }

◆ GetSamplePix()

Pix * tesseract::TrainingSample::GetSamplePix ( int  padding,
Pix *  page_pix 
) const

Definition at line 329 of file trainingsample.cpp.

329  {
330  if (page_pix == nullptr)
331  return nullptr;
332  int page_width = pixGetWidth(page_pix);
333  int page_height = pixGetHeight(page_pix);
334  TBOX padded_box = bounding_box();
335  padded_box.pad(padding, padding);
336  // Clip the padded_box to the limits of the page
337  TBOX page_box(0, 0, page_width, page_height);
338  padded_box &= page_box;
339  Box* box = boxCreate(page_box.left(), page_height - page_box.top(),
340  page_box.width(), page_box.height());
341  Pix* sample_pix = pixClipRectangle(page_pix, box, nullptr);
342  boxDestroy(&box);
343  return sample_pix;
344 }

◆ indexed_features()

const GenericVector<int>& tesseract::TrainingSample::indexed_features ( ) const
inline

Definition at line 186 of file trainingsample.h.

186  {
187  ASSERT_HOST(features_are_indexed_);
188  return mapped_features_;
189  }

◆ IndexFeatures()

void tesseract::TrainingSample::IndexFeatures ( const IntFeatureSpace feature_space)

Definition at line 276 of file trainingsample.cpp.

276  {
278  feature_space.IndexAndSortFeatures(features_, num_features_,
279  &mapped_features_);
280  features_are_indexed_ = true;
281  features_are_mapped_ = false;
282 }

◆ is_error()

bool tesseract::TrainingSample::is_error ( ) const
inline

Definition at line 190 of file trainingsample.h.

190  {
191  return is_error_;
192  }

◆ MapFeatures()

void tesseract::TrainingSample::MapFeatures ( const IntFeatureMap feature_map)

Definition at line 286 of file trainingsample.cpp.

286  {
288  feature_map.feature_space().IndexAndSortFeatures(features_, num_features_,
290  feature_map.MapIndexedFeatures(indexed_features, &mapped_features_);
291  features_are_indexed_ = false;
292  features_are_mapped_ = true;
293 }

◆ mapped_features()

const GenericVector<int>& tesseract::TrainingSample::mapped_features ( ) const
inline

Definition at line 182 of file trainingsample.h.

182  {
183  ASSERT_HOST(features_are_mapped_);
184  return mapped_features_;
185  }

◆ max_dist()

double tesseract::TrainingSample::max_dist ( ) const
inline

Definition at line 167 of file trainingsample.h.

167  {
168  return max_dist_;
169  }

◆ micro_features()

const MicroFeature* tesseract::TrainingSample::micro_features ( ) const
inline

Definition at line 149 of file trainingsample.h.

149  {
150  return micro_features_;
151  }

◆ num_features()

uint32_t tesseract::TrainingSample::num_features ( ) const
inline

Definition at line 140 of file trainingsample.h.

140  {
141  return num_features_;
142  }

◆ num_micro_features()

uint32_t tesseract::TrainingSample::num_micro_features ( ) const
inline

Definition at line 146 of file trainingsample.h.

146  {
147  return num_micro_features_;
148  }

◆ outline_length()

int tesseract::TrainingSample::outline_length ( ) const
inline

Definition at line 152 of file trainingsample.h.

152  {
153  return outline_length_;
154  }

◆ page_num()

int tesseract::TrainingSample::page_num ( ) const
inline

Definition at line 128 of file trainingsample.h.

128  {
129  return page_num_;
130  }

◆ RandomizedCopy()

TrainingSample * tesseract::TrainingSample::RandomizedCopy ( int  index) const

Definition at line 163 of file trainingsample.cpp.

163  {
165  if (index >= 0 && index < kSampleRandomSize) {
166  ++index; // Remove the first combination.
167  const int yshift = kYShiftValues[index / kSampleScaleSize];
168  double scaling = kScaleValues[index % kSampleScaleSize];
169  for (uint32_t i = 0; i < num_features_; ++i) {
170  double result = (features_[i].X - kRandomizingCenter) * scaling;
171  result += kRandomizingCenter;
172  sample->features_[i].X = ClipToRange<int>(result + 0.5, 0, UINT8_MAX);
173  result = (features_[i].Y - kRandomizingCenter) * scaling;
174  result += kRandomizingCenter + yshift;
175  sample->features_[i].Y = ClipToRange<int>(result + 0.5, 0, UINT8_MAX);
176  }
177  }
178  return sample;
179 }

◆ RenderToPix()

Pix * tesseract::TrainingSample::RenderToPix ( const UNICHARSET unicharset) const

Definition at line 296 of file trainingsample.cpp.

296  {
297  Pix* pix = pixCreate(kIntFeatureExtent, kIntFeatureExtent, 1);
298  for (uint32_t f = 0; f < num_features_; ++f) {
299  int start_x = features_[f].X;
300  int start_y = kIntFeatureExtent - features_[f].Y;
301  double dx = cos((features_[f].Theta / 256.0) * 2.0 * M_PI - M_PI);
302  double dy = -sin((features_[f].Theta / 256.0) * 2.0 * M_PI - M_PI);
303  for (int i = 0; i <= 5; ++i) {
304  int x = static_cast<int>(start_x + dx * i);
305  int y = static_cast<int>(start_y + dy * i);
306  if (x >= 0 && x < 256 && y >= 0 && y < 256)
307  pixSetPixel(pix, x, y, 1);
308  }
309  }
310  if (unicharset != nullptr)
311  pixSetText(pix, unicharset->id_to_unichar(class_id_));
312  return pix;
313 }

◆ sample_index()

int tesseract::TrainingSample::sample_index ( ) const
inline

Definition at line 173 of file trainingsample.h.

173  {
174  return sample_index_;
175  }

◆ Serialize()

bool tesseract::TrainingSample::Serialize ( FILE *  fp) const

Definition at line 55 of file trainingsample.cpp.

55  {
56  if (fwrite(&class_id_, sizeof(class_id_), 1, fp) != 1) return false;
57  if (fwrite(&font_id_, sizeof(font_id_), 1, fp) != 1) return false;
58  if (fwrite(&page_num_, sizeof(page_num_), 1, fp) != 1) return false;
59  if (!bounding_box_.Serialize(fp)) return false;
60  if (fwrite(&num_features_, sizeof(num_features_), 1, fp) != 1) return false;
61  if (fwrite(&num_micro_features_, sizeof(num_micro_features_), 1, fp) != 1)
62  return false;
63  if (fwrite(&outline_length_, sizeof(outline_length_), 1, fp) != 1)
64  return false;
65  if (fwrite(features_, sizeof(*features_), num_features_, fp) != num_features_)
66  return false;
67  if (fwrite(micro_features_, sizeof(*micro_features_), num_micro_features_,
68  fp) != num_micro_features_)
69  return false;
70  if (fwrite(cn_feature_, sizeof(*cn_feature_), kNumCNParams, fp) !=
71  kNumCNParams) return false;
72  if (fwrite(geo_feature_, sizeof(*geo_feature_), GeoCount, fp) != GeoCount)
73  return false;
74  return true;
75 }

◆ set_bounding_box()

void tesseract::TrainingSample::set_bounding_box ( const TBOX box)
inline

Definition at line 137 of file trainingsample.h.

137  {
138  bounding_box_ = box;
139  }

◆ set_class_id()

void tesseract::TrainingSample::set_class_id ( int  id)
inline

Definition at line 119 of file trainingsample.h.

119  {
120  class_id_ = id;
121  }

◆ set_font_id()

void tesseract::TrainingSample::set_font_id ( int  id)
inline

Definition at line 125 of file trainingsample.h.

125  {
126  font_id_ = id;
127  }

◆ set_is_error()

void tesseract::TrainingSample::set_is_error ( bool  value)
inline

Definition at line 193 of file trainingsample.h.

193  {
194  is_error_ = value;
195  }

◆ set_max_dist()

void tesseract::TrainingSample::set_max_dist ( double  value)
inline

Definition at line 170 of file trainingsample.h.

170  {
171  max_dist_ = value;
172  }

◆ set_page_num()

void tesseract::TrainingSample::set_page_num ( int  page)
inline

Definition at line 131 of file trainingsample.h.

131  {
132  page_num_ = page;
133  }

◆ set_sample_index()

void tesseract::TrainingSample::set_sample_index ( int  value)
inline

Definition at line 176 of file trainingsample.h.

176  {
177  sample_index_ = value;
178  }

◆ set_weight()

void tesseract::TrainingSample::set_weight ( double  value)
inline

Definition at line 164 of file trainingsample.h.

164  {
165  weight_ = value;
166  }

◆ weight()

double tesseract::TrainingSample::weight ( ) const
inline

Definition at line 161 of file trainingsample.h.

161  {
162  return weight_;
163  }

The documentation for this class was generated from the following files:
MFCount
Definition: mf.h:43
tesseract::TrainingSample::features
const INT_FEATURE_STRUCT * features() const
Definition: trainingsample.h:143
tesseract::TrainingSample::indexed_features
const GenericVector< int > & indexed_features() const
Definition: trainingsample.h:186
ASSERT_HOST
#define ASSERT_HOST(x)
Definition: errcode.h:87
IntY
Definition: picofeat.h:45
INT_FEATURE_STRUCT::Theta
uint8_t Theta
Definition: intproto.h:141
CHAR_DESC_STRUCT::FeatureSets
FEATURE_SET FeatureSets[NUM_FEATURE_TYPES]
Definition: featdefs.h:40
TBOX::top
int16_t top() const
Definition: rect.h:57
FEATURE_STRUCT
Definition: ocrfeatures.h:58
GeoWidth
Definition: picofeat.h:38
MF_SCALE_FACTOR
const float MF_SCALE_FACTOR
Definition: mfoutline.h:70
kIntFeatureType
const char *const kIntFeatureType
Definition: featdefs.cpp:33
tesseract::TrainingSample::num_features
uint32_t num_features() const
Definition: trainingsample.h:140
tesseract::kRandomizingCenter
const int kRandomizingCenter
Definition: trainingsample.cpp:36
IntX
Definition: picofeat.h:44
IntDir
Definition: picofeat.h:46
tesseract::TrainingSample::Copy
TrainingSample * Copy() const
Definition: trainingsample.cpp:182
INT_FX_RESULT_STRUCT::Ry
int16_t Ry
Definition: intfx.h:37
INT_FX_RESULT_STRUCT::Ymean
int16_t Ymean
Definition: intfx.h:36
INT_FX_RESULT_STRUCT::Rx
int16_t Rx
Definition: intfx.h:37
TBOX::Serialize
bool Serialize(FILE *fp) const
Definition: rect.cpp:179
TBOX::DeSerialize
bool DeSerialize(bool swap, FILE *fp)
Definition: rect.cpp:186
CharNormLength
Definition: normfeat.h:29
LENGTH_COMPRESSION
#define LENGTH_COMPRESSION
Definition: normfeat.h:26
TBOX::width
int16_t width() const
Definition: rect.h:114
TBOX::bottom
int16_t bottom() const
Definition: rect.h:64
FEATURE_SET_STRUCT::Features
FEATURE Features[1]
Definition: ocrfeatures.h:67
INT_FEATURE_STRUCT::Y
uint8_t Y
Definition: intproto.h:140
FEATURE_STRUCT::Params
float Params[1]
Definition: ocrfeatures.h:60
kMicroFeatureType
const char *const kMicroFeatureType
Definition: featdefs.cpp:31
NewFeature
FEATURE NewFeature(const FEATURE_DESC_STRUCT *FeatureDesc)
Definition: ocrfeatures.cpp:77
sample
Definition: cluster.h:31
GenericVector< int >
FEATURE_SET_STRUCT
Definition: ocrfeatures.h:64
GeoTop
Definition: picofeat.h:37
tesseract::TrainingSample::bounding_box
const TBOX & bounding_box() const
Definition: trainingsample.h:134
CharNormDesc
const FEATURE_DESC_STRUCT CharNormDesc
GeoCount
Definition: picofeat.h:40
INT_FEATURE_STRUCT::CP_misses
int8_t CP_misses
Definition: intproto.h:142
TBOX::pad
void pad(int xpad, int ypad)
Definition: rect.h:130
INT_FEATURE_STRUCT
Definition: intproto.h:131
INT_FX_RESULT_STRUCT::Length
int32_t Length
Definition: intfx.h:35
GeoBottom
Definition: picofeat.h:36
tprintf
DLLSYM void tprintf(const char *format,...)
Definition: tprintf.cpp:34
tesseract::TrainingSample::TrainingSample
TrainingSample()
Definition: trainingsample.h:55
MicroFeature
float MicroFeature[MFCount]
Definition: mf.h:32
ReverseN
void ReverseN(void *ptr, int num_bytes)
Definition: helpers.h:183
UNICHARSET::id_to_unichar
const char * id_to_unichar(UNICHAR_ID id) const
Definition: unicharset.cpp:290
FEATURE_SET_STRUCT::NumFeatures
uint16_t NumFeatures
Definition: ocrfeatures.h:65
INT_FEATURE_STRUCT::X
uint8_t X
Definition: intproto.h:139
CharNormY
Definition: normfeat.h:29
kIntFeatureExtent
const int kIntFeatureExtent
Definition: intfeaturespace.h:27
kBlnBaselineOffset
const int kBlnBaselineOffset
Definition: normalis.h:24
RenderIntFeature
void RenderIntFeature(ScrollView *window, const INT_FEATURE_STRUCT *Feature, ScrollView::Color color)
Definition: intproto.cpp:1603
CharNormRx
Definition: normfeat.h:29
TBOX
Definition: rect.h:33
CharNormRy
Definition: normfeat.h:29