【发布时间】:2020-07-26 10:16:18
【问题描述】:
我正在尝试对我制作的图像进行去噪处理,以便使用 Tesseract 读取图像上的数字。 Noisy image. 有什么办法吗? 我对图像处理有点陌生。
【问题讨论】:
-
如果能提供原图/非二值化图片就更好了
标签: python python-imaging-library tesseract noise-reduction
我正在尝试对我制作的图像进行去噪处理,以便使用 Tesseract 读取图像上的数字。 Noisy image. 有什么办法吗? 我对图像处理有点陌生。
【问题讨论】:
标签: python python-imaging-library tesseract noise-reduction
你必须阅读 Python 枕头文档
Python 枕头文档链接: https://pillow.readthedocs.io/en/stable/
枕头图片模块: https://pillow.readthedocs.io/en/stable/reference/ImageFilter.html#module-PIL.ImageFilter
如何在 Python 中去除图像中的噪点? 均值滤波器用于模糊图像以去除噪声。它涉及确定 n x n 内核中像素值的平均值。然后将中心元素的像素强度替换为平均值。这消除了图像中的一些噪点并平滑了图像的边缘。
【讨论】:
MedianFilter 可能与给定的描述最相似。
from PIL import ImageFilter
im1 = im.filter(ImageFilter.BLUR)
im2 = im.filter(ImageFilter.MinFilter(3))
im3 = im.filter(ImageFilter.MinFilter)
【讨论】:
Pillow 库提供了可用于增强图像的ImageFilter 模块。根据文档:
ImageFilter 模块包含一组预定义过滤器的定义,可与
Image.filter()方法一起使用。
这些过滤器的工作原理是在图像上传递一个窗口或内核,并计算该框中像素的某些函数来修改像素(通常是中心像素)
MedianFilter 似乎被广泛使用,类似于 nishthaneeraj 的回答中给出的描述。
【讨论】: