tesseract
5.0.0-alpha-619-ge9db
underlin.h
Go to the documentation of this file.
1
/**********************************************************************
2
* File: underlin.h (Formerly undrline.h)
3
* Description: Code to chop blobs apart from underlines.
4
* Author: Ray Smith
5
*
6
* (C) Copyright 1994, Hewlett-Packard Ltd.
7
** Licensed under the Apache License, Version 2.0 (the "License");
8
** you may not use this file except in compliance with the License.
9
** You may obtain a copy of the License at
10
** http://www.apache.org/licenses/LICENSE-2.0
11
** Unless required by applicable law or agreed to in writing, software
12
** distributed under the License is distributed on an "AS IS" BASIS,
13
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
** See the License for the specific language governing permissions and
15
** limitations under the License.
16
*
17
**********************************************************************/
18
19
#ifndef UNDERLIN_H
20
#define UNDERLIN_H
21
22
#include "
fpchop.h
"
23
24
extern
double_VAR_H
(
textord_underline_offset
, 0.1,
25
"Fraction of x to ignore"
);
26
extern
BOOL_VAR_H
(
textord_restore_underlines
,
false
,
27
"Chop underlines & put back"
);
28
void
restore_underlined_blobs
(
//get chop points
29
TO_BLOCK
*block
//block to do
30
);
31
TO_ROW
*
most_overlapping_row
(
//find best row
32
TO_ROW_LIST *rows,
//list of rows
33
BLOBNBOX
*blob
//blob to place
34
);
35
void
find_underlined_blobs
(
//get chop points
36
BLOBNBOX
*u_line,
//underlined unit
37
QSPLINE
*
baseline
,
//actual baseline
38
float
xheight,
//height of line
39
float
baseline_offset,
//amount to shrinke it
40
ICOORDELT_LIST *chop_cells
//places to chop
41
);
42
void
vertical_cunderline_projection
(
//project outlines
43
C_OUTLINE
*outline,
//outline to project
44
QSPLINE
*
baseline
,
//actual baseline
45
float
xheight,
//height of line
46
float
baseline_offset,
//amount to shrinke it
47
STATS
*lower_proj,
//below baseline
48
STATS
*middle_proj,
//centre region
49
STATS
*upper_proj
//top region
50
);
51
#endif
restore_underlined_blobs
void restore_underlined_blobs(TO_BLOCK *block)
Definition:
underlin.cpp:28
vertical_cunderline_projection
void vertical_cunderline_projection(C_OUTLINE *outline, QSPLINE *baseline, float xheight, float baseline_offset, STATS *lower_proj, STATS *middle_proj, STATS *upper_proj)
Definition:
underlin.cpp:204
baseline
Definition:
mfoutline.h:62
QSPLINE
Definition:
quspline.h:31
TO_BLOCK
Definition:
blobbox.h:691
find_underlined_blobs
void find_underlined_blobs(BLOBNBOX *u_line, QSPLINE *baseline, float xheight, float baseline_offset, ICOORDELT_LIST *chop_cells)
Definition:
underlin.cpp:160
most_overlapping_row
TO_ROW * most_overlapping_row(TO_ROW_LIST *rows, BLOBNBOX *blob)
Definition:
underlin.cpp:104
BLOBNBOX
Definition:
blobbox.h:142
double_VAR_H
#define double_VAR_H(name, val, comment)
Definition:
params.h:298
C_OUTLINE
Definition:
coutln.h:71
textord_restore_underlines
bool textord_restore_underlines
Definition:
underlin.cpp:21
textord_underline_offset
double textord_underline_offset
Definition:
underlin.cpp:20
STATS
Definition:
statistc.h:30
BOOL_VAR_H
#define BOOL_VAR_H(name, val, comment)
Definition:
params.h:294
TO_ROW
Definition:
blobbox.h:543
fpchop.h
src
textord
underlin.h
Generated on Thu Jan 30 2020 14:22:21 for tesseract by
1.8.16