diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp index 81b2b720..61b7b390 100644 --- a/src/api/baseapi.cpp +++ b/src/api/baseapi.cpp @@ -1297,12 +1297,12 @@ char *TessBaseAPI::GetUTF8Text() { size_t TessBaseAPI::GetNumberOfTables() { - return constUniqueInstance>().size(); + return constUniqueInstance>().size(); } std::tuple TessBaseAPI::GetTableBoundingBox(unsigned i) { - const std::vector& t = constUniqueInstance>(); + const std::vector& t = constUniqueInstance>(); if(i >= t.size()) return std::tuple(0, 0, 0, 0); @@ -1317,7 +1317,7 @@ std::tuple TessBaseAPI::GetTableBoundingBox(unsigned i) std::vector> TessBaseAPI::GetTableRows(unsigned i) { - const std::vector& t = constUniqueInstance>(); + const std::vector& t = constUniqueInstance>(); if(i >= t.size()) return std::vector>(); @@ -1335,7 +1335,7 @@ std::vector> TessBaseAPI::GetTableRows(unsigned i) std::vector > TessBaseAPI::GetTableCols(unsigned i) { - const std::vector& t = constUniqueInstance>(); + const std::vector& t = constUniqueInstance>(); if(i >= t.size()) return std::vector>(); @@ -2120,7 +2120,7 @@ void TessBaseAPI::ClearResults() { paragraph_models_ = nullptr; } - uniqueInstance>().clear(); + uniqueInstance>().clear(); } /** diff --git a/src/ccstruct/tabletransfer.h b/src/ccstruct/tabletransfer.h index e8e96847..effeb2b9 100644 --- a/src/ccstruct/tabletransfer.h +++ b/src/ccstruct/tabletransfer.h @@ -1,9 +1,9 @@ /****************************************************************************** * File: tabletransfer.h * Description: Infrastructure for the transfer of table detection results - * Author: Sintun + * Author: Stefan Brechtken * - * (C) Copyright 2021, Sintun + * (C) Copyright 2021, Stefan Brechtken * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -22,9 +22,10 @@ #include #include "rect.h" +namespace tesseract { /// Structure for data transfer from table detector -struct MyTable { +struct TessTable { tesseract::TBOX box; std::vector rows; std::vector cols; @@ -60,4 +61,6 @@ const T& constUniqueInstance(std::unique_ptr new_instance = nullptr) return uniqueInstance(std::move(new_instance)); } +} // namespace tesseract + #endif // TESSERACT_CCSTRUCT_TABLETRANSFER_H_ diff --git a/src/textord/colfind.cpp b/src/textord/colfind.cpp index b0ae7e76..ab2a8c3e 100644 --- a/src/textord/colfind.cpp +++ b/src/textord/colfind.cpp @@ -1532,8 +1532,8 @@ void ColumnFinder::RotateAndReskewBlocks(bool input_is_rtl, TO_BLOCK_LIST *block tprintf("Block median size = (%d, %d)\n", block->median_size().x(), block->median_size().y()); } - std::vector& tables = uniqueInstance>(); - for(MyTable& mt: tables) + std::vector& tables = uniqueInstance>(); + for(TessTable& mt: tables) mt.box.rotate_large(reskew_); } diff --git a/src/textord/tablefind.cpp b/src/textord/tablefind.cpp index bd4de65c..ba017aaf 100644 --- a/src/textord/tablefind.cpp +++ b/src/textord/tablefind.cpp @@ -2018,8 +2018,8 @@ void TableFinder::MakeTableBlocks(ColPartitionGrid *grid, ColPartitionSet **all_ } #endif // GRAPHICS_DISABLED - std::vector& tables = uniqueInstance>(); - tables.push_back(MyTable{table_box, table_structure->getRows(), + std::vector& tables = uniqueInstance>(); + tables.push_back(TessTable{table_box, table_structure->getRows(), table_structure->getCols()}); delete table_structure;