Re: Integrating tesseract into Qt (C++ project)

4,221 views
Skip to first unread message

Andres

unread,
Aug 22, 2012, 12:38:29 AM8/22/12
to tesser...@googlegroups.com

Yes, it is possible.

You have 2 choices:

- you can call tesseract executable from your app.

- you can use the api interface and link your poject with tesseract.

To see how, read the documentation and the old messages in this group.

Regards.

El 22/08/2012 00:15, "Milan" <poiso...@gmail.com> escribió:
Hello everyone,

I made a gallery, now I need to implement OCR function using tesseract, is this even possible? So a bit about the application, I am opening the image using Qt methods, and everything is working fine considering that part, now I need to implement the part where the user clicks on button "OCR" (or w/e), and I get the output file lets say in the folder where the image is.

Kinda new with using open source projects and implementing them into my application so I would really appreciate any help. Thank you in advance.

Milan

--
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

iso8859

unread,
Aug 22, 2012, 4:37:30 AM8/22/12
to tesser...@googlegroups.com
Look at the .NET wrapper, it's written in C++ and can help you a lot.

zdenko podobny

unread,
Aug 22, 2012, 3:19:56 PM8/22/12
to tesser...@googlegroups.com
On Wed, Aug 22, 2012 at 6:38 AM, Andres <andr...@gmail.com> wrote:

Yes, it is possible.

You have 2 choices:

- you can call tesseract executable from your app.

- you can use the api interface and link your project with tesseract.

If you want to use c++ API you can use  tesseractmain.cpp[1] as example application.
If you are interesting to use c++ API within QT, have a look at qt-box-editor[2] and there to TessTools.cpp - there is example how to convert QImage to PIX and vice versa...


-- 
Zdenko

zdenko podobny

unread,
Aug 23, 2012, 2:17:07 PM8/23/12
to tesser...@googlegroups.com
What OS + IDE are you using?
-- 
Zdenko

On Thu, Aug 23, 2012 at 7:30 PM, Milan <poiso...@gmail.com> wrote:
Thank you all for the answers.

Zdenko I have a really beginners question, what are all the steps I need to take so I can start working on something similar to the application you showed me[1]. My biggest problem is implementing libraries and so on, this is my 1st time using code that I did not write... Thank you in advance.

Milan
[1]https://github.com/zdenop/qt-box-editor

zdenko podobny

unread,
Aug 24, 2012, 5:34:25 AM8/24/12
to tesser...@googlegroups.com
First of all you need tesseract dependencies (leptonica + its dependencies). You can compile it by yourself, but in this case you need to install mingw+msys environment...  than you need to compile tesseract library. 

In past I was successful in using leptonica library build by VC++ (leptonica-1.68-win32-lib-include-dirs.zip) within QT Creator (with mingw), but as far as I know it is not correct way...

Maybe during weekend I can try to publish needed libs + include file, maybe example QT4 project for using tesseract api (without QT4 dependencies)...

-- 
Zdenko

On Thu, Aug 23, 2012 at 8:58 PM, Milan <poiso...@gmail.com> wrote:
Windows 7, and using QT Creator.

TP

unread,
Aug 24, 2012, 6:32:01 AM8/24/12
to tesser...@googlegroups.com
On Fri, Aug 24, 2012 at 2:34 AM, zdenko podobny <zde...@gmail.com> wrote:
> First of all you need tesseract dependencies (leptonica + its dependencies).
> You can compile it by yourself, but in this case you need to install
> mingw+msys environment... than you need to compile tesseract library.
>
> In past I was successful in using leptonica library build by VC++
> (leptonica-1.68-win32-lib-include-dirs.zip) within QT Creator (with mingw),
> but as far as I know it is not correct way...
>
> Maybe during weekend I can try to publish needed libs + include file, maybe
> example QT4 project for using tesseract api (without QT4 dependencies)...

Why couldn't someone just use the VS2008 [1] or VS2010 [2] versions of Qt?

I haven't tried this myself. The last (and only) time I tried Qt I
used python and PyQt [3] instead of C++ and wrote a small python class
using the ctypes package to hook into Leptonica. I find PyQt *much*
easier to use than straight Qt but I suppose it's trickier to package
up the result into something that you can ship to people.

[1] http://qt.nokia.com/downloads/windows-cpp-vs2008

[2] http://qt.nokia.com/downloads/windows-cpp-vs2010

[3] http://www.riverbankcomputing.co.uk/software/pyqt/intro

zdenko podobny

unread,
Aug 24, 2012, 9:10:00 AM8/24/12
to tesser...@googlegroups.com
On Fri, Aug 24, 2012 at 12:32 PM, TP <win...@gmail.com> wrote:
On Fri, Aug 24, 2012 at 2:34 AM, zdenko podobny <zde...@gmail.com> wrote:
> First of all you need tesseract dependencies (leptonica + its dependencies).
> You can compile it by yourself, but in this case you need to install
> mingw+msys environment...  than you need to compile tesseract library.
>
> In past I was successful in using leptonica library build by VC++
> (leptonica-1.68-win32-lib-include-dirs.zip) within QT Creator (with mingw),
> but as far as I know it is not correct way...
>
> Maybe during weekend I can try to publish needed libs + include file, maybe
> example QT4 project for using tesseract api (without QT4 dependencies)...

Why couldn't someone just use the VS2008 [1] or VS2010 [2] versions of Qt?

1. it is user choice/question of preferences ;-) Some users could prefer QT4 native solution (QT creator). I guess it is possible to use VC++ compiler within it but I can not help with it.
2. some versions of Qt VS Add-in[1] (e.g. 1.1.7[2]) do not work with  Visual Studio Express editions...
 

I haven't tried this myself. The last (and only) time I tried Qt I
used python and PyQt [3] instead of C++ and wrote a small python class
using the ctypes package to hook into Leptonica. I find PyQt *much*
easier to use than straight Qt but I suppose it's trickier to package
up the result into something that you can ship to people.

I agree PyQT4 is easier, but that would require to learn another language (python).
I am not advocating for any solution - I just offer what I already have (I need to pack it...)

zdenko podobny

unread,
Aug 26, 2012, 2:43:10 PM8/26/12
to tesser...@googlegroups.com
Have a look at https://github.com/zdenop/tesseract-mingw - there are mingw versions of (hopefully) all needed files. You should be able to integrate them easily to QT Creator project.

-- 
Zdenko
Reply all
Reply to author
Forward
0 new messages