public static void BankCard()
        {
            var client = new Baidu.Aip.Ocr.Ocr("Api Key", "Secret Key");
            var image  = File.ReadAllBytes("图片文件路径");

            // 银行卡识别
            var result = client.BankCard(image);
        }
Пример #2
0
        public static String BankCard(string imgpath)
        {
            var client = new Baidu.Aip.Ocr.Ocr(API_KEY, SECRET_KEY);
            var image  = File.ReadAllBytes(imgpath);

            // 银行卡识别
            var result = client.BankCard(image);

            return(result.ToString());
        }
Пример #3
0
        static void Main(string[] args)
        {
            var client = new Baidu.Aip.Ocr.Ocr("ClKHixnqs0HsEFQ5vsdqfQgH", "gSsGt3IGQMGCWzKnkLucejOcXGxIuV5H");
            var image  = File.ReadAllBytes(@"D:\Project\AipSdkTest\TIM截图20171023094133.png");

            // 网图识别
            var result = client.BankCard(image, null);

            Console.WriteLine(result.ToString());
            Console.ReadKey();
        }
Пример #4
0
        public ActionResult CreditFront(string credit_front)
        {
            var client = new Baidu.Aip.Ocr.Ocr(clientId, clientSecret);
            var image  = System.IO.File.ReadAllBytes(Request.MapPath(credit_front));
            // 信用卡正面
            Dictionary <string, object> myDictionary = new Dictionary <string, object>();

            myDictionary.Add("detect_direction", "true"); //是否检测图像朝向
            myDictionary.Add("accuracy", "high");         //精准度,精度越高,速度越慢
            var resultBei = client.BankCard(image, myDictionary);

            return(Content(resultBei.ToString()));
        }