7

我已经从 tesseract 中提取了一个图像文档,并且它已成功提取。但我无法理解提取文档的坐标。

问题描述: -

它显示坐标,但让我知道这些坐标代表像素或其他东西。它们有四个,如title="bbox 10 13 43 46",那么 10、13 43 和 46 是什么。它们代表什么位置

解压后完整代码

   <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name='ocr-system' content='tesseract'/>
</head>
<body>
<div class='ocr_page' id='page_1' title='image "D:\ABC.tif"; bbox 0 0 464 101'>
    <div class='ocr_carea' id='block_1_1' title="bbox 10 13 330 55">
    <p 1class='ocr_par'>
        <span class='ocr_line' id='line_1_1' title="bbox 10 13 330 55">
            <span class='ocr_word' id='word_1_1' title="bbox 10 13 43 46">
                <span class='ocrx_word' id='xword_1_1' title="x_wconf -1"><strong>hi</strong></span>
            </span> 
            <span class='ocr_word' id='word_1_2' title="bbox 148 13 268 47">
                <span class='ocrx_word' id='xword_1_2' title="x_wconf -1"><strong>whats</strong></span>
            </span> 
            <span class='ocr_word' id='word_1_3' title="bbox 283 22 330 55">
                <span class='ocrx_word' id='xword_1_3' title="x_wconf -1"><strong>up</strong></span>
            </span>
        </span>
    </p>
    </div>
</div>
</body>
</html>
4

3 回答 3

11

好吧,对于那些仍然想知道坐标系是如何工作的人来说,我终于找到了它,就像

10 13 43 46 startx, starty, endx, endy

如果你想找到单词的宽度和高度

宽度 = endx - startx,高度 = endy - starty

用''拆分字符串,然后消除bbox,然后就可以了..

于 2016-02-18T15:40:28.657 回答
7

也许这将有助于将来的某人。我认为图像不言自明。您可以根据这些值(例如高度 = y1-y0)计算高度或顶部距离(对于 css) 在此处输入图像描述

于 2018-03-14T17:16:33.110 回答
4

这些数字应该显示一个框(一个矩形)角的位置,其中有一个单词。

那就是hocr协议。

根据您的文档 tesseract 识别句子“hi whats up”

于 2013-08-31T17:18:10.533 回答