[英]OpenCV process all text to be black on white (segmentation)
是否有可能以某种方式使文档中的所有文本在阈值化后都是黑底白字。 我一直在网上寻找很多,但我一直无法找到解决方案。 我当前的阈值图像是: https : //i.ibb.co/Rpqcp7v/thresh.jpg
该文档需要由 OCR 读取,为此我需要将当前为黑底白字的区域反转。 我该怎么做呢? 我目前的代码:
# thresholding
def thresholding(image):
# thresholds the image into a binary image (black and white)
return cv2.threshold(image, 120, 255, cv2.THRESH_BINARY)[1]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.