HOCR
≈ 2 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
hOCR is an open standard of data representation for formatted text obtained from optical character recognition (OCR). The definition encodes text, style, layout information, recognition confidence metrics and other information using Extensible Markup Language (XML) in the form of Hypertext Markup Language (HTML) or XHTML.
hOCR is an open standard of data representation for formatted text obtained from optical character recognition (OCR). The definition encodes text, style, layout information, recognition confidence metrics and other information using Extensible Markup Language (XML) in the form of Hypertext Markup Language (HTML) or XHTML. ==Software== The following OCR software can output the recognition result as hOCR file: OCRopus Tesseract Cuneiform ghostscript HebOCR gcv2hocr gImageReader ==Example== The following example is an extract of an hOCR file: ... Die Darlehenssumme ist in ihrem ursprünglichen Umfange zu ver- ... The recognized text is stored in normal text nodes of the HTML file. The distribution into separate lines and words is here given by the surrounding span tags. Moreover, the usual HTML entities are used, for example the p tag for a paragraph. Additional information is given in the properties such as: different layout elements such as "ocr_par", "ocr_line", "ocrx_word" geometric information for each element with a bounding box "bbox" language information "lang" some confidence values "x_wconf" property-name = "bbox" property-value = uint uint uint uint the order of the values are x0 y0 x1 y1 = "left top right bottom" … The bounding box bbox of this line is shown in blue and it is span by the upper-left corner (10, 20) and the lower-right corner (160, 30). All coordinates are measured with reference to the top-left corner of the document image which border is drawn in black. from HocrConverter import HocrConverter hocr = HocrConverter("myHocrFile.html") # this can be done by changing .hocr to .html and vice versa hocr.to_text("output.txt") hocr.to_pdf("myImageFile.png", "output.pdf") ==See also== ALTO (XML) — another OCR data representation format ==References== ==External links== The hOCR Specification for depth about hOCR. specification of current version (1.2 as of February 2021)
Text derived from https://en.wikipedia.org/w/index.php?oldid=1375275925 under CC BY-SA 4.0; modifications have been made.