SetPageSegMode should be called after Init.
Take a look at the testOSD test case in
http://sourceforge.net/p/tess4j/code/HEAD/tree/Tess4J_3/trunk/test/net/sourceforge/tess4j/
On Thursday, October 3, 2013 9:23:20 AM UTC-5, alexiuk wrote:
>
> Hi - I have an image with multiple columns I'd like to OCR. I'm using
> tess4j v1.1 and wrote another small convenience wrapper.
>
> I was expecting to be able to change pagesegmode as per the following
> failing junit test. I'd sure appreciate some advice.
>
> Thanks
>
>
> @Test
> public void test_setParams() {
>
> // my convenience wrapper
> OCR_Tesseract ocr = new OCR_Tesseract();
>
> int current_page_seg_mode = Tesseract1.TessBaseAPIGetPageSegMode(
> ocr.handle );
> assertEquals(TessPageSegMode.PSM_AUTO_OSD, current_page_seg_mode);
> }
>
> // extract from ctor.
>
> this.handle = TessAPI1.TessBaseAPICreate();
> TessAPI1.TessBaseAPIInit3(this.handle, this.datapath, this.language);
>
> this.instance = new Tesseract1();
> this.instance.setPageSegMode( TessPageSegMode.PSM_AUTO_OSD );
> ...
>
--
--
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.