【发布时间】:2014-12-21 16:09:05
【问题描述】:
我尝试构建一个可以扫描汽车 vin 号的 iOS 应用。我在扫描的准确性方面遇到了一些问题。
我使用 opencv 来查找文本的轮廓/边界框,到目前为止我得到了这个结果:
如您所见,我在找到文本框方面取得了很好的效果,并且在将图像发送到 tesseract 之前,我正在根据绿框裁剪图像。
Tesseract 然而并没有给出好的结果。有时我得到正确的文字,有时它给了我别的东西。
我使用来自以下 Pod 的 tesseract 3.03:https://github.com/kevincon/Tesseract-OCR-iOS/tree/tesseract3.03
我使用默认的英语培训字典,并设置 Tesseract,如下所示:
tesseract = [[Tesseract alloc] initWithLanguage:@"eng"];
[tesseract setVariableValue:@" 0123456789ABCDEFGHJKLMNPQRSTUVWXYZ" forKey:@"tessedit_char_whitelist"];
[tesseract setVariableValue:@"language_model_penalty_non_freq_dict_word" forKey:@"0"];
[tesseract setVariableValue:@"language_model_penalty_non_dict_word" forKey:@"0"];
[tesseract setVariableValue:@"load_system_dawg" forKey:@"0"];
[tesseract setVariableValue:@"load_freq_dawg" forKey:@"0"];
关于如何提高此扫描的准确性的任何想法?
更新 1: 我的下一步将是创建训练数据。我将尝试使用此图像: https://dl.dropboxusercontent.com/u/63179/ocr/traindoc.jpg 我使用的是 helvetica neue regular 字体,因为它看起来很相似。我知道我的文本只会包含数字和大写字符。
【问题讨论】:
标签: ios objective-c opencv ocr tesseract