mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-11 20:53:24 +08:00
Fix text box width/hight calculation
In Tesseract's coordinate system, width is just right - left, cf. slide #2 of github.com/tesseract-ocr/docs/blob/master/das_tutorial2016/2ArchitectureAndDataStructures.pdf
This commit is contained in:
parent
86acff5a03
commit
29d971eb0c
@ -1431,8 +1431,8 @@ static void AddBoxToTSV(const PageIterator *it,
|
||||
it->BoundingBox(level, &left, &top, &right, &bottom);
|
||||
hocr_str->add_str_int("\t", left);
|
||||
hocr_str->add_str_int("\t", top);
|
||||
hocr_str->add_str_int("\t", right - left + 1);
|
||||
hocr_str->add_str_int("\t", bottom - top + 1);
|
||||
hocr_str->add_str_int("\t", right - left);
|
||||
hocr_str->add_str_int("\t", bottom - top);
|
||||
}
|
||||
|
||||
|
||||
|
@ -196,7 +196,7 @@ bool TessHOcrRenderer::AddImageHandler(TessBaseAPI* api) {
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* HOcr Text Renderer interface implementation
|
||||
* TSV Text Renderer interface implementation
|
||||
**********************************************************************/
|
||||
TessTsvRenderer::TessTsvRenderer(const char *outputbase)
|
||||
: TessResultRenderer(outputbase, "tsv") {
|
||||
|
Loading…
Reference in New Issue
Block a user