1 /****************************************************************************** 2 ** Filename: intfx.h 3 ** Purpose: Interface to high level integer feature extractor. 4 ** Author: Robert Moss 5 ** History: Tue May 21 15:51:57 MDT 1991, RWM, Created. 6 ** 7 ** (c) Copyright Hewlett-Packard Company, 1988. 8 ** Licensed under the Apache License, Version 2.0 (the "License"); 9 ** you may not use this file except in compliance with the License. 10 ** You may obtain a copy of the License at 11 ** http://www.apache.org/licenses/LICENSE-2.0 12 ** Unless required by applicable law or agreed to in writing, software 13 ** distributed under the License is distributed on an "AS IS" BASIS, 14 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 ** See the License for the specific language governing permissions and 16 ** limitations under the License. 17 ******************************************************************************/ 18 #ifndef INTFX_H 19 #define INTFX_H 20 21 /**---------------------------------------------------------------------------- 22 Include Files and Type Defines 23 ----------------------------------------------------------------------------**/ 24 #include "tessclas.h" 25 #include "hideedge.h" 26 #include "intproto.h" 27 #include <math.h> 28 29 typedef struct 30 { 31 inT32 Length; /* total length of all outlines */ 32 inT16 Xmean, Ymean; /* center of mass of all outlines */ 33 inT16 Rx, Ry; /* radius of gyration */ 34 inT16 NumBL, NumCN; /* number of features extracted */ 35 } 36 37 38 INT_FX_RESULT_STRUCT, *INT_FX_RESULT; 39 40 /**---------------------------------------------------------------------------- 41 Public Function Prototypes 42 ----------------------------------------------------------------------------**/ 43 void InitIntegerFX(); 44 45 int ExtractIntFeat(TBLOB *Blob, 46 INT_FEATURE_ARRAY BLFeat, 47 INT_FEATURE_ARRAY CNFeat, 48 INT_FX_RESULT Results); 49 50 uinT8 TableLookup(inT32 Y, inT32 X); 51 52 int SaveFeature(INT_FEATURE_ARRAY FeatureArray, 53 uinT16 FeatureNum, 54 inT16 X, 55 inT16 Y, 56 uinT8 Theta); 57 58 uinT16 MySqrt(inT32 X, inT32 Y); 59 60 uinT8 MySqrt2(uinT16 N, uinT32 I, uinT8 *Exp); 61 62 void ClipRadius(uinT8 *RxInv, uinT8 *RxExp, uinT8 *RyInv, uinT8 *RyExp); 63 #endif 64