Tesseract  3.02
tesseract-ocr/textord/wordseg.h
Go to the documentation of this file.
00001 /**********************************************************************
00002  * File:        wordseg.h  (Formerly wspace.h)
00003  * Description: Code to segment the blobs into words.
00004  * Author:              Ray Smith
00005  * Created:             Fri Oct 16 11:32:28 BST 1992
00006  *
00007  * (C) Copyright 1992, Hewlett-Packard Ltd.
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  **********************************************************************/
00019 
00020 #ifndef           WORDSEG_H
00021 #define           WORDSEG_H
00022 
00023 #include          "params.h"
00024 #include          "blobbox.h"
00025 #include          "notdll.h"
00026 #include          "textord.h"
00027 
00028 namespace tesseract {
00029 class Tesseract;
00030 }
00031 
00032 extern BOOL_VAR_H (textord_fp_chopping, TRUE, "Do fixed pitch chopping");
00033 extern BOOL_VAR_H(textord_force_make_prop_words, FALSE,
00034                   "Force proportional word segmentation on all rows");
00035 extern BOOL_VAR_H (textord_chopper_test, FALSE,
00036                    "Chopper is being tested.");
00037 
00038 void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST* real_rows);
00039 void make_words(tesseract::Textord *textord,
00040                 ICOORD page_tr,                // top right
00041                 float gradient,               // page skew
00042                 BLOCK_LIST *blocks,           // block list
00043                 TO_BLOCK_LIST *port_blocks);  // output list
00044 void set_row_spaces(                  //find space sizes
00045                     TO_BLOCK *block,  //block to do
00046                     FCOORD rotation,  //for drawing
00047                     BOOL8 testing_on  //correct orientation
00048                    );
00049 inT32 row_words(                  //compute space size
00050                 TO_BLOCK *block,  //block it came from
00051                 TO_ROW *row,      //row to operate on
00052                 inT32 maxwidth,   //max expected space size
00053                 FCOORD rotation,  //for drawing
00054                 BOOL8 testing_on  //for debug
00055                );
00056 inT32 row_words2(                  //compute space size
00057                  TO_BLOCK *block,  //block it came from
00058                  TO_ROW *row,      //row to operate on
00059                  inT32 maxwidth,   //max expected space size
00060                  FCOORD rotation,  //for drawing
00061                  BOOL8 testing_on  //for debug
00062                 );
00063 void make_real_words(
00064                      tesseract::Textord *textord,
00065                      TO_BLOCK *block,  //block to do
00066                      FCOORD rotation   //for drawing
00067                     );
00068 ROW *make_rep_words(                 //make a row
00069                     TO_ROW *row,     //row to convert
00070                     TO_BLOCK *block  //block it lives in
00071                    );
00072 WERD *make_real_word(                      //make a WERD
00073                      BLOBNBOX_IT *box_it,  //iterator
00074                      inT32 blobcount,      //no of blobs to use
00075                      BOOL8 bol,            //start of line
00076                      uinT8 blanks          //no of blanks
00077                     );
00078 #endif