谷歌云视觉api-OCR,C#,截止日期超过例外

时间:2018-04-05 10:22:56

标签: c# exception ocr google-cloud-vision

我正在尝试使用谷歌云视觉OCR API从图像中读取文本。

using System;
using Google.Cloud.Vision.V1;
namespace blablabla
{
    class Program
    {
        static void Main(string[] args)
        {
            string filePath = @"D:\Manisha\Pictures\1.png";
            var image = Image.FromFile(filePath);
            var client = ImageAnnotatorClient.Create();
            var response = client.DetectText(image);
            foreach (var annotation in response)
            {
                if (annotation.Description != null)
                    Console.WriteLine(annotation.Description);
            }
            Console.ReadLine();
        }
    }
}

var response = client.DetectText(image);这一行给出了异常:状态(StatusCode = DeadlineExceeded,Detail =" Deadline Exceeded")

0 个答案:

没有答案