digitalmars.D - Binding for tesseract
- Andrea Fontana (5/5) Feb 06 2013 I need a binding for tesseract. It has a C interface, so it
- David (7/15) Feb 06 2013 Translating this file:
- Andrea Fontana (3/20) Feb 06 2013 Yes, but I never did a "translation". Any manual/tutorial/help
- David (5/7) Feb 06 2013 Well, you need a basic C knowledge to translate it and there is this
- Andrea Fontana (4/14) Feb 06 2013 That seems useful, thank you :)
- Jacob Carlborg (5/10) Feb 06 2013 There's a tool for that:
- Andrea Fontana (3/16) Feb 06 2013 It won't compile on ubuntu 12.10 64bit alternatives?
- Jacob Carlborg (4/5) Feb 06 2013 Use the pre-compiled binary for 32bit.
- Fred (32/38) May 08 2019 On Thursday, 7 February 2013 at 07:36:18 UTC, Jacob Carlborg
- Fred (11/16) May 08 2019 Turns out, yes, all I needed to do was check for the location of
- Jacob Carlborg (5/7) May 14 2019 No worries.
I need a binding for tesseract. It has a C interface, so it should be doable. Has anyone already done it? Is there a tutorial on how to create a binding? I've seen bcd.gen but it seems old: it won't compile with my dmd version.
Feb 06 2013
Am 06.02.2013 13:16, schrieb Andrea Fontana:I need a binding for tesseract. It has a C interface, so it should be doable. Has anyone already done it? Is there a tutorial on how to create a binding? I've seen bcd.gen but it seems old: it won't compile with my dmd version.Translating this file: http://code.google.com/p/tesseract-ocr/source/browse/trunk/api/capi.h Into D, wrapped with extern(C) should do it. I played around with pytesser a while ago: http://code.google.com/p/pytesser/source/browse/trunk/pytesser.py This calls the tesseract executable, maybe that is easier.
Feb 06 2013
Yes, but I never did a "translation". Any manual/tutorial/help about this? On Wednesday, 6 February 2013 at 12:25:37 UTC, David wrote:Am 06.02.2013 13:16, schrieb Andrea Fontana:I need a binding for tesseract. It has a C interface, so it should be doable. Has anyone already done it? Is there a tutorial on how to create a binding? I've seen bcd.gen but it seems old: it won't compile with my dmd version.Translating this file: http://code.google.com/p/tesseract-ocr/source/browse/trunk/api/capi.h Into D, wrapped with extern(C) should do it. I played around with pytesser a while ago: http://code.google.com/p/pytesser/source/browse/trunk/pytesser.py This calls the tesseract executable, maybe that is easier.
Feb 06 2013
Am 06.02.2013 14:29, schrieb Andrea Fontana:Yes, but I never did a "translation". Any manual/tutorial/help about this?Well, you need a basic C knowledge to translate it and there is this guide: http://dlang.org/interfaceToC.html If you need more help you can join #D on irc.freenode.net, helping with a realtime chat is easier than over these "forums"
Feb 06 2013
That seems useful, thank you :) In the meantime, I've started a ec2 micro instance 32bit and I'm trying to compile stuff for dstep :) On Wednesday, 6 February 2013 at 18:35:30 UTC, David wrote:Am 06.02.2013 14:29, schrieb Andrea Fontana:Yes, but I never did a "translation". Any manual/tutorial/help about this?Well, you need a basic C knowledge to translate it and there is this guide: http://dlang.org/interfaceToC.html If you need more help you can join #D on irc.freenode.net, helping with a realtime chat is easier than over these "forums"
Feb 06 2013
On 2013-02-06 13:16, Andrea Fontana wrote:I need a binding for tesseract. It has a C interface, so it should be doable. Has anyone already done it? Is there a tutorial on how to create a binding? I've seen bcd.gen but it seems old: it won't compile with my dmd version.There's a tool for that: https://github.com/jacob-carlborg/dstep -- /Jacob Carlborg
Feb 06 2013
It won't compile on ubuntu 12.10 64bit alternatives? On Wednesday, 6 February 2013 at 13:46:11 UTC, Jacob Carlborg wrote:On 2013-02-06 13:16, Andrea Fontana wrote:I need a binding for tesseract. It has a C interface, so it should be doable. Has anyone already done it? Is there a tutorial on how to create a binding? I've seen bcd.gen but it seems old: it won't compile with my dmd version.There's a tool for that: https://github.com/jacob-carlborg/dstep
Feb 06 2013
On 2013-02-06 15:45, Andrea Fontana wrote:It won't compile on ubuntu 12.10 64bit alternatives?Use the pre-compiled binary for 32bit. -- /Jacob Carlborg
Feb 06 2013
On Thursday, 7 February 2013 at 07:36:18 UTC, Jacob Carlborg wrote:On 2013-02-06 15:45, Andrea Fontana wrote:On Thursday, 7 February 2013 at 07:36:18 UTC, Jacob Carlborg wrote:It won't compile on ubuntu 12.10 64bit alternatives?Use the pre-compiled binary for 32bit.On 2013-02-06 15:45, Andrea Fontana wrote:Hey Jacob & Andrea, I hate to drag this up from so long ago but I am very new to D and have used your tool to convert the latest capi.c from the tesseract-ocr library (https://github.com/tesseract-ocr/tesseract/blob/master/src/api/capi.h) And I am wondering how I go about simply importing it and using it in my D project. Here is the converted file, it worked with dstep with no errors: https://pastebin.com/x1FgWjGj And I called the output file tesseract_capi.d and put it in the source directory of my project and am trying to import it into one of my apps files named ocr.d as follows: module ocr; import std.stdio; import tesseract_capi; class ocr{ TessBaseAPI *api; this(){ this.api = TessBaseAPICreate(); } } And any attempt to build and run returns an: undefined reference to `TessBaseAPICreate' Should I be linking to the actual library in the dub.json? I cannot seem to find any straightforward tutorial about importing dstep converted files unfortunately. Any help would be greatly appreciated. Thank youIt won't compile on ubuntu 12.10 64bit alternatives?Use the pre-compiled binary for 32bit.
May 08 2019
On Thursday, 9 May 2019 at 00:30:04 UTC, Fred wrote:Should I be linking to the actual library in the dub.json? I cannot seem to find any straightforward tutorial about importing dstep converted files unfortunately. Any help would be greatly appreciated. Thank youTurns out, yes, all I needed to do was check for the location of the library tesseract -v tesseract 4.0.0 leptonica-1.75.3 libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.5.2) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 0.6.1 : libopenjp2 2.3.0 Found SSE And add "-ltesseract" to my projects lflags in the dub.json! Sorry for the notification folks +1
May 08 2019
On 2019-05-09 02:41, Fred wrote:And add "-ltesseract" to my projects lflags in the dub.json!Yeah, that's correct.Sorry for the notification folks +1No worries. -- /Jacob Carlborg
May 14 2019