00001 /* -*-C-*- 00002 ******************************************************************************** 00003 * 00004 * File: associate.h (Formerly associate.h) 00005 * Description: Associate the outlines and classify them 00006 * Author: Mark Seaman, OCR Technology 00007 * Created: Mon Feb 5 11:42:51 1990 00008 * Modified: Tue May 21 15:34:56 1991 (Mark Seaman) marks@hpgrlt 00009 * Language: C 00010 * Package: N/A 00011 * Status: Experimental (Do Not Distribute) 00012 * 00013 * (c) Copyright 1990, Hewlett-Packard Company. 00014 ** Licensed under the Apache License, Version 2.0 (the "License"); 00015 ** you may not use this file except in compliance with the License. 00016 ** You may obtain a copy of the License at 00017 ** http://www.apache.org/licenses/LICENSE-2.0 00018 ** Unless required by applicable law or agreed to in writing, software 00019 ** distributed under the License is distributed on an "AS IS" BASIS, 00020 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00021 ** See the License for the specific language governing permissions and 00022 ** limitations under the License. 00023 * 00024 ******************************************************************************** 00025 */ 00026 00027 #ifndef ASSOCIATE_H 00028 #define ASSOCIATE_H 00029 00030 /* 00031 ---------------------------------------------------------------------- 00032 I n c l u d e s 00033 ---------------------------------------------------------------------- 00034 */ 00035 00036 #include "matrix.h" 00037 #include "states.h" 00038 #include "blobs.h" 00039 #include "split.h" 00040 #include "seam.h" 00041 00042 /* 00043 ---------------------------------------------------------------------- 00044 T y p e s 00045 ---------------------------------------------------------------------- 00046 */ 00047 00049 typedef LIST BLOBS; 00050 00052 typedef LIST OUTLINES; 00053 00055 typedef LIST EDGEPTS; 00056 00057 typedef inT16 BLOB_WEIGHTS[MAX_NUM_CHUNKS]; 00058 00060 typedef struct 00061 { 00062 float match; 00063 float certainty; 00064 char character; 00065 int width; 00066 int gap; 00067 } EVALUATION_RECORD; 00068 00070 struct CHUNKS_RECORD 00071 { 00072 MATRIX *ratings; 00073 TBLOB *chunks; 00074 SEAMS splits; 00075 TEXTROW *row; 00076 int fx; 00077 int x_height; 00078 WIDTH_RECORD *chunk_widths; 00079 WIDTH_RECORD *char_widths; 00080 inT16 *weights; 00081 }; 00082 00084 typedef EVALUATION_RECORD EVALUATION_ARRAY[MAX_NUM_CHUNKS]; 00085 00086 /*---------------------------------------------------------------------- 00087 V a r i a b l e s 00088 ----------------------------------------------------------------------*/ 00089 extern EVALUATION_ARRAY last_segmentation; 00090 extern WIDTH_RECORD *char_widths; 00091 extern BOOL_VAR_H(wordrec_enable_assoc, 1, "Associator Enable"); 00092 extern BOOL_VAR_H(force_word_assoc, FALSE, 00093 "always force associator to run, independent of what enable_assoc is." 00094 "This is used for CJK where component grouping is necessary."); 00095 00096 /*---------------------------------------------------------------------- 00097 F u n c t i o n s 00098 ----------------------------------------------------------------------*/ 00099 void init_associate_vars(); 00100 void print_eval_record(const char* label, EVALUATION_RECORD *eval_rec); 00101 #endif