00001
00020
00021
00022
00023 #include "mfdefs.h"
00024 #include "variables.h"
00025 #include "mf.h"
00026 #include "fxdefs.h"
00027 #include "mfx.h"
00028 #include <math.h>
00029
00030
00031
00032
00033
00034
00035
00047 FEATURE_SET ExtractMicros(TBLOB *Blob, LINE_STATS *LineStats) {
00048 int NumFeatures;
00049 MICROFEATURES Features, OldFeatures;
00050 FEATURE_SET FeatureSet;
00051 FEATURE Feature;
00052 MICROFEATURE OldFeature;
00053
00054 OldFeatures = (MICROFEATURES) BlobMicroFeatures (Blob, LineStats);
00055 NumFeatures = count (OldFeatures);
00056 FeatureSet = NewFeatureSet (NumFeatures);
00057
00058 Features = OldFeatures;
00059 iterate(Features) {
00060 OldFeature = (MICROFEATURE) first (Features);
00061 Feature = NewFeature (&MicroFeatureDesc);
00062 ParamOf (Feature, MFDirection) = OrientationOf (OldFeature);
00063 ParamOf (Feature, MFXPosition) = CenterX (OldFeature);
00064 ParamOf (Feature, MFYPosition) = CenterY (OldFeature);
00065 ParamOf (Feature, MFLength) = LengthOf (OldFeature);
00066
00067
00068
00069
00070
00071 ParamOf (Feature, MFBulge1) = 0.0f;
00072 ParamOf (Feature, MFBulge2) = 0.0f;
00073
00074 AddFeature(FeatureSet, Feature);
00075 }
00076 FreeMicroFeatures(OldFeatures);
00077 return (FeatureSet);
00078
00079 }
00080
00081
00082
00096 void InitMicroFXVars() {
00097
00098
00099
00100
00101
00102
00103
00104
00105 InitMicroFxVars();
00106
00107 }