/ocr/ocrservice/jni/hydrogen/include/leptonica/dewarp.h

http://eyes-free.googlecode.com/ · 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. #ifndef LEPTONICA_DEWARP_H
  16. #define LEPTONICA_DEWARP_H
  17. /*
  18. * dewarp.h
  19. *
  20. * Data structure to hold arrays and results for generating
  21. * a vertical disparity array based on textlines. The disparity
  22. * array is two-dimensional, and it represents a vertical
  23. * displacement, relative to the flat point in the textlines.
  24. * After dewarping, all points on the altered curve will have
  25. * a y-value equal to the flat point.
  26. *
  27. * The sampled vertical disparity array is expanded to full resolution,
  28. * using linear interpolation, from which it is trivially applied
  29. * to the input image.
  30. */
  31. struct L_Dewarp
  32. {
  33. struct Pix *pixs; /* source pix, 1 bpp */
  34. struct Pix *pixd; /* dewarped pix; 1, 8 or 32 bpp */
  35. struct FPix *sampvdispar; /* sampled vertical disparity array */
  36. struct FPix *fullvdispar; /* full vertical disparity array */
  37. struct FPix *fullhdispar; /* full horiztontal disparity array */
  38. struct Numa *naflats; /* sorted flat location of each line */
  39. struct Numa *nacurves; /* sorted curvature of each line */
  40. l_int32 sampling; /* sampling factor of disparity array */
  41. l_int32 minlines; /* min number of long lines required */
  42. l_int32 applyhoriz; /* flag for estimating horiz. disparity */
  43. l_int32 nx; /* number of sampling pts in x direction */
  44. l_int32 ny; /* number of sampling pts in y direction */
  45. l_int32 extraw; /* extra width required for hor. disparity */
  46. l_int32 success; /* sets to 1 if model build succeeds */
  47. };
  48. typedef struct L_Dewarp L_DEWARP;
  49. #endif /* LEPTONICA_DEWARP_H */