Tesseract  3.02
tesseract-ocr/textord/underlin.h
Go to the documentation of this file.
00001 /**********************************************************************
00002  * File:        underlin.h  (Formerly undrline.h)
00003  * Description: Code to chop blobs apart from underlines.
00004  * Author:              Ray Smith
00005  * Created:             Mon Aug  8 11:14:00 BST 1994
00006  *
00007  * (C) Copyright 1994, 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           UNDERLIN_H
00021 #define           UNDERLIN_H
00022 
00023 #include          "fpchop.h"
00024 #include          "notdll.h"
00025 
00026 extern double_VAR_H (textord_underline_offset, 0.1,
00027 "Fraction of x to ignore");
00028 extern BOOL_VAR_H (textord_restore_underlines, FALSE,
00029 "Chop underlines & put back");
00030 void restore_underlined_blobs(                 //get chop points
00031                               TO_BLOCK *block  //block to do
00032                              );
00033 TO_ROW *most_overlapping_row(                    //find best row
00034                              TO_ROW_LIST *rows,  //list of rows
00035                              BLOBNBOX *blob      //blob to place
00036                             );
00037 void find_underlined_blobs(                            //get chop points
00038                            BLOBNBOX *u_line,           //underlined unit
00039                            QSPLINE *baseline,          //actual baseline
00040                            float xheight,              //height of line
00041                            float baseline_offset,      //amount to shrinke it
00042                            ICOORDELT_LIST *chop_cells  //places to chop
00043                           );
00044 void vertical_cunderline_projection(                        //project outlines
00045                                     C_OUTLINE *outline,     //outline to project
00046                                     QSPLINE *baseline,      //actual baseline
00047                                     float xheight,          //height of line
00048                                     float baseline_offset,  //amount to shrinke it
00049                                     STATS *lower_proj,      //below baseline
00050                                     STATS *middle_proj,     //centre region
00051                                     STATS *upper_proj       //top region
00052                                    );
00053 #endif