Achieving what you want is not a no-brainer. TessBaseAPI uses as a thresholder an instance of ImageThresholder class that is created to relieve a user from any manual parameter setting. To introduce any tweaking the most feasible strategy is to subclass from ImageThresholder and then call SetThresholder(). In the subclass do one of the following:
- implement entirely your own ThresholdToPix() - e.g. adaptive binarization - search for Sauvola et al., or probably using Leptonica library procedures, - overload ThresholdToPix() and use its existing code to modify the "thresholds" and "hi_values" between calls to OtsuThreshold() and ThresholdRectToPix(). This means sticking to the modified Otsu method (http://en.wikipedia.org/wiki/Otsu%27s_method) currently being used in Tesseract. Don't be afraid to expolore further by yourself. Unlike other Tesseract's code, the code in "thresholder.h" and "thresholder.cpp" is new and better documented so there's should be no problem to understand it after a while. Warm regards, Dmitri Silaev www.CustomOCR.com On Thu, Feb 23, 2012 at 12:35 AM, avasilev <alxvasi...@gmail.com> wrote: > First of all, I beg for excuse if this post appears twice, because I > sent it some hours ago and it didn't appear. > Now my question: > I have seen there is a Thresholder API in tesseract. If it is what I > think, can anyone give me an example how to use the thresholding API > in tesseract to adjsut the threshold of image binarization. > > -- > You received this message because you are subscribed to the Google > Groups "tesseract-ocr" group. > To post to this group, send email to tesseract-ocr@googlegroups.com > To unsubscribe from this group, send email to > tesseract-ocr+unsubscr...@googlegroups.com > 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 post to this group, send email to tesseract-ocr@googlegroups.com To unsubscribe from this group, send email to tesseract-ocr+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tesseract-ocr?hl=en