#include "fxdefs.h"
Go to the source code of this file.
CHAR_FEATURES BlobMicroFeatures | ( | TBLOB * | Blob, | |
LINE_STATS * | LineStats | |||
) |
Extracts micro-features from the specified blob.
Blob | Blob to extract micro-features from | |
LineStats | Statistics for text line normalization |
Definition at line 150 of file mfx.cpp.
References CharNormalizeOutline(), ConvertBlob(), ConvertToMicroFeatures(), ExtractIntFeat(), FilterEdgeNoise(), FindDirectionChanges(), first, FreeOutlines(), iterate, MarkDirectionChanges(), MaxSlope, MinSlope, NIL, NoiseSegmentLength, NULL, Outline, INT_FX_RESULT_STRUCT::Rx, INT_FX_RESULT_STRUCT::Ry, SmearBulges(), SmearExtremities(), INT_FX_RESULT_STRUCT::Xmean, and INT_FX_RESULT_STRUCT::Ymean.
Referenced by ExtractMicros().
00150 { 00151 MICROFEATURES MicroFeatures = NIL; 00152 FLOAT32 XScale, YScale; 00153 LIST Outlines; 00154 LIST RemainingOutlines; 00155 MFOUTLINE Outline; 00156 INT_FEATURE_ARRAY blfeatures; 00157 INT_FEATURE_ARRAY cnfeatures; 00158 INT_FX_RESULT_STRUCT results; 00159 00160 if (Blob != NULL) { 00161 Outlines = ConvertBlob (Blob); 00162 // NormalizeOutlines(Outlines, LineStats, &XScale, &YScale); 00163 ExtractIntFeat(Blob, blfeatures, cnfeatures, &results); 00164 XScale = 0.2f / results.Ry; 00165 YScale = 0.2f / results.Rx; 00166 00167 RemainingOutlines = Outlines; 00168 iterate(RemainingOutlines) { 00169 Outline = (MFOUTLINE) first (RemainingOutlines); 00170 CharNormalizeOutline (Outline, 00171 results.Xmean, results.Ymean, 00172 XScale, YScale); 00173 } 00174 00175 RemainingOutlines = Outlines; 00176 iterate(RemainingOutlines) { 00177 Outline = (MFOUTLINE) first (RemainingOutlines); 00178 FindDirectionChanges(Outline, MinSlope, MaxSlope); 00179 FilterEdgeNoise(Outline, NoiseSegmentLength); 00180 MarkDirectionChanges(Outline); 00181 SmearExtremities(Outline, XScale, YScale); 00182 MicroFeatures = ConvertToMicroFeatures (Outline, MicroFeatures); 00183 } 00184 SmearBulges(MicroFeatures, XScale, YScale); 00185 FreeOutlines(Outlines); 00186 } 00187 return ((CHAR_FEATURES) MicroFeatures); 00188 } /* BlobMicroFeatures */
void InitMicroFxVars | ( | ) |
Initialize the micro-feature extractor variables (knobs) that can be tuned without recompiling.
none |
Definition at line 126 of file mfx.cpp.
References dummy, float_variable, MAX_SLOPE, MaxSlope, MIN_SLOPE, MinSlope, NOISE_SEGMENT_LENGTH, and NoiseSegmentLength.
Referenced by InitMicroFXVars().
00126 { 00127 VALUE dummy; 00128 00129 float_variable (MinSlope, "MinSlope", MIN_SLOPE); 00130 float_variable (MaxSlope, "MaxSlope", MAX_SLOPE); 00131 float_variable (NoiseSegmentLength, "NoiseSegmentLength", 00132 NOISE_SEGMENT_LENGTH); 00133 } /* InitMicroFxVars */
** (c) Copyright Hewlett-Packard Company, 1988. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** http://www.apache.org/licenses/LICENSE-2.0 ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License.