How to get intermediate result of tesseract? Like processed image as output.

1,542 views
Skip to first unread message

Gautam Navapara

unread,
Jun 18, 2016, 4:14:51 PM6/18/16
to tesseract-ocr
I started working on tesseract few days back. I want to improve it's accuracy. Some times it doesn't recognize characters. So, i'm starting from first step. I want to see processed Image at each and every stage. How can i achieve this?

Quan Nguyen

unread,
Jun 19, 2016, 9:41:55 PM6/19/16
to tesseract-ocr
Check the API Examples. You can call GetThresholdedImage after SetImage to return the Pix object of your interest, and call Leptonica's pixWrite method to save it to an image file on your filesystem for your viewing.

Gautam Navapara

unread,
Jun 20, 2016, 3:18:48 PM6/20/16
to tesseract-ocr
Thank you. It really helped me.

Gautam Navapara

unread,
Jun 21, 2016, 2:27:59 PM6/21/16
to tesseract-ocr
How can I use GetRegions() function? What should be argument for it? After calling GetRegions() function which function should I use to get page layout image as output?

Quan Nguyen

unread,
Jun 21, 2016, 8:45:43 PM6/21/16
to tesseract-ocr
RTD. You can pass in a null and get an array of Box objects in return.

Gautam Navapara

unread,
Jun 22, 2016, 3:07:20 AM6/22/16
to tesseract-ocr
I got arrays of box object. after that i called function 'boxawrite' that function created txt file with cordinates of box. How this cordinates are useful? I want output as image. like i attached one here. how to get that kind of image. maybe this is very easy but I'm newbie, please help.
psalms.png

Quan Nguyen

unread,
Jun 22, 2016, 7:16:35 PM6/22/16
to tesseract-ocr
You'll need to programmatically draw rectangles having those coordinates on the image.

Tom Morris

unread,
Jun 24, 2016, 1:05:27 PM6/24/16
to tesseract-ocr
Rather than rolling your own, I'd suggest looking at the ScrollView app to see if it has the information that you need:


Tom

Gautam Navapara

unread,
Jun 25, 2016, 12:14:06 PM6/25/16
to tesseract-ocr
Hello Tom, I tried that ScrollView app but nothing happens.  waiting for server... waiting for server... it's like it goes in infinity loop.  
can you suggest solution for it?

Tom Morris

unread,
Jun 25, 2016, 3:04:01 PM6/25/16
to tesser...@googlegroups.com
That typically means that it can't find or run ScrollView. Did you follow all the directions on the wiki page including building the jar, copying the dependencies, setting the environment variable, etc?

You can avoid setting the environment variable by running tesseract directly from the ScrollView directory. This command sequence should work:

cd tesseract
make ScrollView.jar
cd java
tesseract ../testing/phototest.tif test1 segdemo inter



--
You received this message because you are subscribed to a topic in the Google Groups "tesseract-ocr" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tesseract-ocr/l918_ouIH98/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/0572a6d8-ea51-43da-9dca-27b5e8f12eb7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Gautam Navapara

unread,
Jun 27, 2016, 5:56:18 AM6/27/16
to tesseract-ocr
make is linux command. I'm using windows10. what is equivalent command in windows? 

Tom Morris

unread,
Jun 27, 2016, 9:25:07 AM6/27/16
to tesser...@googlegroups.com
On Mon, Jun 27, 2016 at 5:56 AM, Gautam Navapara <gbnav...@gmail.com> wrote:
make is linux command. I'm using windows10. what is equivalent command in windows? 

Depends on your tool chain. For Cygwin/Mingw, it still might be `make`. See the wiki instructions here: https://github.com/tesseract-ocr/tesseract/wiki/Compiling#windows

Note that some of the rarer build environments might not include the ScrollView target, but if yours doesn't, you can copy/adapt the instructions from the Linux makefile. It's basically just Java compilation and building of a JAR.

Tom
 
Reply all
Reply to author
Forward
0 new messages