Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
picofeat.h File Reference
#include "ocrfeatures.h"
#include "params.h"

Go to the source code of this file.

Macros

#define MAX_PICO_FEATURES   (1000)
 
#define GetPicoFeatureLength()   (PicoFeatureLength)
 

Enumerations

enum  IntParams { IntX, IntY, IntDir }
 
enum  GeoParams { GeoBottom, GeoTop, GeoWidth, GeoCount }
 
enum  PICO_FEAT_PARAM_NAME { PicoFeatY, PicoFeatDir, PicoFeatX }
 

Functions

FEATURE_SET ExtractIntCNFeatures (TBLOB *Blob, const DENORM &denorm)
 
FEATURE_SET ExtractIntGeoFeatures (TBLOB *Blob, const DENORM &denorm)
 

Variables

double classify_pico_feature_length = 0.05
 
FLOAT32 PicoFeatureLength
 

Macro Definition Documentation

#define GetPicoFeatureLength ( )    (PicoFeatureLength)

Public Function Prototypes

Definition at line 59 of file picofeat.h.

#define MAX_PICO_FEATURES   (1000)

Definition at line 47 of file picofeat.h.

Enumeration Type Documentation

enum GeoParams
Enumerator
GeoBottom 
GeoTop 
GeoWidth 
GeoCount 

Definition at line 35 of file picofeat.h.

35  {
36  GeoBottom, // Bounding box bottom in baseline space (0-255).
37  GeoTop, // Bounding box top in baseline space (0-255).
38  GeoWidth, // Bounding box width in baseline space (0-255).
39 
40  GeoCount // Number of geo features.
41 };
enum IntParams

Include Files and Type Defines

Enumerator
IntX 
IntY 
IntDir 

Definition at line 28 of file picofeat.h.

28  {
29  IntX, // x-position (0-255).
30  IntY, // y-position (0-255).
31  IntDir // Direction (0-255, circular).
32 };
Definition: picofeat.h:29
Definition: picofeat.h:30
Enumerator
PicoFeatY 
PicoFeatDir 
PicoFeatX 

Definition at line 43 of file picofeat.h.

Function Documentation

FEATURE_SET ExtractIntCNFeatures ( TBLOB Blob,
const DENORM denorm 
)

Definition at line 227 of file picofeat.cpp.

227  {
228 /*
229  ** Parameters:
230  ** blob blob to extract features from
231  ** denorm normalization/denormalization parameters.
232  ** Return: Integer character-normalized features for blob.
233  ** Exceptions: none
234  ** History: 8/8/2011, rays, Created.
235  */
237  tesseract::NM_CHAR_ANISOTROPIC, blob, denorm);
238  if (sample == NULL) return NULL;
239 
240  int num_features = sample->num_features();
241  const INT_FEATURE_STRUCT* features = sample->features();
242  FEATURE_SET feature_set = NewFeatureSet(num_features);
243  for (int f = 0; f < num_features; ++f) {
244  FEATURE feature = NewFeature(&IntFeatDesc);
245 
246  feature->Params[IntX] = features[f].X;
247  feature->Params[IntY] = features[f].Y;
248  feature->Params[IntDir] = features[f].Theta;
249  AddFeature(feature_set, feature);
250  }
251  delete sample;
252 
253  return feature_set;
254 } /* ExtractIntCNFeatures */
FEATURE_SET NewFeatureSet(int NumFeatures)
TrainingSample * GetIntFeatures(tesseract::NormalizationMode mode, TBLOB *blob, const DENORM &denorm)
Definition: intfx.cpp:97
Definition: cluster.h:32
#define NULL
Definition: host.h:144
Definition: picofeat.h:29
#define f(xc, yc)
Definition: imgscale.cpp:39
BOOL8 AddFeature(FEATURE_SET FeatureSet, FEATURE Feature)
Definition: ocrfeatures.cpp:35
FEATURE NewFeature(const FEATURE_DESC_STRUCT *FeatureDesc)
Definition: picofeat.h:30
const FEATURE_DESC_STRUCT IntFeatDesc
FLOAT32 Params[1]
Definition: ocrfeatures.h:64
const INT_FEATURE_STRUCT * features() const
FEATURE_SET ExtractIntGeoFeatures ( TBLOB Blob,
const DENORM denorm 
)

Definition at line 257 of file picofeat.cpp.

257  {
258 /*
259  ** Parameters:
260  ** blob blob to extract features from
261  ** denorm normalization/denormalization parameters.
262  ** Return: Geometric (top/bottom/width) features for blob.
263  ** Exceptions: none
264  ** History: 8/8/2011, rays, Created.
265  */
267  tesseract::NM_CHAR_ANISOTROPIC, blob, denorm);
268  if (sample == NULL) return NULL;
269 
270  FEATURE_SET feature_set = NewFeatureSet(1);
271  FEATURE feature = NewFeature(&IntFeatDesc);
272 
273  feature->Params[GeoBottom] = sample->geo_feature(GeoBottom);
274  feature->Params[GeoTop] = sample->geo_feature(GeoTop);
275  feature->Params[GeoWidth] = sample->geo_feature(GeoWidth);
276  AddFeature(feature_set, feature);
277  delete sample;
278 
279  return feature_set;
280 } /* ExtractIntGeoFeatures */
FEATURE_SET NewFeatureSet(int NumFeatures)
TrainingSample * GetIntFeatures(tesseract::NormalizationMode mode, TBLOB *blob, const DENORM &denorm)
Definition: intfx.cpp:97
Definition: cluster.h:32
#define NULL
Definition: host.h:144
BOOL8 AddFeature(FEATURE_SET FeatureSet, FEATURE Feature)
Definition: ocrfeatures.cpp:35
FEATURE NewFeature(const FEATURE_DESC_STRUCT *FeatureDesc)
const FEATURE_DESC_STRUCT IntFeatDesc
FLOAT32 Params[1]
Definition: ocrfeatures.h:64
int geo_feature(int index) const

Variable Documentation

double classify_pico_feature_length = 0.05

"Pico Feature Length"


Include Files and Type Defines

"Pico Feature Length"

Definition at line 39 of file picofeat.cpp.

FLOAT32 PicoFeatureLength

Global Data Definitions and Declarations

Definition at line 91 of file featdefs.cpp.