简体   繁体   English

如何通过使用OCR的可识别文本从名片上的字体大小获取识别文本的字体大小以识别名称:iPhone

[英]How to get font sizes of recognized text to Recognize Name using font size on the Business Card form the Recognized text using OCR: iPhone

I have implemented Business Card Reader App for iPhone using OCR by 我已经使用OCR通过iPhone实现了Business Card Reader App。

Tesseract library its a open source library. Tesseract库是一个开源库。 Api API

The main agenda is when the text is recognized from the business card. 主要议程是何时从名片中识别文本。 I need to pass the Name and Email address and Phone numer to the corresponding fields. 我需要将名称和电子邮件地址以及电话号码传递到相应的字段。

i did it for email address and phone numbers using their formats of expressions. 用他们的表达式格式来做电子邮件地址和电话号码。

but in case of NAME some other texts having the same formats , so we can pick it up using font size 但如果是NAME,则其他一些文本具有相同的格式 ,因此我们可以使用字体大小来选择它

How to get font sizes of recognized text to Recognize Name using font size on the Business Card form the Recognized text using OCR...?

Just try this - 试试这个-

UIFont *font = totalLabel.font;
CGFloat maxHeight = font.lineHeight * totalLabel.numberOfLines;
CGFloat maxWidth = totalLabel.frame.size.width;
CGSize size = [totalLabel.text sizeWithFont:font constrainedToSize:(CGSize){maxWidth, maxHeight} lineBreakMode:totalLabel.lineBreakMode];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM