1
/*====================================================================*
2
- Copyright (C) 2001 Leptonica. All rights reserved.
3
- This software is distributed in the hope that it will be
4
- useful, but with NO WARRANTY OF ANY KIND.
5
- No author or distributor accepts responsibility to anyone for the
6
- consequences of using this software, or for whether it serves any
7
- particular purpose or works at all, unless he or she says so in
8
- writing. Everyone is granted permission to copy, modify and
9
- redistribute this source code, for commercial or non-commercial
10
- purposes, with the following restrictions: (1) the origin of this
11
- source code must not be misrepresented; (2) modified versions must
12
- be plainly marked as such; and (3) this notice may not be removed
13
- or altered from any source or modified source distribution.
14
*====================================================================*/
16
#ifndef LEPTONICA_DEWARP_H
17
#define LEPTONICA_DEWARP_H
22
* Data structure to hold arrays and results for generating
23
* a vertical disparity array based on textlines. The disparity
24
* array is two-dimensional, and it represents a vertical
25
* displacement, relative to the flat point in the textlines.
26
* After dewarping, all points on the altered curve will have
27
* a y-value equal to the flat point.
29
* The sampled vertical disparity array is expanded to full resolution,
30
* using linear interpolation, from which it is trivially applied
34
#define DEWARP_VERSION_NUMBER 1
38
struct Pix *pixs; /* source pix, 1 bpp */
39
struct Pix *pixd; /* dewarped pix; 1, 8 or 32 bpp */
40
struct FPix *sampvdispar; /* sampled vertical disparity array */
41
struct FPix *samphdispar; /* sampled horizontal disparity array */
42
struct FPix *fullvdispar; /* full vertical disparity array */
43
struct FPix *fullhdispar; /* full horiztontal disparity array */
44
struct Numa *naflats; /* sorted flat location of each line */
45
struct Numa *nacurves; /* sorted curvature of each line */
46
l_int32 pageno; /* page number; important for reuse */
47
l_int32 sampling; /* sampling factor of disparity array */
48
l_int32 minlines; /* min number of long lines required */
49
l_int32 applyhoriz; /* flag for estimating horiz. disparity */
50
l_int32 nx; /* number of sampling pts in x direction */
51
l_int32 ny; /* number of sampling pts in y direction */
52
l_int32 extraw; /* extra width required for hor. disparity */
53
l_int32 success; /* sets to 1 if model build succeeds */
55
typedef struct L_Dewarp L_DEWARP;
57
#endif /* LEPTONICA_DEWARP_H */