Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
609 views
in Technique[技术] by (71.8m points)

ocr - Text blocks positions and sizes detection in command line mode in tesseract

tesseract OCR have a command line interface, which allow us to recognize text from images with some parameters.

Input argumetns are imagename (path to image) outputbase (name of recognized text) and -psm pagesegmode parameters.

pagesegmode values are:
 0 = Orientation and script detection (OSD) only.
 1 = Automatic page segmentation with OSD.
 2 = Automatic page segmentation, but no OSD, or OCR
 3 = Fully automatic page segmentation, but no OSD. (Default)
 4 = Assume a single column of text of variable sizes.
 5 = Assume a single uniform block of vertically aligned text.
 6 = Assume a single uniform block of text.
 7 = Treat the image as a single text line.
 8 = Treat the image as a single word.
 9 = Treat the image as a single word in a circle.
 10 = Treat the image as a single character.
-l lang and/or -psm pagesegmode must occur before anyconfigfile.

But can it library write positions and sizes of recognized text blocks to the specific file or it is an internal information?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Tesseract 3.0x supports a "hocr" command option, which produces a HTML-format output file consisting of recognized words and their coordinates. It does not have size/font info, though.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...