C# 折腾了一下午 终于把百度文字识别搞出来了

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;


namespace 测试
{
    class Program
    {
        static void Main(string[] args)
        {
            var ApiKey = "eLSeFV【Key自己去申请】V5xt5AoZI1";
            var SecretKey = "wwlexj5【Key自己去申请】fzchemaCcXkec";
            var tuPian = "D:\\1.png";
            var client = new Baidu.Aip.Ocr.Ocr(ApiKey, SecretKey);
            var image = File.ReadAllBytes(tuPian);

            // 通用文字识别
            var result = client.GeneralBasic(image, null);
            Console.WriteLine(result);
            Console.ReadKey();
        }
    }
     

}


 
 

详细文档看这里:http://ai.baidu.com/docs#/OCR-Csharp-SDK/top

猜你喜欢

转载自blog.csdn.net/heyics/article/details/79953492
今日推荐