#include "outfeat.h"
#include "classify.h"
#include "featdefs.h"
#include "mfoutline.h"
#include "ocrfeatures.h"
#include <cstdio>
Go to the source code of this file.
◆ 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 |
- Returns
- none (results are placed in FeatureSet)
- Note
- Globals: none
Definition at line 86 of file outfeat.cpp.
float DistanceBetween(FPOINT A, FPOINT B)
float NormalizedAngleFrom(FPOINT *Point1, FPOINT *Point2, float FullScale)
const FEATURE_DESC_STRUCT OutlineFeatDesc
FEATURE NewFeature(const FEATURE_DESC_STRUCT *FeatureDesc)
bool AddFeature(FEATURE_SET FeatureSet, FEATURE Feature)
◆ ConvertToOutlineFeatures()
This routine steps converts each section in the specified outline to a feature described by its x,y position, length and angle.
- Parameters
-
Outline | outline to extract outline-features from |
FeatureSet | set of features to add outline-features to |
- Returns
- none (results are returned in FeatureSet)
- Note
- Globals: none
Definition at line 111 of file outfeat.cpp.
123 FeatureStart =
PointAt(Next)->Point;
132 FeatureEnd =
PointAt(Next)->Point;
136 while (Next != First);
#define DegenerateOutline(O)
void AddOutlineFeatureToSet(FPOINT *Start, FPOINT *End, FEATURE_SET FeatureSet)
#define NextPointAfter(E)
◆ 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).
- Parameters
-
FeatureSet | outline-features to be normalized |
- Returns
- none (FeatureSet is changed)
- Note
- Globals: none
Definition at line 150 of file outfeat.cpp.
155 float TotalWeight = 0.0;
165 TotalWeight += Length;
167 Origin = TotalX / TotalWeight;