Leptonica 1.68
C Image Processing Library
|
00001 /*====================================================================* 00002 - Copyright (C) 2001 Leptonica. All rights reserved. 00003 - This software is distributed in the hope that it will be 00004 - useful, but with NO WARRANTY OF ANY KIND. 00005 - No author or distributor accepts responsibility to anyone for the 00006 - consequences of using this software, or for whether it serves any 00007 - particular purpose or works at all, unless he or she says so in 00008 - writing. Everyone is granted permission to copy, modify and 00009 - redistribute this source code, for commercial or non-commercial 00010 - purposes, with the following restrictions: (1) the origin of this 00011 - source code must not be misrepresented; (2) modified versions must 00012 - be plainly marked as such; and (3) this notice may not be removed 00013 - or altered from any source or modified source distribution. 00014 *====================================================================*/ 00015 00016 #ifndef LEPTONICA_DEWARP_H 00017 #define LEPTONICA_DEWARP_H 00018 00019 /* 00020 * dewarp.h 00021 * 00022 * Data structure to hold arrays and results for generating 00023 * a vertical disparity array based on textlines. The disparity 00024 * array is two-dimensional, and it represents a vertical 00025 * displacement, relative to the flat point in the textlines. 00026 * After dewarping, all points on the altered curve will have 00027 * a y-value equal to the flat point. 00028 * 00029 * The sampled vertical disparity array is expanded to full resolution, 00030 * using linear interpolation, from which it is trivially applied 00031 * to the input image. 00032 */ 00033 00034 #define DEWARP_VERSION_NUMBER 1 00035 00036 struct L_Dewarp 00037 { 00038 struct Pix *pixs; /* source pix, 1 bpp */ 00039 struct Pix *pixd; /* dewarped pix; 1, 8 or 32 bpp */ 00040 struct FPix *sampvdispar; /* sampled vertical disparity array */ 00041 struct FPix *samphdispar; /* sampled horizontal disparity array */ 00042 struct FPix *fullvdispar; /* full vertical disparity array */ 00043 struct FPix *fullhdispar; /* full horiztontal disparity array */ 00044 struct Numa *naflats; /* sorted flat location of each line */ 00045 struct Numa *nacurves; /* sorted curvature of each line */ 00046 l_int32 pageno; /* page number; important for reuse */ 00047 l_int32 sampling; /* sampling factor of disparity array */ 00048 l_int32 minlines; /* min number of long lines required */ 00049 l_int32 applyhoriz; /* flag for estimating horiz. disparity */ 00050 l_int32 nx; /* number of sampling pts in x direction */ 00051 l_int32 ny; /* number of sampling pts in y direction */ 00052 l_int32 extraw; /* extra width required for hor. disparity */ 00053 l_int32 success; /* sets to 1 if model build succeeds */ 00054 }; 00055 typedef struct L_Dewarp L_DEWARP; 00056 00057 #endif /* LEPTONICA_DEWARP_H */