ocrgoogle-vision

Google vision api text detection


I am using google vision api to recognise text from image. The image in Japanese language.

But response is not in Japanese language it is in English. Can any body tell me how to change english to Japanese.


Solution

  • Add a language hint in the AnnotateImageRequest. For example, in 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();