在 Android 上将图片翻译成文本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2904507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:49:16  来源:igfitidea点击:

Translate a picture to text on Android?

androidocr

提问by Keith

I know that google goggles will translate a picture to text. What I want to do is allow the user to take a picture (no problem), translate that picture to text(?) and then do some processing on the text (no problem).

我知道谷歌护目镜会将图片翻译成文字。我想要做的是允许用户拍照(没问题),将该图片转换为文本(?),然后对文本进行一些处理(没问题)。

Is there any API on android that allows this? or is there any way to programtically communicate with google goggles? I would hate to have the user use goggles then select the saved file with my app.....

android 上是否有任何 API 允许这样做?或者有没有办法以编程方式与谷歌护目镜通信?我不想让用户使用护目镜然后用我的应用程序选择保存的文件.....

采纳答案by Chinmay Kanchi

Take a look at Is there any free OCR library for Android?and What kind of OCR Java library should I use in Android?if you want libraries that do the translation on the phone itself.

看看有没有适用于 Android 的免费 OCR 库?我应该在Android中使用什么样的OCR Java库的?如果您想要在手机上进行翻译的库。

However, Google also provides a WebAPI that does this. http://googlesystem.blogspot.com/2009/09/google-docs-ocr.html

但是,Google 还提供了一个 WebAPI 来执行此操作。http://googlesystem.blogspot.com/2009/09/google-docs-ocr.html

Just remember that OCR (optical character recognition) is, as of now, an inexact science and you won't get flawless transcription in all cases...

请记住,到目前为止,OCR(光学字符识别)是一门不精确的科学,您不会在所有情况下都获得完美的转录...

回答by dimo hamdy

check this example it's used in google translate to get text from image it's use google services

检查这个例子它在谷歌翻译中使用从图像中获取文本它使用谷歌服务

https://github.com/googlesamples/android-vision/tree/master/visionSamples/ocr-codelab

https://github.com/googlesamples/android-vision/tree/master/visionSamples/ocr-codelab