如何使用OpenCV的+的tesseract在Android的准确的文字识别? [英] How to use OpenCV+Tesseract for accurate Text recognition in Android?

查看:2143
本文介绍了如何使用OpenCV的+的tesseract在Android的准确的文字识别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用的OpenCV(安卓),用于处理利用相机拍摄,然后把它传递给的tesseract的文本图像(位)的认可,但我没有得到,直到图像好成绩是非常(几乎没有噪音)的罚款。 目前,我在执行以下处理上拍摄的图像为: 1.应用高斯模糊。 2.自适应阈值:二值化图像。 3.反相颜色,使背景的黑色。 然后使经处理的图像,以的tesseract

I am trying to use OpenCV (Android) for processing image taken using camera and then pass it to Tesseract for text (digits) recognition but am not getting good results till the images are very (almost no noise) fine. Currently I am performing below processing on taken images as: 1. Applying Gaussian blur. 2. Adaptive threshold: to binarize the image. 3. Inverting colours to make background black. Then passing the processed image to Tesseract.

但我没有得到较好的效果。

But I am not getting good results.

请建议具体步骤/方法我可能需要进一步传递到的tesseract或阶段,而在处理的tesseract之前处理图像。

Please suggest what steps/measures I may take further to process image before passing to Tesseract or at stage while processing at Tesseract.

此外,是否有这个在Android的任何其他更好的库?

Also, are there any other better libraries in Android for this?

推荐答案

您可以隔离/检​​测字符图像。这可以通过强大的算法来完成,如笔划宽度变换

You can isolate/detect characters in images. This can be done with powerful algorithms such as the Stroke Width Transform.

下面的步骤,我的工作还有:

The following steps worked well with me:

  1. 获取图像的灰度。
  2. 执行的灰度图像Canny边缘检测
  3. 在应用高斯模糊的灰度图像(存储在单独的矩阵)
  4. 从步骤2和输入矩阵; 3成 SWT 算法
  5. 在二值化(门限)得到的图像。
  6. 饲料形象的tesseract。
  1. Obtain grayscale of image.
  2. Perform canny edge detection on grayscale image.
  3. Apply gaussian blur on grayscale image(store in seperate matrix)
  4. Input matrices from steps 2 & 3 into SWT algorithm
  5. Binarize(threshhold) resulting image.
  6. Feed image to tesseract.

请注意,对于第4步,您将需要建立链接C ++库,然后导入到你的Andr​​oid项目的 JNI 的包装。此外,你需要做的微调整的所有步骤,以获得最好的效果。但是,这至少应该让你开始。

Please note, for step 4 you will need to build the c++ library in the link and then import into your android project with JNI wrappers. Also, you will need to do micro tweaking for all steps to get the best results. But, this should at least get you started.

这篇关于如何使用OpenCV的+的tesseract在Android的准确的文字识别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆