gpt4 book ai didi

opencv - 如何使用 PIL 使图像中的文本更清晰?

转载 作者:太空宇宙 更新时间:2023-11-03 22:33:14 26 4
gpt4 key购买 nike

我正在使用 PIL、OpenCV 和 OCR 阅读器从图像中读取文本。我遇到的最大问题是涉及图像处理以使文本足够清晰,以便 OCR 阅读器更容易/准确地提取文本。

为此,我想增加对比度/亮度并使用 PIL 进行直方图均衡化,但这也无济于事。

那么,您建议如何使文本看起来更清晰,以便更好地提取文本?

最佳答案

太平船务有sharpen and edge enhancing filters .这是你想要的吗?显示您正在处理的内容的示例图像会有所帮助。

您的图像背景颜色不均匀,这可能会导致问题。尝试查看 this solution创建漂亮的水平黑白图像。

但是黑领也会引起问题,你应该想办法把它剪掉。

也就是说,我通过一个简单的 PIL SHARPEN 滤镜得到了合理的改进:

经过 SHARPEN 过滤器后的 tesseract 结果:

From what I've learned looking inside people, ^ I've decided human beings are somewhere ` between a hurricane and an ice cube} in some respects, permanently mysterious, but in others- with enough science and careful probingeentirely ' scrutabler It would be as foolish to think we have reached the limits of human knowledge as it is to 3 think we could ever know everything. There is still room enough to get better, to ask questions of i even the dead, to learn from knowing when our i simple certainties are wrong.

没有过滤器的结果:

From what I've learned lnnkmg wade maple} Fve deculed lunnuan wlng;. el'. .y.w.r-a' isbetween a luurrlctuvr null llva laAll.' a. I ll
respects, permanently unyst:-rwnt
Ml ln ms. re with enough scaena) and turutul pmlulng l~m.rely scrutable. It would he as loallsla to thank we have reached the llmlts of human knowledge as lt ls to think we could ever know everything. There ls still room enough to get better, to ask quesuons of ` even the dead, to learn from knowmg when our simple certeindes are wrong.

关于opencv - 如何使用 PIL 使图像中的文本更清晰?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15786012/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com