Exemple #1
0
        static string FromFile(string path)
        {
            IntPtr tess = TessAPI.APICreate();

            TessAPI.APISetup(tess, 1);
            TessAPI.APIInit(tess, "swe");

            TessAPI.SetImgPath(tess, path);

            string text = TessAPI.GetFullText(tess);

            TessAPI.APIEnd(tess);

            return(text);
        }
Exemple #2
0
        static string FromArray(string path)
        {
            IntPtr tess = TessAPI.APICreate();

            TessAPI.APISetup(tess, 1);
            TessAPI.APIInit(tess, "swe");

            byte[] imStream = ImageHandler.ImageToArray(@path);
            TessAPI.SetImgArray(tess, imStream, imStream.Length);

            string text = TessAPI.GetFullText(tess);

            TessAPI.APIEnd(tess);

            return(text);
        }