在OpenCV中,如何预处理图像以获得更好的阈值结果?我的输入图片是
我正在使用各种阈值方法,如:
修改
应用CLAHE (Contrast Limited Adaptive Histogram Equalization)
会显着降低噪音量,但提取的文字仍然模糊不清。有没有办法让文字更加清晰"?
clahe = cv2.createCLAHE(clipLimit=1.0, tileGridSize=(3,3))
inputImage = clahe.apply(inputImage)
END OF EDIT
invertRet, invertColors = cv2.threshold(inputImage,127,255,cv2.THRESH_BINARY_INV)
gaussianThreshold = cv2.adaptiveThreshold(inputImage, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV, 11, 2)
adaptiveMean = cv2.adaptiveThreshold(inputImage, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY_INV, 11, 2)
otsuRet, otsu = cv2.threshold(inputImage,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)
但它们都显示出很多噪音: