简体   繁体   中英

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

Tesseract library its a open source library. 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

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];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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