00001 /****************************************************************************** 00002 ** Filename: intfx.h 00003 ** Purpose: Interface to high level integer feature extractor. 00004 ** Author: Robert Moss 00005 ** History: Tue May 21 15:51:57 MDT 1991, RWM, Created. 00006 ** 00007 ** (c) Copyright Hewlett-Packard Company, 1988. 00008 ** Licensed under the Apache License, Version 2.0 (the "License"); 00009 ** you may not use this file except in compliance with the License. 00010 ** You may obtain a copy of the License at 00011 ** http://www.apache.org/licenses/LICENSE-2.0 00012 ** Unless required by applicable law or agreed to in writing, software 00013 ** distributed under the License is distributed on an "AS IS" BASIS, 00014 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 ** See the License for the specific language governing permissions and 00016 ** limitations under the License. 00017 ******************************************************************************/ 00018 #ifndef INTFX_H 00019 #define INTFX_H 00020 00024 #include "tessclas.h" 00025 #include "hideedge.h" 00026 #include "intproto.h" 00027 #include <math.h> 00028 00029 typedef struct 00030 { 00031 inT32 Length; /* total length of all outlines */ 00032 inT16 Xmean, Ymean; /* center of mass of all outlines */ 00033 inT16 Rx, Ry; /* radius of gyration */ 00034 inT16 NumBL, NumCN; /* number of features extracted */ 00035 } 00036 00037 00038 INT_FX_RESULT_STRUCT, *INT_FX_RESULT; 00039 00043 void InitIntegerFX(); 00044 00045 int ExtractIntFeat(TBLOB *Blob, 00046 INT_FEATURE_ARRAY BLFeat, 00047 INT_FEATURE_ARRAY CNFeat, 00048 INT_FX_RESULT Results); 00049 00050 uinT8 TableLookup(inT32 Y, inT32 X); 00051 00052 int SaveFeature(INT_FEATURE_ARRAY FeatureArray, 00053 uinT16 FeatureNum, 00054 inT16 X, 00055 inT16 Y, 00056 uinT8 Theta); 00057 00058 uinT16 MySqrt(inT32 X, inT32 Y); 00059 00060 uinT8 MySqrt2(uinT16 N, uinT32 I, uinT8 *Exp); 00061 00062 void ClipRadius(uinT8 *RxInv, uinT8 *RxExp, uinT8 *RyInv, uinT8 *RyExp); 00063 #endif