#include "ocrfeatures.h"
#include "fpoint.h"
#include "mfoutline.h"
Go to the source code of this file.
◆ MAX_OUTLINE_FEATURES
#define MAX_OUTLINE_FEATURES (100) |
◆ OUTLINE_FEAT_PARAM_NAME
Include Files and Type Defines
Enumerator |
---|
OutlineFeatX | |
OutlineFeatY | |
OutlineFeatLength | |
OutlineFeatDir | |
Definition at line 27 of file outfeat.h.
◆ AddOutlineFeatureToSet()
This routine computes the midpoint between Start and End to obtain the x,y position of the outline-feature. It also computes the direction from Start to End as the direction of the outline-feature and the distance from Start to End as the length of the outline-feature. This feature is then inserted into the next feature slot in FeatureSet.
- Parameters
-
Start | starting point of outline-feature |
End | ending point of outline-feature |
FeatureSet | set to add outline-feature to |
Definition at line 82 of file outfeat.cpp.
◆ ConvertToOutlineFeatures()
This routine steps converts each section in the specified outline to a feature described by its x,y position, length and angle. Results are returned in FeatureSet.
- Parameters
-
Outline | outline to extract outline-features from |
FeatureSet | set of features to add outline-features to |
Definition at line 106 of file outfeat.cpp.
113 if (DegenerateOutline (Outline))
119 FeatureStart = PointAt(Next)->Point;
120 Next = NextPointAfter(Next);
127 if (!PointAt(Next)->Hidden) {
128 FeatureEnd = PointAt(Next)->Point;
132 while (Next != First);
◆ NormalizeOutlineX()
This routine computes the weighted average x position over all of the outline-features in FeatureSet and then renormalizes the outline-features to force this average to be the x origin (i.e. x=0). FeatureSet is changed.
- Parameters
-
FeatureSet | outline-features to be normalized |
Definition at line 144 of file outfeat.cpp.
150 float TotalWeight = 0.0;
160 TotalWeight += Length;
162 Origin = TotalX / TotalWeight;