tesseract  4.0.0-1-g2a2b
mfx.h File Reference
#include "mfdefs.h"
#include "params.h"

Go to the source code of this file.

Functions

MICROFEATURES BlobMicroFeatures (TBLOB *Blob, const DENORM &cn_denorm)
 

Variables

double classify_min_slope = 0.414213562
 
double classify_max_slope = 2.414213562
 

Function Documentation

◆ BlobMicroFeatures()

MICROFEATURES BlobMicroFeatures ( TBLOB Blob,
const DENORM cn_denorm 
)

This routine extracts micro-features from the specified blob and returns a list of the micro-features. All micro-features are normalized according to the specified line statistics.

Parameters
Blobblob to extract micro-features from
cn_denormcontrol parameter to feature extractor
Returns
List of micro-features extracted from the blob.

Definition at line 69 of file mfx.cpp.

69  {
70  MICROFEATURES MicroFeatures = NIL_LIST;
71  LIST Outlines;
72  LIST RemainingOutlines;
73  MFOUTLINE Outline;
74 
75  if (Blob != nullptr) {
76  Outlines = ConvertBlob(Blob);
77 
78  RemainingOutlines = Outlines;
79  iterate(RemainingOutlines) {
80  Outline = (MFOUTLINE) first_node (RemainingOutlines);
81  CharNormalizeOutline(Outline, cn_denorm);
82  }
83 
84  RemainingOutlines = Outlines;
85  iterate(RemainingOutlines) {
86  Outline = (MFOUTLINE) first_node(RemainingOutlines);
88  MarkDirectionChanges(Outline);
89  MicroFeatures = ConvertToMicroFeatures(Outline, MicroFeatures);
90  }
91  FreeOutlines(Outlines);
92  }
93  return MicroFeatures;
94 } /* BlobMicroFeatures */
void MarkDirectionChanges(MFOUTLINE Outline)
Definition: mfoutline.cpp:190
MICROFEATURES ConvertToMicroFeatures(MFOUTLINE Outline, MICROFEATURES MicroFeatures)
Definition: mfx.cpp:130
void FreeOutlines(LIST Outlines)
Definition: mfoutline.cpp:172
void FindDirectionChanges(MFOUTLINE Outline, float MinSlope, float MaxSlope)
Definition: mfoutline.cpp:118
double classify_min_slope
Definition: mfx.cpp:36
LIST ConvertBlob(TBLOB *blob)
Definition: mfoutline.cpp:39
double classify_max_slope
Definition: mfx.cpp:38
#define first_node(l)
Definition: oldlist.h:141
#define NIL_LIST
Definition: oldlist.h:127
void CharNormalizeOutline(MFOUTLINE Outline, const DENORM &cn_denorm)
Definition: mfoutline.cpp:339
#define iterate(l)
Definition: oldlist.h:161
LIST MFOUTLINE
Definition: mfoutline.h:34

Variable Documentation

◆ classify_max_slope

double classify_max_slope = 2.414213562

"Slope above which lines are called vertical"

Definition at line 38 of file mfx.cpp.

◆ classify_min_slope

double classify_min_slope = 0.414213562

"Slope below which lines are called horizontal"

Definition at line 36 of file mfx.cpp.