Re: Tesseract Android App

1,606 views
Skip to first unread message

Tom Morris

unread,
May 9, 2013, 4:26:10 PM5/9/13
to tesser...@googlegroups.com
Thanks for letting us know.  Why does it need the network access permission if it's not ad supported?

Tom

On Thursday, May 9, 2013 11:07:16 AM UTC-4, Renard Wellnitz wrote:
Hi 

i just released a tesseract android app. Its free and without adds. I also plan on making the source code available soon.
Feedback and feature suggestions are welcome :-)


Cheers!

Nick White

unread,
May 10, 2013, 5:04:04 AM5/10/13
to tesser...@googlegroups.com
On Fri, May 10, 2013 at 12:32:32AM -0700, Renard Wellnitz wrote:
> Unfortunately i had to add this permission because it was not feasible to pack
> the training data into the apk file. English alone is about 20mb and there are
> more than 50 languages.
> Now the user can selectivly download those files later if he wishes.

I saw this too, and agree it isn't ideal. I'm not particularly
familiar with Android, but might one of the following ideas be
better?

- Have separate packages ("apps") for each training file (I don't
know if the Google Play store would like that, or if everything is
too sandboxed for it to work)
- Just include all of the languages in the app, or in a
multilingual (i.e. non-english) version. Is space for apps a
problem on Android devices? I naively assumed they would have many
GiB of space.

Are you planning to release the source code under a free license?
That would be amazing!

Thanks for this work Renard, it's great to see :)

Nick

Nick White

unread,
May 10, 2013, 10:16:36 AM5/10/13
to tesser...@googlegroups.com
Hi Renard,

Thanks for your reply, in that case I agree the internet permission
seems like the most sensible option. It's a pity it doesn't look
like it's possible to tie the network permission down to specific
URLs, so users could be assured nothing unpleasant was going on (I
think Chromium extensions can have this kind of "only allow on this
website" granularity).

I'm very happy to hear you're planning on releasing the code under GPL
or Apache. Either would be fab (though I'd probably favour GPL
personally, so nasty people would be less inclined to just take your
code and add advertising, but maybe this isn't much of a problem with
Android, I don't know).

I look forward to seeing the code :)

Nick

On Fri, May 10, 2013 at 04:45:13AM -0700, Renard Wellnitz wrote:
> Hi Nick,
>
> there is a 50mb limit for the size of the app binary.
> There are only a limited number possible solutions for the size problem:
>
> • providing a large separate data file that gets downloaded automatically by
> the play store after the user installed the app. The problem here is that
> space is often times a rather rare resource on android phones. Many low end
> devices have only 2 or 4gb in total. If a single app takes several hundred
> megs many users would complain or not even understand why so much space is
> needed. So in the end i decided against this all or nothing approach
> • let the app selectively download the training data at the cost of adding
> the internet permission. This is how it is now.
> • let the user push the training data manually to the app by copying it to
> the sd card himself. (this is currently possible but i think this feature
> is too complicated for the average user)
>
> Regarding publishing the code. I want to do this. Iam not yet sure if i want to
> use the GPL or Apache 2.0.
> Also since i modified tesseract and leptonica sources a bit and have several
> submodules i need to write a proper build script or readme file before
> releasing the sources.
> If i have time i'll push something to my git hub this weekend.
>
> Cheers
> Renard
> --
> --
> You received this message because you are subscribed to the Google
> Groups "tesseract-ocr" group.
> To post to this group, send email to tesser...@googlegroups.com
> To unsubscribe from this group, send email to
> tesseract-oc...@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 unsubscribe from this group and stop receiving emails from it, send an email
> to tesseract-oc...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Tom Morris

unread,
May 11, 2013, 11:40:41 AM5/11/13
to tesser...@googlegroups.com
On Friday, May 10, 2013 7:45:13 AM UTC-4, Renard Wellnitz wrote:

Regarding publishing the code. I want to do this. Iam not yet sure if i want to use the GPL or Apache 2.0. 
Also since i modified tesseract and leptonica sources a bit and have several submodules i need to write a proper build script or readme file before releasing the sources.
If i have time i'll push something to my git hub this weekend.

That would be great.  If you put it up on Github, people could be encouraged to help you with the cleanup and submit pull requests.  Personally I'd prefer a non-viral license like Apache or a limited viral license like EPL/LGPL, but the choice is yours, obviously.

On Friday, May 10, 2013 10:16:36 AM UTC-4, Nick White wrote:

I'm very happy to hear you're planning on releasing the code under GPL 
or Apache. Either would be fab (though I'd probably favour GPL 
personally, so nasty people would be less inclined to just take your 
code and add advertising, but maybe this isn't much of a problem with 
Android, I don't know). 

GPL won't prevent people from creating an ad-supported version.  They just have to publish their changes. 

Tom

Nick White

unread,
May 15, 2013, 5:30:30 AM5/15/13
to tesser...@googlegroups.com
Hi Renard,

This is awesome, great job :)

I was interested to see what changes you'd made to tesseract, so ran
'diff -r' on the tesseract-ocr-3.02 directory in github, but a quick
look made it seem quite different to the
tesseract-ocr-3.02.02.tar.gz currently available from Tesseract.

Am I correct in thinking that? Is it based on a version from SVN? If
so, which? If not, I'll just have to spend more time with diff ;-)

I'd be keen to try and isolate and generalise any changes you made
and get them back into the core code, if I can.

Thanks for all this lovely free code!

Nick

On Tue, May 14, 2013 at 01:51:15PM -0700, Renard Wellnitz wrote:
> Hi Tom,
>
> i decided to publish the code of the app under the Apache 2 licence. However
> the c++ code that deals with image processing uses the stricter GLP v3 since
> that is the place where i put a lot of effort into.
>
> The project still needs a readme and instructions on how to build the binaries.
> For someone with a bit of Android/NDK experience it should be not a big problem
> however.
> Readme and build instructions will follow in a couple of days.
>
> https://github.com/renard314/textfairy
>
> Cheers!
> Renard

Nick White

unread,
May 15, 2013, 5:37:26 AM5/15/13
to tesser...@googlegroups.com
Ah, I see it's pretty close to 3.02.01 (now only available as an SVN
tag). Am I correct in thinking that's the release you used? Or was
it a SVN revision near it?

Thanks again,

Nick

Nick White

unread,
May 15, 2013, 8:28:35 AM5/15/13
to tesser...@googlegroups.com
I'm no expert with SVN, but I think this command will tell me what I
want to know:

svn log -r COMMITTED

Thanks.

On Wed, May 15, 2013 at 04:02:34AM -0700, Renard Wellnitz wrote:
> Hi Nick,
>
> i'm not really proficient with svn. Maybe this helps? If you want me to run a
> specific svn command i'll gladly do it.
>
>
> localhost:tesseract-ocr-3.02 renard$ svn ls "^/tags"
> release-2.04/
> release-3.00/
> release-3.00.1/
> release-3.01/
> release-3.02.01/
> release-3.02.02/
> localhost:tesseract-ocr-3.02 renard$ svnversion .
> 705M
> localhost:tesseract-ocr-3.02 renard$
>
>
> I do not remember the exact changes. But my main goals was the get progress
> information during the ocr process so that my app could show the bounding boxes
> of the currently processed word.
>
> Cheers
> Renard

zdenko podobny

unread,
May 16, 2013, 10:38:02 AM5/16/13
to tesser...@googlegroups.com
I would suggest you to update to more recent svn revision - there were a lot of bugfixes (see [1])

Also I would suggest you to create new github repository WITHOUT language data files (IMO it just consume space at your project and you still can download specific version of language data file from tesseract svn project e.g. with link like this: https://code.google.com/p/tesseract-ocr/source/browse/trunk/tessdata/eng.traineddata?r=660 where "r=660" indicate svn revision). Deleting language data from current repository IMHO do not help, because they will stay in git history, so cloning of your project will be painful (from point of data size).

Anyway - great job! And thanks for sharing you project as open source.


Zdenko


On Wed, May 15, 2013 at 4:18 PM, Renard Wellnitz <renard....@gmail.com> wrote:
Hi Nick,

here is the console output:

localhost:tesseract-ocr-3.02 renard$  svn log -r COMMITTED 
------------------------------------------------------------------------
r705 | zde...@gmail.com | 2012-03-15 22:05:12 +0100 (Thu, 15 Mar 2012) | 1 line

fixed build in java directory; create documentation package with 'make doc-pack'
------------------------------------------------------------------------

Cheers
Renard 

Nick White

unread,
May 16, 2013, 6:40:15 AM5/16/13
to tesser...@googlegroups.com
That looks right, thanks for that.

I'll try to take a proper look soon and figure out how best to
upstream stuff, and where it's worth doing so. In the meantime I'll
attach the .diff (very small; only 200 lines), in case anyone else
is interested, and so I don't forget ;)

Nick

On Wed, May 15, 2013 at 07:18:42AM -0700, Renard Wellnitz wrote:
> Hi Nick,
>
> here is the console output:
>
>
> localhost:tesseract-ocr-3.02 renard$ svn log -r COMMITTED
> ------------------------------------------------------------------------
> r705 | zde...@gmail.com | 2012-03-15 22:05:12 +0100 (Thu, 15 Mar 2012) | 1
> line
>
> fixed build in java directory; create documentation package with 'make
> doc-pack'
> ------------------------------------------------------------------------
>
>
r705-vs-textfairy-tesseract.diff

Nick White

unread,
May 20, 2013, 5:42:17 AM5/20/13
to tesser...@googlegroups.com
Hi Renard,

Great, I'm glad you're merging them into the latest Tesseract
revision. Could you then post the patches into the Tesseract bug
tracker? http://code.google.com/p/tesseract-ocr/issues/list

> But one change that i really need is the option to pass in a monitor to the
> api. One reason is to cancel the ocr process from my app and the other reason
> is so that i can show a progress bar to the user.

That sounds like the sort of thing that others using the API would
find useful too. If you can make the change in such a way that
existing code using the API continues to work, I expect that could
be incorporated into Tesseract too.

Nick

On Sat, May 18, 2013 at 07:01:52AM -0700, Renard Wellnitz wrote:
> Hi Nick,
>
> thanks for the diff. I made the changes a long time ago and i did not really
> remember everything. But the diff greatly helped me to remember :-)
> Iam currently merging my changes to the latest revision of tesseract. Iam also
> trying to move as much of my code out of your source files.
> I will also create a new git repo that should be much smaller. I will also
> mavenize the whole project so that it can be built with just one command.
>
> Cheers
> Renard

zdenko podobny

unread,
May 31, 2013, 6:29:43 PM5/31/13
to tesser...@googlegroups.com

On Sun, May 26, 2013 at 3:36 PM, Renard Wellnitz <renard....@gmail.com> wrote:
Hi,

i did the merge and also updated my repo with build instructions.

changes:
  • extended ETEXT_DESC with PROGRESS_FUNC field. So users of the api can register a callback function to get notified of progress percentage as well as word bounding boxes.
    • (Most people i have shown my app really liked how it highlighted the current word when doing the ocr)
  • changed the percentage progress values to start with 0% instead of 30%
  • added row attributes to hocr output so that i can make more straight lines when creating the pdf files

Cheers
Renard


Try to to test/implement you patch to current tesseract code, and I face some questions related to hOCR standard[1]:
  • standard defines x_font s for OCR-engine specific font names. You put to hOCR output font='15'. What is purpose of it?
  • standard defines x_fsize n for OCR-engine specific font size. You used size. Should I change it to x_fsize (it could be dangerous, because there could be different font with different size in one line)?
  • standard does not define descenders and ascenders. Any suggestion (from community) better way how to keep hOCR standard?

[1] https://docs.google.com/document/d/1QQnIQtvdAC_8n92-LhwPcjtAUFwBlzE8EWnKAxlgVf0/preview#

Zdenko

 
 

oabte...@gmail.com

unread,
Jul 30, 2013, 5:05:15 AM7/30/13
to tesser...@googlegroups.com
Hey Renard Wellnitz,
I'm not able to download github code but downloaded your apk which works, So I want that code.
Is it not working? Please reply, as I need that urgently (ASAP)......

Mary Ying

unread,
Jul 30, 2013, 2:36:46 PM7/30/13
to tesser...@googlegroups.com
Hi Renard

Thanks for posting your code. I am very interested in also making some android apps using tessaract. I will pull your code from git and see how you have done this!

clyde

unread,
Oct 14, 2013, 12:05:51 AM10/14/13
to tesser...@googlegroups.com
hello anyone

i am working on a school project, i used Tesseract OCR. I successfully done it in android app.
I try to test it to capture image with text it display the correct text but
my problem is that when i capture an image with no text it still display text like trash.

I hope somebody could help me.. Thank You :)

Noong Huwebes, Mayo 09 2013 23:07:16 UTC+8, si Renard Wellnitz ay sumulat:

clyde

unread,
Oct 27, 2013, 2:31:59 AM10/27/13
to tesser...@googlegroups.com
Hello Renard,

zdenko podobny

unread,
Oct 28, 2013, 5:14:42 PM10/28/13
to tesser...@googlegroups.com
1. help - do not steal e-mail thread :-) Create your own.
2. help - to detect text in image is "quite science". Have a look at [1] or google for for text+detection+in+images.



Zdenko


--

Buyung Afrianto

unread,
May 9, 2014, 4:34:04 AM5/9/14
to tesser...@googlegroups.com
Do you know how to create bounding box for each character using tesseract, step by step ??

Nick White

unread,
May 9, 2014, 11:22:54 AM5/9/14
to tesser...@googlegroups.com
Hi Buyung,

On Fri, May 09, 2014 at 01:34:04AM -0700, Buyung Afrianto wrote:
> Do you know how to create bounding box for each character using tesseract, step
> by step ??

Depending on what you want to do with the bounding box information,
you could just run tesseract using the 'makebox' config, as is done
in the training process, like this:

tesseract myimage myout batch.nochop makebox

Alternatively you can use the ResultIterator in the API quite
straightforwardly, if you're comfortable programming.

Nick
Reply all
Reply to author
Forward
0 new messages