Tesseract 3.01
/data/source/tesseract-ocr/classify/intfx.h
Go to the documentation of this file.
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 "blobs.h"
00025 #include "intproto.h"
00026 #include <math.h>
00027 
00028 class DENORM;
00029 
00030 typedef struct
00031 {
00032   inT32 Length;                  /* total length of all outlines   */
00033   inT16 Xmean, Ymean;            /* center of mass of all outlines */
00034   inT16 Rx, Ry;                  /* radius of gyration             */
00035   inT16 NumBL, NumCN;            /* number of features extracted   */
00036 }
00037 
00038 
00039 INT_FX_RESULT_STRUCT, *INT_FX_RESULT;
00040 
00044 void InitIntegerFX();
00045 
00046 int ExtractIntFeat(TBLOB *Blob,
00047                    const DENORM& denorm,
00048                    INT_FEATURE_ARRAY BLFeat,
00049                    INT_FEATURE_ARRAY CNFeat,
00050                    INT_FX_RESULT Results,
00051                    inT32 *FeatureOutlineArray = 0);
00052 
00053 uinT8 BinaryAnglePlusPi(inT32 Y, inT32 X);
00054 
00055 int SaveFeature(INT_FEATURE_ARRAY FeatureArray,
00056                 uinT16 FeatureNum,
00057                 inT16 X,
00058                 inT16 Y,
00059                 uinT8 Theta);
00060 
00061 uinT16 MySqrt(inT32 X, inT32 Y);
00062 
00063 uinT8 MySqrt2(uinT16 N, uinT32 I, uinT8 *Exp);
00064 
00065 void ClipRadius(uinT8 *RxInv, uinT8 *RxExp, uinT8 *RyInv, uinT8 *RyExp);
00066 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines