建议过滤器以提高照片上的文本可见性 [英] Advise filters to improve text visibility on photo

查看:132
本文介绍了建议过滤器以提高照片上的文本可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要过滤器来提高照片上的文字可见性,因为它有一些噪音。您知道哪种过滤器(算法)用于此目的?



现在,我使用单色滤镜,但它不会提高图像质量。我需要过滤可以确定小区域的中等背景,并根据中等背景使图像单色。



例如,几乎所有图片背景都是白色和灰色字符,但有些区域有较暗的颜色(灰色)和黑色字符。我需要算法可以理解图像的某些区域更暗,并使黑色接受程度更低。




例如,源图像:
< a href =https://i.stack.imgur.com/YJ4XC.jpg =nofollow noreferrer>

和处理后的照片(中位数,单色滤镜)

解决方案

不幸的是,我无法在代码中使用图像处理软件包提供准确而快速的答案,但我可以根据Photoshop中的一些非常快速的测试提供一些提示(对不起,视觉思想家,慢打字员)。在最坏的情况下,您可以从Matlab运行



不完美,但它说明了取消一点强烈渐变的想法。



在生成的图像中,我应用了等级:






之后,高通:





您可以使用高通结果并将其与上一步混合(叠加),这将强调细节:





然后应用邮票过滤器(混合物小高斯模糊+阈值):





甚至更简单,在高通结果上,再次应用曲线或阈值:






这个想法是阈值应该处理最后阶段的分割,你需要通过取消与文本本身无关的元素(如像渐变的闪光灯)来尽可能简单地完成工作。
如果你需要稍后清理小点,形态过滤器(如腐蚀,然后扩张)应该有所帮助。您还可以在检测渐变上找到一些信息。


I need filters to improve text visibility on photo, since it has some noise. Which filters (algorithms) do you know for this purpose?

Now, I use monochrome filter but it doesn't improve image quality. I need to filter can determine medium background of little area and make image monochrome depending on medium background.

For example almost all picture background is white and grey characters but some areas has darker color (grey) and black characters. I need to algorithm can understand that some area of image more darker and make level of black accepting lower.


For example, source image:
And processed photo (median, monochrome filters)

解决方案

Unfortunately I'm not able to provide an accurate and fast answer using an image processing package in code, but I can provide some hints based on some really quick tests done in Photoshop(sorry, visual thinker, slow typist). Worst case scenario, you can run Photoshop filters from Matlab, but the filters are used should be available or not to difficult to implement since I've constraint myself to:

  • Curves
  • Levels
  • High Pass

In simple terms, I recommend first getting read of the gradient dark to bright gradient: it will be easier to play with contrast/threshold on a more even image. In Photoshop I applied curves (which other people wondered about implementing in code)

Not perfect, but it illustrates the idea of cancelling out a bit of that strong gradient.

On the resulting image I applied levels:

Afterwards, a high pass:

You can use the high pass result and blend it (overlay) with the previous step which will emphasize the details:

then apply a stamp filter (a mixture of small Gaussian blur + threshold):

or even simpler, on the high pass result, apply curves again or threshold:

The idea is threshold should deal with the segmentation at the last stage and you need to make it's job as easy as possible by cancelling out elements not pertaining to the text itself (like the flash light like gradient). If you need to cleanup small dots later, morphological filter (like erode, then dilate) should help. You can also find some info on detecting gradients as well.

这篇关于建议过滤器以提高照片上的文本可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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