Re: I Need help getting Tesseract 4.0 C# .Net Wrapper working please!

4,456 views
Skip to first unread message
Message has been deleted

Mohammad Mahdizadeh

unread,
Jan 8, 2018, 2:49:43 AM1/8/18
to tesseract-ocr
I have the same problem 


On Friday, January 5, 2018 at 8:38:08 PM UTC+3:30, James Q wrote:
I'm trying to use this wrapper:

It's an x64 .Net assembly with one main DLL (Tesseract.dll) and two dependency DLLs (liblept1741.dll and libtesseract400.dll). To start with I'm just trying to get a Visual Studio console app running. I've added Tesseract.dll in as a reference but it fails to recognize the dependency DLLs, throwing a runtime DllNotFoundException: "Failed to find library "liblept1741.dll" for platform x64.".

I've tried placing the DLLs in the .\bin\x64\Debug folder and elsewhere along the project structure but no luck! I've tried manually adding them to an ItemGroup in the csproj file with 'CopyToOutputDirectory Always'. I've also tried setting TesseractEnviornment.CustomSearchPath in my Main class, but although the runtime searches in the correct folders, it still doesn't find the DLLs. My app is for x64 so the image type should match. I can't think of what else to try.

If anyone has this working I would greatly appreciate any advice.

Thanks in advance
James


Message has been deleted

ShreeDevi Kumar

unread,
Jan 8, 2018, 6:23:26 AM1/8/18
to tesser...@googlegroups.com

maybe the fix there will help.

ShreeDevi
____________________________________________________________
भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com

On Mon, Jan 8, 2018 at 3:33 PM, James Q <james.qu...@taina.tech> wrote:
By the way I do have the Tesseract.net nuget package working ( https://www.nuget.org/packages/tesseract.net/ ), but have 2 issues with this:
1.) I need to write a separate Bitmap -> Pix converter in C#
2.) I haven't yet got whitelists/blacklists working

Neither of these were issues with the tesseract 3 Charles Weld wrapper, hence my reason for trying to get the tdhintz one working (as this is based on Charles Weld's 3 wrapper).
Thanks
James

--
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-ocr+unsubscribe@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/13d63957-ecfc-4451-833f-ad6d23b76b01%40googlegroups.com.

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

ShreeDevi Kumar

unread,
Jan 8, 2018, 6:26:56 AM1/8/18
to tesser...@googlegroups.com
tesseract 4 alpha does not support whitelist/blacklist.

ShreeDevi
____________________________________________________________
भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com

Message has been deleted

ShreeDevi Kumar

unread,
Jan 8, 2018, 6:55:51 AM1/8/18
to tesser...@googlegroups.com
I don't think the code has been updated to show which options are supported in 4.00alpha.

You can see https://github.com/tesseract-ocr/tesseract/issues/751 regarding whitelist issue.

ShreeDevi
____________________________________________________________
भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com

On Mon, Jan 8, 2018 at 5:15 PM, James Q <james.qu...@taina.tech> wrote:
Thanks for the reply ShreeDevi, I haven't found much in the way of documentation to say which options are supported in 4.0alpha compared to 3.0x. I ran "tesseract.exe --print-parameters" and both "tessedit_char_whitelist" / "tessedit_char_blacklist" were still in the list. I therefore assumed they were still supported. 

Could you please let me know how to find out which options are still supported in 4.0?

Is there an alternative option to tell tesseract to exclude certain characters (in my case I have a number format which has numbers and letters but never capital O).

Thanks
James
To unsubscribe from this group and stop receiving emails from it, 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.

--
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-ocr+unsubscribe@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.

THintz

unread,
Jan 11, 2018, 3:54:19 PM1/11/18
to tesseract-ocr

 The Tesseract.dll goes in the folder with your binary and the other two dlls go in either an x64 or an x86 folder below that.
Message has been deleted

THintz

unread,
Jan 12, 2018, 9:45:06 AM1/12/18
to tesseract-ocr
I built those DLLs with VS 2017.  I think the run-time lib version is 140.

There are 3 main reasons the libs fail to load.

1. The DLLs are in the wrong folders.  The correct folders are:
     The .Net wrapper DLL assembly is placed in the exact same folder you run your app from, and the other 2 are placed in a folder x86 or x64 located in the app's folder.  The DLLs I created are only x64.

2. You are missing a dependency.  See https://github.com/charlesw/tesseract/issues/363 for examples tracing this.  If you must resort to procmon to figure this out then you need to be prepared to read tea leaves.

3. The wrong .Net wrapper is used.  Mr. Weld's wrapper has a trace feature that enables you see mismatch between the wrapper and the DLLs.  A mismatch occurs when the wrapper tries to bind to the public interface of Leptonica and the two differ.

The DLLs I created have been superseded in a branch of charlesw/tesseract on github.  There is actually not much functional difference between the two, at this time, but you might find it easier to work with the newer branch. 
Message has been deleted

Vipin Tom Varghese

unread,
Sep 25, 2018, 1:03:19 PM9/25/18
to tesseract-ocr
Hi James, my apologies to hit you up so randomly, but I had no ther options left. Ive been trying to get Tesseract 4 working using tesseract.net wrapper following the wiki here, but i'm unable to build from source. Could share how you got it working ?

Thanks
Vipin


On Monday, 8 January 2018 15:33:50 UTC+5:30, James Q wrote:
By the way I do have the Tesseract.net nuget package working ( https://www.nuget.org/packages/tesseract.net/ ), but have 2 issues with this:
1.) I need to write a separate Bitmap -> Pix converter in C#
2.) I haven't yet got whitelists/blacklists working

Neither of these were issues with the tesseract 3 Charles Weld wrapper, hence my reason for trying to get the tdhintz one working (as this is based on Charles Weld's 3 wrapper).
Thanks
James

On Monday, January 8, 2018 at 7:49:43 AM UTC, Mohammad Mahdizadeh wrote:
Message has been deleted

THintz

unread,
Sep 26, 2018, 7:37:36 AM9/26/18
to tesseract-ocr
I assume you mean the charlesw/tesseract wrapper on Github.  Questions are more directly answered there.  What steps did you perform and what is the symptom?

Justin Minnaar

unread,
Jun 12, 2019, 12:10:09 PM6/12/19
to tesseract-ocr
Hi Vipin

Did you ever come right with Tesseract 4 under C#? I've been using version 3 but would like to move to version 4. 

Justin
Reply all
Reply to author
Forward
0 new messages