I get an AccessViolationException, trying to adapt your code for my
needs: Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.

The code is more or less copied from your simple1 - my bitmap does not
come out of a file but from a screenshot (part of the screen).

public static void Recognize(Bitmap bmp)
{
    string language = "eng";
    int oem = (int)eOcrEngineMode.OEM_DEFAULT;

    using (TesseractProcessor processor = new TesseractProcessor())
    {
        DateTime started = DateTime.Now;
        DateTime ended = DateTime.Now;

        string tessdataFolder = @"D:\Temp\IPoVnOCRer\IPoVn\Test
\Tessdata";

        processor.Init(tessdataFolder, language, oem);


        string text = "";
        unsafe
        {
            started = DateTime.Now;
            text = processor.Recognize(bmp);
            ended = DateTime.Now;

            Console.WriteLine("Duration recognition: {0} ms\n\n",
(ended - started).TotalMilliseconds);
        }

        Console.WriteLine(
            string.Format("RecognizeMode: {1}\nRecognized Text:\n{0}\n+
+++++++++++++++++++++++++++++++\n", text,
((eOcrEngineMode)oem).ToString()));

    }
}

BTW, thx for writing a wrapper - if it works, it solves just about all
my problems. :)

-- 
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

Reply via email to