我在IOS中实现了Tesseract OCR进行文本识别。我预处理了输入图像并将其送入Tesseract方法中,但结果很差。
步骤:
1.腐蚀函数
2.膨胀函数
3.按位非函数
Mat MCRregion;
cv::dilate ( MCRregion, MCRregion, 24);
cv::erode ( MCRregion, MCRregion, 24);
cv::bitwise_not(MCRregion, MCRregion);
UIImage * croppedMCRregion = [self UIImageFromCVMat:MCRregion];
Tesseract* tesseract = [[Tesseract alloc] initWithDataPath:@"tessdata" language:@"eng"];
[tesseract setVariableValue:@"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.>,'`;-:</" forKey:@"tessedit_char_whitelist"];
[tesseract setImage:[self UIImageFromCVMat:MCRregion]];
// [tesseract setImage:image];
[tesseract recognize];
NSLog(@"%@", [tesseract recognizedText]);
输入图像:
1.如何使用Tesseract提高文本识别率?
2.Tesseract中是否还应用了其他预处理步骤?
3.Tesseract OCR是否完成了文本去曲变?