logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Guest  
#1 Posted : Tuesday, May 10, 2016 7:28:19 PM(UTC)
Guest

Rank: Guest

Groups: Guests
Joined: 1/5/2016(UTC)
Posts: 162

Was thanked: 5 time(s) in 5 post(s)
I am a new for ocr, there is a problem when i use Tesseract.Net SDK, just following the example:
https://tesseract.pataga...e6-b6e9-9df777c4678c.htm

I write codes in my projects like this:
Code:

if(dlg.ShowDialog()==DialogResult.OK)
{
    try
    {
        Bitmap bt = new Bitmap(dlg.FileName);
        pictureBox1.Image = bt;           
        using (var api = OcrApi.Create())
        {                              
            api.Init(Languages.English);
            string plainText = api.GetTextFromImage(bt);
        }
    }
    catch (Exception ex) 
    {
        MessageBox.Show(ex.Message); 
    }
}

when i compile my project, the step(api.Init) will make this error: "Unable to initialize the OCR API", i don't know how to solve this problem, please help me!
my framework is .net4.0 and platform is x64,

thank you help me!

Edited by moderator Wednesday, May 11, 2016 3:56:02 AM(UTC)  | Reason: Not specified

Paul Rayman  
#2 Posted : Wednesday, May 11, 2016 4:19:54 AM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Please create a sample console app to check your code.
Tesseract should print own log into that console.
Thanks.
Guest  
#3 Posted : Wednesday, April 4, 2018 6:29:50 PM(UTC)
Guest

Rank: Guest

Groups: Guests
Joined: 1/5/2016(UTC)
Posts: 162

Was thanked: 5 time(s) in 5 post(s)
api.Init(Languages.English);

=> api.Init(Languages.English, "./");

if there is no dataPath, maybe load tessdata from "c:\Program files\Tesseract-OCR\....".
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.