【发布时间】:2016-05-09 09:21:14
【问题描述】:
我正在使用 tesseract 和 mcr.traineddata 从支票中读取 MICR 数字。 这是我要阅读的支票部分。
以下是从图片中检测到的部分文字。
我的问题是...... **如何从图像中排除特殊字符? 可以选择为特殊字符训练 tesseract 吗? **
除了特殊字符之外,其余的数字都被检测到了。
我的代码
let tesseract = G8Tesseract()
tesseract.language = "mcr"
tesseract.engineMode = .TesseractOnly
tesseract.pageSegmentationMode = .Auto
tesseract.maximumRecognitionTime = 60.0
imageView.image = imageView.image?.g8_grayScale()
imageView.image = imageView.image?.g8_blackAndWhite()
tesseract.image = imageView.image
tesseract.recognize()
【问题讨论】:
-
相反的想法呢?只接受想要的字符?
tesseract.charWhitelist = @"0123456789";来自github.com/gali8/Tesseract-OCR-iOS/wiki/Using-Tesseract-OCR-iOS ? -
@Larme ..... 它返回特殊字符作为 tesseract.charWhitelist 中给出的值之一............
标签: ios objective-c swift ocr tesseract