ios - 如何排除 tesseract 中的特殊字符?

标签 ios objective-c swift ocr tesseract

我正在使用 tesseract 和 mcr.traineddata 从支票中读取 MICR 号码。 这是我想阅读的支票的一部分。

enter image description here

下面是从图像中检测到的文本部分。

enter image description here

我的问题是...... **如何从图像中排除特殊字符? 可以选择为特殊字符训练 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()

最佳答案

我创建了一个新的训练数据文件 (my.traineddata)。我训练了特殊字符以识别为“X”。我们使用的图像越多,经过训练的数据文件就越准确。然后我们可以相应地操作识别出的文本。

关于ios - 如何排除 tesseract 中的特殊字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37111985/

相关文章:

ios - FaSTLane 扫描显示零单元测试

ios - xamarin Ios 将 UIView 添加到 ContainerView

objective-c - stringByTrimmingCharactersInSet : is not removing characters in the middle of the string

ios - CoreData保存对象不成功

swift - 使用 Swift 从 firebase 数据库读取

swift - 如何从 UIAlertController 的 UIAlertAction 处理程序中关闭 UIViewController?

iphone - QRCode在ios中编码一个简单的字符串

ios - 我可以获得已安装的 iOS 应用程序的 UUID 吗?

ios - 在没有 UserInteraction 的情况下按下 ScrollView 中的按钮

swift - GameplayKit GKGoal : can't get wandering to work