【问题标题】:How to identify numbers in low quality image using OpenCV?如何使用 OpenCV 识别低质量图像中的数字?
【发布时间】:2021-03-14 05:08:58
【问题描述】:

我需要使用 OpenCV 的 python 帮助将第一张图像转换为第二张图像。请帮我这样做!

示例输入

样本输出

【问题讨论】:

  • 您得到了答案,但仍然:您可以通过纯图像处理来解决这个问题,例如在 foo 循环中逐个像素地进行操作,如果像素值不是黑色的,则将其设为白色。

标签: python opencv image-processing image-enhancement


【解决方案1】:

使用此代码 -

import cv2  
img  = cv2.imread(r'image.png',1)  
retval, threshold = cv2.threshold(img, 20, 255, cv2.THRESH_BINARY)  
cv2.imshow("Threshold",threshold)  
cv2.waitKey(0)  

输出 -

【讨论】:

    猜你喜欢
    • 2020-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-17
    • 2012-07-06
    • 1970-01-01
    • 2021-06-16
    • 1970-01-01
    相关资源
    最近更新 更多