On Sun, Apr 28, 2013 at 2:16 PM, TedJ <[email protected]> wrote: > But if anyone knows of another angle/translation/scale image correction > approach (or code), I'd love to hear about it. I.e. Image stabilization. >
I would just use leptonica's pixRead() to read in an image, deskew with pixFindSkewAndDeskew [1] which can give you the deskew angle, and then pass the deskewed image to tesseract by using TessBaseAPI::SetImage(const Pix* pix). I would also binarize the image first so Tesseract won't have to do *any* image preprocessing and you know exactly what you are sending to it. Examples of pixFindSkewAndDeskew use are in prog\textlinemask.c [2]. Also see leptonica's docs on "Measuring the Skew of Document Images" [3], "Image Rotation" [4], and possibly "Image Scaling" [5] and "Grayscale Mapping and Binarization" [6]. [1] http://tpgit.github.io/Leptonica/skew_8c_source.html#l00180 [2] http://tpgit.github.io/Leptonica/textlinemask_8c_source.html [3] http://tpgit.github.io/UnOfficialLeptDocs/leptonica/skew-measurement.html [4] http://tpgit.github.io/UnOfficialLeptDocs/leptonica/rotation.html [5] http://tpgit.github.io/UnOfficialLeptDocs/leptonica/scaling.html [6] http://tpgit.github.io/UnOfficialLeptDocs/leptonica/binarization.html -- -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/tesseract-ocr?hl=en --- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

