如何在android中从摄像头读取数字和文本?

时间:2021-11-23 09:04:31

I'm working on android application and it should allow users to take photos using camera and the application reads the text and numbers in the photo.

我正在开发android应用程序,它应该允许用户使用摄像头拍照,应用程序读取照片中的文字和数字。

I don't know where to start from android studio. is there any good suggestion on github that could help me???

我不知道从安卓工作室开始。关于github有什么好的建议可以帮助我吗?

thanks in advance.

提前谢谢。

4 个解决方案

#1


9  

As others said OpenCV or OCR is the way to go. Google maintains one OCR library called as "Tesseract" (reminds me of Avengers :P). To make the job little easier there is a fork of Tesseract called as Tess-Two

就像其他人说的那样,OpenCV或OCR是最好的选择。谷歌有一个OCR库叫做“Tesseract”(让我想起复仇者:P)。为了使这一工作更容易一些,有一个叫tess - 2的分支

It combines some other useful tools like Leptonica (image processing library). Build instructions are given on the Readme file.

它结合了一些其他有用的工具,如Leptonica(图像处理库)。在Readme文件上给出了构建说明。

To get started you can check out very easy to use OCR library Easy OCR Library Android which uses Tess-Two under the hood.

开始的时候,你可以很容易地使用OCR库easy OCR库Android,它在后台使用tess - 2。

Again usage instructions are in the Readme file. It is already built so you don't need to build Tess-Two.

使用说明也在Readme文件中。它已经构建好了,所以不需要构建tess - 2。

#2


3  

You can try to use OpenCV library. Its abbreviature is Open Computer Vision Library. It has a reputation similar to OpenGL. There must be articles about yor issue in which library is ised. It can be linked static or dynamic using runtime application called OpenCV Manager (available in Google Play). You can use it both in Java and C++ code. Hope, it helps

您可以尝试使用OpenCV库。它的缩写是Open Computer Vision Library。它和OpenGL有着相似的名声。在图书馆里一定有关于你的问题的文章。它可以使用名为OpenCV管理器的运行时应用程序(在谷歌游戏中可用)来链接静态或动态。您可以在Java和c++代码中使用它。希望,它可以帮助

PS i have an own example of it use. https://github.com/androidovshchik/ProhibitingSignDetector

PS我有一个自己的例子。https://github.com/androidovshchik/ProhibitingSignDetector

#3


1  

i could give suggest about how i would do that if i needed to .

如果需要的话,我可以建议我该怎么做。

first of all you need to photo the picture only black and white .

首先,你需要只拍黑白照片。

then cheack the min black pixels in row that will define a letter .(you dont want any shadow to recognize as potential letter. try and learn progress (any camera have diffrent resulution so it need to be some % of the picture row pixels.)

然后将一行中定义字母的最小黑色像素(您不希望任何阴影识别为潜在的字母。尝试学习进展(任何相机都有不同的结果,所以它需要占图片行像素的百分比)。

after that evrey letter have diffrent shape so you need to do for loop 5 times in diffrent angel until you get to the third gap of black rows.

之后,evrey字母有不同的形状,所以你需要在不同的角度上做5次循环,直到你到达黑色行的第三个间隙。

after that some huge switch and if to get to the right letter need to do big research about the gap inside the letter proportion. to have a little dataBase could help if you wanted to get more then one font . again i not sure its the right way but that what i would do.

在那之后,一些巨大的转变和如果达到正确的字母需要做大的研究,关于字母比例内的差距。如果你想要得到更多的字体,拥有一个小的数据库可能会有所帮助。我也不确定这是正确的方法,但我要做的是。

have fun :)

玩得开心:)

#4


1  

You may try to find some Optical Character Recognition (OCR) library for Java

您可以尝试为Java找到一些光学字符识别(OCR)库

Check Java OCR, tess-two, Aprise. And explore * searching other OCR solutions.

检查Java OCR, tms - 2, Aprise。并探索*搜索其他OCR解决方案。

Implementing your own OCR lib may be very difficult so think is it really necessary for your task.

实现您自己的OCR库可能非常困难,所以考虑一下它对于您的任务是否真的必要。

#1


9  

As others said OpenCV or OCR is the way to go. Google maintains one OCR library called as "Tesseract" (reminds me of Avengers :P). To make the job little easier there is a fork of Tesseract called as Tess-Two

就像其他人说的那样,OpenCV或OCR是最好的选择。谷歌有一个OCR库叫做“Tesseract”(让我想起复仇者:P)。为了使这一工作更容易一些,有一个叫tess - 2的分支

It combines some other useful tools like Leptonica (image processing library). Build instructions are given on the Readme file.

它结合了一些其他有用的工具,如Leptonica(图像处理库)。在Readme文件上给出了构建说明。

To get started you can check out very easy to use OCR library Easy OCR Library Android which uses Tess-Two under the hood.

开始的时候,你可以很容易地使用OCR库easy OCR库Android,它在后台使用tess - 2。

Again usage instructions are in the Readme file. It is already built so you don't need to build Tess-Two.

使用说明也在Readme文件中。它已经构建好了,所以不需要构建tess - 2。

#2


3  

You can try to use OpenCV library. Its abbreviature is Open Computer Vision Library. It has a reputation similar to OpenGL. There must be articles about yor issue in which library is ised. It can be linked static or dynamic using runtime application called OpenCV Manager (available in Google Play). You can use it both in Java and C++ code. Hope, it helps

您可以尝试使用OpenCV库。它的缩写是Open Computer Vision Library。它和OpenGL有着相似的名声。在图书馆里一定有关于你的问题的文章。它可以使用名为OpenCV管理器的运行时应用程序(在谷歌游戏中可用)来链接静态或动态。您可以在Java和c++代码中使用它。希望,它可以帮助

PS i have an own example of it use. https://github.com/androidovshchik/ProhibitingSignDetector

PS我有一个自己的例子。https://github.com/androidovshchik/ProhibitingSignDetector

#3


1  

i could give suggest about how i would do that if i needed to .

如果需要的话,我可以建议我该怎么做。

first of all you need to photo the picture only black and white .

首先,你需要只拍黑白照片。

then cheack the min black pixels in row that will define a letter .(you dont want any shadow to recognize as potential letter. try and learn progress (any camera have diffrent resulution so it need to be some % of the picture row pixels.)

然后将一行中定义字母的最小黑色像素(您不希望任何阴影识别为潜在的字母。尝试学习进展(任何相机都有不同的结果,所以它需要占图片行像素的百分比)。

after that evrey letter have diffrent shape so you need to do for loop 5 times in diffrent angel until you get to the third gap of black rows.

之后,evrey字母有不同的形状,所以你需要在不同的角度上做5次循环,直到你到达黑色行的第三个间隙。

after that some huge switch and if to get to the right letter need to do big research about the gap inside the letter proportion. to have a little dataBase could help if you wanted to get more then one font . again i not sure its the right way but that what i would do.

在那之后,一些巨大的转变和如果达到正确的字母需要做大的研究,关于字母比例内的差距。如果你想要得到更多的字体,拥有一个小的数据库可能会有所帮助。我也不确定这是正确的方法,但我要做的是。

have fun :)

玩得开心:)

#4


1  

You may try to find some Optical Character Recognition (OCR) library for Java

您可以尝试为Java找到一些光学字符识别(OCR)库

Check Java OCR, tess-two, Aprise. And explore * searching other OCR solutions.

检查Java OCR, tms - 2, Aprise。并探索*搜索其他OCR解决方案。

Implementing your own OCR lib may be very difficult so think is it really necessary for your task.

实现您自己的OCR库可能非常困难,所以考虑一下它对于您的任务是否真的必要。