classify/mfx.h File Reference

#include "fxdefs.h"

Go to the source code of this file.

Functions

Variables


Function Documentation

CHAR_FEATURES BlobMicroFeatures ( TBLOB Blob,
LINE_STATS LineStats 
)

Extracts micro-features from the specified blob.

Parameters:
Blob Blob to extract micro-features from
LineStats Statistics for text line normalization
Note:
Globals: XHeightAdjust Used for manually adjusting xheight
Returns:
List of micro-features extracted from the blob.
All micro-features are normalized according to the specified line statistics.
Note:
Exceptions: none
Date:
7/21/89, DSJ, Created.

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.

Parameters:
none 
Note:
Globals:
  • MinSlope Slope below which lines are called horizontal
  • MaxSlope Slope above which lines are called vertical
  • NoiseSegmentLength Length below which outline segments are treated as noise
  • MaxFeatureLength Length above which a feature will be split into 2 equal pieces
  • ExtremityMode Controls how extremities are defined
  • XHeightAdjust Allows xheight of line to be adjusted
Returns:
none
Note:
Exceptions: none
Date:
Mon May 14 11:24:40 1990, DSJ, Created.

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 */


Variable Documentation

FLOAT32 MaxSlope

FLOAT32 MinSlope

Note:
File:mfx.h
Definition of micro-feature extraction routines
Author:
Dan Johnson
Date:
5/29/89, DSJ, Created.
 **	(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.


Generated on Wed Feb 28 19:49:21 2007 for Tesseract by  doxygen 1.5.1