tesseract  5.0.0-alpha-619-ge9db
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 60 of file mfx.cpp.

61  {
62  MICROFEATURES MicroFeatures = NIL_LIST;
63  LIST Outlines;
64  LIST RemainingOutlines;
65  MFOUTLINE Outline;
66 
67  if (Blob != nullptr) {
68  Outlines = ConvertBlob(Blob);
69 
70  RemainingOutlines = Outlines;
71  iterate(RemainingOutlines) {
72  Outline = static_cast<MFOUTLINE>first_node (RemainingOutlines);
73  CharNormalizeOutline(Outline, cn_denorm);
74  }
75 
76  RemainingOutlines = Outlines;
77  iterate(RemainingOutlines) {
78  Outline = static_cast<MFOUTLINE>first_node(RemainingOutlines);
80  MarkDirectionChanges(Outline);
81  MicroFeatures = ConvertToMicroFeatures(Outline, MicroFeatures);
82  }
83  FreeOutlines(Outlines);
84  }
85  return MicroFeatures;

Variable Documentation

◆ classify_max_slope

double classify_max_slope = 2.414213562

"Slope above which lines are called vertical"

Definition at line 36 of file mfx.cpp.

◆ classify_min_slope

double classify_min_slope = 0.414213562

"Slope below which lines are called horizontal"

Definition at line 34 of file mfx.cpp.

first_node
#define first_node(l)
Definition: oldlist.h:84
list_rec
Definition: oldlist.h:73
MarkDirectionChanges
void MarkDirectionChanges(MFOUTLINE Outline)
Definition: mfoutline.cpp:182
CharNormalizeOutline
void CharNormalizeOutline(MFOUTLINE Outline, const DENORM &cn_denorm)
Definition: mfoutline.cpp:326
NIL_LIST
#define NIL_LIST
Definition: oldlist.h:68
classify_max_slope
double classify_max_slope
Definition: mfx.cpp:36
FindDirectionChanges
void FindDirectionChanges(MFOUTLINE Outline, float MinSlope, float MaxSlope)
Definition: mfoutline.cpp:114
ConvertToMicroFeatures
MICROFEATURES ConvertToMicroFeatures(MFOUTLINE Outline, MICROFEATURES MicroFeatures)
Definition: mfx.cpp:98
ConvertBlob
LIST ConvertBlob(TBLOB *blob)
Definition: mfoutline.cpp:36
classify_min_slope
double classify_min_slope
Definition: mfx.cpp:34
FreeOutlines
void FreeOutlines(LIST Outlines)
Definition: mfoutline.cpp:166
iterate
#define iterate(l)
Definition: oldlist.h:92