/ocr/ocrservice/jni/hydrogen/include/leptonica/dewarp.h
C++ Header | 55 lines | 21 code | 6 blank | 28 comment | 0 complexity | 57151c9ef0aa73e643aad92f7beea132 MD5 | raw file
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 *====================================================================*/ 15 16#ifndef LEPTONICA_DEWARP_H 17#define LEPTONICA_DEWARP_H 18 19/* 20 * dewarp.h 21 * 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. 28 * 29 * The sampled vertical disparity array is expanded to full resolution, 30 * using linear interpolation, from which it is trivially applied 31 * to the input image. 32 */ 33 34 35struct L_Dewarp 36{ 37 struct Pix *pixs; /* source pix, 1 bpp */ 38 struct Pix *pixd; /* dewarped pix; 1, 8 or 32 bpp */ 39 struct FPix *sampvdispar; /* sampled vertical disparity array */ 40 struct FPix *fullvdispar; /* full vertical disparity array */ 41 struct FPix *fullhdispar; /* full horiztontal disparity array */ 42 struct Numa *naflats; /* sorted flat location of each line */ 43 struct Numa *nacurves; /* sorted curvature of each line */ 44 l_int32 sampling; /* sampling factor of disparity array */ 45 l_int32 minlines; /* min number of long lines required */ 46 l_int32 applyhoriz; /* flag for estimating horiz. disparity */ 47 l_int32 nx; /* number of sampling pts in x direction */ 48 l_int32 ny; /* number of sampling pts in y direction */ 49 l_int32 extraw; /* extra width required for hor. disparity */ 50 l_int32 success; /* sets to 1 if model build succeeds */ 51 52}; 53typedef struct L_Dewarp L_DEWARP; 54 55#endif /* LEPTONICA_DEWARP_H */