谷歌ocr api for android(图像到文本转换)

时间:2022-02-07 09:02:01

I tried doing this by tesseract but the apk file generated is of 8 mb. I have seen Goggles app in Play and its quite efficient. I wonder how to integrate that technique.I haven't seen in any tutorial for that. If any one knows how to do that,please respond.

我尝试通过tesseract这样做,但生成的apk文件是8 MB。我在Play中看过Goggles应用程序并且非常高效。我想知道如何整合这种技术。我没有在任何教程中看到过。如果有人知道如何做到这一点,请回复。

Also How can I improve the quality of Tesseract which I am using. The conversion is smooth but I wonder that If I divide the images in several parts and then separately parse,Will that be useful.

另外,我如何提高我使用的Tesseract的质量。转换是顺利的,但我想知道如果我将图像分成几个部分,然后单独解析,那将是有用的。

The requirement is that it should read the bills or receipts,so I want to improve the quality of text conversion. Please suggest.

要求是它应该阅读账单或收据,所以我想提高文本转换的质量。请建议。

1 个解决方案

#1


2  

I believe you compiling this project: tess-two. Am I correct?

我相信你编译这个项目:tess-two。我对么?

If so, you can greatly reduce the size of the APK by compiling different APKs for specific CPU architectures. Also, you can remove most of Leptonica's functions, since you don't need them.

如果是这样,您可以通过针对特定CPU架构编译不同的APK来大大减小APK的大小。此外,您可以删除大部分Leptonica的功能,因为您不需要它们。

For better accuracy:

为了更好的准确性

  • if you are using the phone's camera as input, you should change the binarization algorithm. Leptonica has some binarization algorithms, try Sauvola.
  • 如果您使用手机的相机作为输入,则应更改二值化算法。 Leptonica有一些二值化算法,试试Sauvola。

  • tweak tesseract's parameters for better performance vs speed.
  • 调整tesseract的参数以获得更好的性能与速度。

  • make sure you have a consistent resolution on all phones. Somewhere around 300dpi.
  • 确保所有手机都具有一致的分辨率。大约300dpi。

If you want a small application that runs fast on most phones, consider running the OCR on an server, not on the phone.

如果您想要在大多数手机上运行速度很快的小型应用程序,请考虑在服务器上运行OCR,而不是在手机上运行。

Tesseract is, as far as I know, by far the best OCR engine that can be compiled for Android. It has to be tweaked correctly and fed a good image.

据我所知,Tesseract是迄今为止可以为Android编译的最佳OCR引擎。它必须正确调整并提供良好的图像。

#1


2  

I believe you compiling this project: tess-two. Am I correct?

我相信你编译这个项目:tess-two。我对么?

If so, you can greatly reduce the size of the APK by compiling different APKs for specific CPU architectures. Also, you can remove most of Leptonica's functions, since you don't need them.

如果是这样,您可以通过针对特定CPU架构编译不同的APK来大大减小APK的大小。此外,您可以删除大部分Leptonica的功能,因为您不需要它们。

For better accuracy:

为了更好的准确性

  • if you are using the phone's camera as input, you should change the binarization algorithm. Leptonica has some binarization algorithms, try Sauvola.
  • 如果您使用手机的相机作为输入,则应更改二值化算法。 Leptonica有一些二值化算法,试试Sauvola。

  • tweak tesseract's parameters for better performance vs speed.
  • 调整tesseract的参数以获得更好的性能与速度。

  • make sure you have a consistent resolution on all phones. Somewhere around 300dpi.
  • 确保所有手机都具有一致的分辨率。大约300dpi。

If you want a small application that runs fast on most phones, consider running the OCR on an server, not on the phone.

如果您想要在大多数手机上运行速度很快的小型应用程序,请考虑在服务器上运行OCR,而不是在手机上运行。

Tesseract is, as far as I know, by far the best OCR engine that can be compiled for Android. It has to be tweaked correctly and fed a good image.

据我所知,Tesseract是迄今为止可以为Android编译的最佳OCR引擎。它必须正确调整并提供良好的图像。