【发布时间】:2020-11-16 08:16:31
【问题描述】:
我正在编写一个脚本来从问题图像中提取文本,如下所示,使用tesseract。但我说的是每天 1000-10000 张图像,因此手动应用这些方法是不可行的。是否有可能我可以对所有图像应用一些一般性的东西?
这张图片是为了展示图片的质量,而不是手写。
所以这张图片有一些噪点、模糊等等。我已经用过otsu thresholding 和closing。对于我可以对每张图像安全地使用的预处理功能,还应该有哪些其他方法,这样它就不会损害高质量的图像,而是改善低质量的图像。
换句话说,我可以对每张图片使用sharpening kernel 吗?如果是,应该是什么平均(最小安全)过滤器大小/值,这样它才不会损害高质量的图像
sharpen_kernel_choice1 = np.array([[-1,-1,-1], [-1,9,-1], [-1,-1,-1]])
sharpen_kernel_choise2 = np.array[[0,-1,0], [-1,9,-1], [0,-1,0]]
我也在考虑使用Wiener Filter,例如,它可以对图像进行去模糊处理,
psf = np.ones((5, 5)) / 25 # what should be a safe kernel size
img = convolve2d(img, psf, 'same')
img += 0.1 * img.std() * np.random.standard_normal(img.shape) # what should be this value?
deconvolved_img = restoration.unsupervised_wiener(img, psf)
【问题讨论】:
-
您可以在阈值化之前尝试自适应直方图均衡化 (CLAHE)
标签: opencv image-processing deep-learning computer-vision scikit-image