如何在OpenCV中实现去斑?
如果在对比度较差的图像上进行直方图均衡化,则其特征会变得更加明显。然而,也存在大量的颗粒/斑点/噪声。使用 OpenCV 中已有的模糊功能是不可取的 - 我稍后将对图像进行文本检测,并且字母将变得无法识别。 那么应该应用哪些预处理技术呢?
If histogram equalization is done on a poorly-contrasted image then its features become more visible. However there is also a large amount of grains/speckles/noise. using blurring functions already available in OpenCV is not desirable - i'll be doing text-detection on the image later on and the letters will get unrecognizable.
So what are the preprocessing techniques that should be applied?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将图像与内核进行卷积的标准模糊技术(例如高斯模糊、盒式滤波器等)充当低通滤波器并扭曲高频文本。如果您还没有这样做,请尝试
cv::bilingualFilter()
或cv::medianBlur()
。如果这些算法都不起作用,您应该考虑其他边缘保留平滑算法。如果将图像想象为三维空间,传统的滤波会将每个像素的值替换为以该像素为中心的圆圈中所有滤波器的加权平均值。双边过滤的作用相同,但使用以像素为中心的三维球体。由于定义明确的边缘看起来像高原,因此球体仅包含一个点,并且像素值保持不变。您可以获得双边过滤器的更详细说明和一些示例输出
Standard blur techniques that convolve the image with a kernel (e.g. Gaussian blur, box filter, etc) act as a low-pass filter and distort the high-frequency text. If you have not done so already, try
cv::bilateralFilter()
orcv::medianBlur()
. If neither of these algorithms work, you should look into other edge-preserving smoothing algorithms.If you imagine the image as a three-dimensional space, traditional filtering replaces the value of each pixel with the weighted average of all filters in a circle centered around the pixel. Bilateral filtering does the same, but uses a three-dimensional sphere centered at the pixel. Since a well-defined edge looks like a plateau, the sphere contains only one point and the pixel value remains unchanged. You can get a more detailed explanation of the bilateral filter and some sample output here.