Tesseract 3.01
/data/source/tesseract-ocr/wordrec/matchtab.h
Go to the documentation of this file.
00001 /* -*-C-*-
00002  ********************************************************************************
00003  *
00004  * File:        matchtab.h  (Formerly matchtab.h)
00005  * Description:  Match table to retain blobs that were matched.
00006  * Author:       Mark Seaman, OCR Technology
00007  * Created:      Mon Jan 29 09:00:56 1990
00008  * Modified:     Tue Mar 19 15:38:19 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 #ifndef MATCHTAB_H
00026 #define MATCHTAB_H
00027 
00028 #include "ratngs.h"
00029 #include "blobs.h"
00030 
00031 namespace tesseract {
00032 
00033 typedef struct _MATCH_
00034 {
00035   int topleft;
00036   int botright;
00037   BLOB_CHOICE_LIST *rating;
00038 } MATCH;
00039 
00040 
00041 class BlobMatchTable {
00042  public:
00043   BlobMatchTable();
00044   ~BlobMatchTable();
00045 
00046   void init_match_table();
00047   void end_match_table();
00048   void put_match(TBLOB *blob, BLOB_CHOICE_LIST *ratings);
00049   BLOB_CHOICE_LIST *get_match(TBLOB *blob);
00050   BLOB_CHOICE_LIST *get_match_by_bounds(unsigned int topleft,
00051                                         unsigned int botright);
00052   void add_to_match(TBLOB *blob, BLOB_CHOICE_LIST *ratings);
00053 
00054  private:
00055   bool been_initialized_;
00056   MATCH* match_table_;
00057 };
00058 
00059 }
00060 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines