简体   繁体   English

在OCR之前检查图像质量

[英]Check image quality before OCR

I have android application that perform OCR on documents. 我有android应用程序在文档上执行OCR。 I want to be able to make some test on the image before sending it to the server. 我希望能够在将图像发送到服务器之前对图像进行一些测试。 so my question is if there's any tool/code available to measure the image focus before I send it to the server. 所以我的问题是,在将图像焦点发送到服务器之前,是否有任何工具/代码可用于测量图像焦点。 I want to be able to know if the image not in focus(not sharp enough), to save the processing time from the server side and not to sent it. 我希望能够知道图像是否没有聚焦(不够清晰),以节省服务器端的处理时间而不是发送它。 Thank's David 谢谢大卫

David, that is a good question. 大卫,这是一个很好的问题。 Please share your findings for all of us as you collect more feedback. 当您收集更多反馈时,请与我们所有人分享您的发现。

I have used and have seen several techniques for this important step in processing. 我已经使用过并且已经看到了处理这一重要步骤的几种技术。 Reality is that it is MUCH easier to have user take a good picture, than to detect or correct a bed picture, which in many cases not even possible. 现实是,让用户拍出好照片比检测或校正床上图片更容易,在许多情况下甚至不可能。 So detection is nice to have, but that should not be the first action. 所以检测很好,但这不应该是第一个动作。 There are so many options that can be triggered before image check, and I'll list a few below. 在图像检查之前可以触发很多选项,我将在下面列出几个。

Techniques (technical and non-technical) that worked for me in the past, or worked for people I worked with or heard of: 技术(技术和非技术)过去对我有用,或者为我工作或听过的人工作过:

  • Shake detection. 摇动检测。 Using the acceleration of the device to check for shaking at the time of taking the picture. 使用设备的加速度来检查拍照时的晃动。 Good approach, but works mostly in bright lighting. 很好的方法,但主要在明亮的灯光下工作。 In dark environment, even with minimal shaking, picture can be easily smudged. 在黑暗的环境中,即使摇晃很少,照片也很容易弄脏。 This method has to be used in combination with other methods. 该方法必须与其他方法结合使用。

  • Binarization on device. 设备上的二值化。 Not only it allows you to compress and prepare the image for efficient transmission, it allows you to clearly see the quality of text. 它不仅可以让您压缩和准备图像以实现高效传输,还可以让您清楚地看到文本的质量。 Looking at color image with dark backgrounds is not as obvious about sharpness of individual characters as looking at black-and-white edges of those characters. 观察具有深色背景的彩色图像并不像单个字符的黑白边缘那样关注单个字符的清晰度。

  • Preview screen. 预览屏幕。 Allow the user to see the picture they took and are about to submit. 允许用户查看他们拍摄的照片并即将提交。 Frequently I see apps that allow to preview the picture, but have zoom disabled when I double-tap on it. 我经常看到允许预览图片的应用程序,但是当我双击它时会禁用缩放。 Any text (even if it is bad) will look good on a tiny screen, because you cannot actually see the text. 任何文本(即使它都很糟糕)在小屏幕上看起来都不错,因为你实际上看不到文字。

  • I call it 'forced preview'. 我称之为'强制预览'。 After taking the picture, and preferably after binarization, automatically zoom 10x and ask the user to confirm if they see sharp text or not. 拍摄照片后,最好在二值化后,自动缩放10倍并要求用户确认是否看到清晰的文字。 It seems invasive, so a good design is important here, but this method is reliable because it can be made as a required step. 它似乎是侵入性的,所以一个好的设计在这里很重要,但这种方法是可靠的,因为它可以作为一个必要的步骤。

  • Simple guided instructions on... How to take good pictures! 简单的指导说明......如何拍好照片! Some apps show ti once at firstrun. 一些应用程序在第一次显示ti。 Some apps give you chance to disable. 一些应用程序让您有机会禁用。 In my apps, I have seen a substantial increase in quality after providing these instructions after update of my app FotoNote on iOS. 在我的应用程序中,我在iOS上更新了我的应用程序FotoNote之后提供了这些说明,我看到了质量的大幅提升。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM