tesseract 4.1.1
Loading...
Searching...
No Matches
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 61 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;
86} /* BlobMicroFeatures */
LIST ConvertBlob(TBLOB *blob)
Definition: mfoutline.cpp:37
void FreeOutlines(LIST Outlines)
Definition: mfoutline.cpp:167
void FindDirectionChanges(MFOUTLINE Outline, float MinSlope, float MaxSlope)
Definition: mfoutline.cpp:115
void CharNormalizeOutline(MFOUTLINE Outline, const DENORM &cn_denorm)
Definition: mfoutline.cpp:327
void MarkDirectionChanges(MFOUTLINE Outline)
Definition: mfoutline.cpp:183
double classify_max_slope
Definition: mfx.cpp:37
MICROFEATURES ConvertToMicroFeatures(MFOUTLINE Outline, MICROFEATURES MicroFeatures)
Definition: mfx.cpp:99
double classify_min_slope
Definition: mfx.cpp:35
#define iterate(l)
Definition: oldlist.h:101
#define first_node(l)
Definition: oldlist.h:92
#define NIL_LIST
Definition: oldlist.h:76

Variable Documentation

◆ classify_max_slope

double classify_max_slope = 2.414213562
extern

"Slope above which lines are called vertical"

Definition at line 37 of file mfx.cpp.

◆ classify_min_slope

double classify_min_slope = 0.414213562
extern

"Slope below which lines are called horizontal"

Definition at line 35 of file mfx.cpp.