python 图片 变清晰_如何使用OpenCV的处理图像,文字变得锐利和清晰?

本文介绍了如何使用OpenCV库来处理图像,使其变得更为清晰,减少噪点,以提高OCR识别效果。尝试了高斯模糊、自适应阈值和中值滤波等方法,发现中值滤波配合Otsu二值化在某些图像上能取得较好的效果。对于计算机屏幕截图,高斯模糊可能稍优,但参数调整仍然关键。
摘要由CSDN通过智能技术生成

1586010002-jmsa.png

While searching for solutions, most of the answers were general instructions such as advise to look at adaptive filter, gaussian blur, dilation and erosion but none of them provide any sample code to start with (so can play around with the values)..

I know different image require different methods and values to achieve optimum clarity, but I just need some general filter so that the image at least slightly sharper and less noisy compare to the original, before doing any OCR on it.

this is what I've tried so far..

Mat imageMat = new Mat();

Utils.bitmapToMat(photo, imageMat);

Imgproc.cvtColor(imageMat, imageMat, Imgproc.COLOR_BGR2GRAY);

Imgproc.GaussianBlur(imageMat, imageMat, new Size(3, 3), 0);

Imgproc.adaptiveThreshold(imageMat, imageMat, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY_INV, 5,

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值