【问题标题】:Google vision api text detection谷歌视觉 api 文本检测
【发布时间】:2017-02-04 09:01:53
【问题描述】:

我正在使用 google vision api 从图像中识别文本。日语图像。

但是回复不是用日语而是用英语。谁能告诉我怎么把英文改成日文。

【问题讨论】:

    标签: text detection vision


    【解决方案1】:

    在 AnnotateImageRequest 中添加语言提示。例如,在 C# 中:

           var responses = vision.Images.Annotate(
                new BatchAnnotateImagesRequest()
                {
                    Requests = new[] {
                    new AnnotateImageRequest() {
                        Features = new [] { new Feature() { Type =
                          "TEXT_DETECTION"}},
                        Image = new Image() { Content = imageContent },
                        ImageContext = new ImageContext()
                        {
                            LanguageHints = new string[] { "ja" }
                        }
                    }
               }
                }).Execute();
    

    【讨论】:

    • @{@"requests":@[ @{@"image": @{@"content":imageData}, @"imageContext": @{@"languageHints":@[@" ja"]}, @"features":@[ @{@"type":@"TEXT_DETECTION", @"maxResults":@16}, ] }]};
    • 先生,OBJETIVE-C 可以吗
    • 我对 Objective-C 的了解不够好,无法回答。 :-(
    【解决方案2】:

    尝试输入“DOCUMENT_TEXT_DETECTION”而不是“TEXT_DETECTION”, 例如(在 Java 中),

    Feature feat = Feature.newBuilder().setType(Type.DOCUMENT_TEXT_DETECTION).build();
    

    【讨论】:

      猜你喜欢
      • 2017-09-09
      • 2018-03-14
      • 2019-12-18
      • 2018-07-14
      • 2017-06-14
      • 1970-01-01
      • 1970-01-01
      • 2019-10-07
      • 2016-11-10
      相关资源
      最近更新 更多