Tesseract  3.02
tesseract-ocr/wordrec/bestfirst.h
Go to the documentation of this file.
00001 /* -*-C-*-
00002  ********************************************************************************
00003  *
00004  * File:        bestfirst.h  (Formerly bestfirst.h)
00005  * Description:  Best first search functions
00006  * Author:       Mark Seaman, OCR Technology
00007  * Created:      Mon May 14 11:23:29 1990
00008  * Modified:     Mon Apr 29 14:21:57 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 #ifndef BESTFIRST_H
00027 #define BESTFIRST_H
00028 
00029 /*----------------------------------------------------------------------
00030               I n c l u d e s
00031 ----------------------------------------------------------------------*/
00032 
00033 #include "associate.h"
00034 #include "blobs.h"
00035 #include "closed.h"
00036 #include "oldheap.h"
00037 #include "ratngs.h"
00038 #include "seam.h"
00039 #include "states.h"
00040 #include "stopper.h"
00041 
00042 /*----------------------------------------------------------------------
00043               T y p e s
00044 ----------------------------------------------------------------------*/
00045 struct SEARCH_RECORD
00046 {
00047   HEAP *open_states;
00048   HASH_TABLE closed_states;
00049   STATE *this_state;
00050   STATE *first_state;
00051   STATE *best_state;
00052   int num_joints;
00053   long num_states;
00054   long before_best;
00055   float segcost_bias;
00056   WERD_CHOICE *best_choice;
00057   WERD_CHOICE *raw_choice;
00058   BLOB_CHOICE_LIST_VECTOR *best_char_choices;
00059 };
00060 
00061 
00062 /*----------------------------------------------------------------------
00063               F u n c t i o n s
00064 ----------------------------------------------------------------------*/
00065 int chunks_width(WIDTH_RECORD *width_record, int start_chunk, int last_chunk);
00066 int chunks_gap(WIDTH_RECORD *width_record, int last_chunk);
00067 STATE *pop_queue(HEAP *queue);
00068 void replace_char_widths(CHUNKS_RECORD *chunks_record, SEARCH_STATE state);
00069 
00070 #endif