diff --git a/src/ccmain/osdetect.cpp b/src/ccmain/osdetect.cpp index 7e4011415b..99a5362c01 100644 --- a/src/ccmain/osdetect.cpp +++ b/src/ccmain/osdetect.cpp @@ -193,11 +193,9 @@ static void remove_nontext_regions(tesseract::Tesseract *tess, int orientation_and_script_detection(const char* filename, OSResults* osr, tesseract::Tesseract* tess) { - STRING name = filename; //truncated name - const char *lastdot; //of name - TBOX page_box; + std::string name = filename; //truncated name - lastdot = strrchr(name.c_str(), '.'); + const char* lastdot = strrchr(name.c_str(), '.'); if (lastdot != nullptr) name[lastdot-name.c_str()] = '\0'; @@ -218,10 +216,7 @@ int orientation_and_script_detection(const char* filename, tess->mutable_textord()->find_components(tess->pix_binary(), &blocks, &port_blocks); } else { - page_box.set_left(0); - page_box.set_bottom(0); - page_box.set_right(width); - page_box.set_top(height); + TBOX page_box(0, 0, width, height); // Filter_blobs sets up the TO_BLOCKs the same as find_components does. tess->mutable_textord()->filter_blobs(page_box.topright(), &port_blocks, true); diff --git a/src/ccmain/pagesegmain.cpp b/src/ccmain/pagesegmain.cpp index 4304427a92..d3a32fabfb 100644 --- a/src/ccmain/pagesegmain.cpp +++ b/src/ccmain/pagesegmain.cpp @@ -109,7 +109,7 @@ int Tesseract::SegmentPage(const char* input_file, BLOCK_LIST* blocks, // If a UNLV zone file can be found, use that instead of segmentation. if (!PSM_COL_FIND_ENABLED(pageseg_mode) && input_file != nullptr && input_file[0] != '\0') { - STRING name = input_file; + std::string name = input_file; const char* lastdot = strrchr(name.c_str(), '.'); if (lastdot != nullptr) name[lastdot - name.c_str()] = '\0'; diff --git a/src/ccstruct/blread.cpp b/src/ccstruct/blread.cpp index 507439a059..8854d91577 100644 --- a/src/ccstruct/blread.cpp +++ b/src/ccstruct/blread.cpp @@ -34,10 +34,10 @@ namespace tesseract { **********************************************************************/ bool read_unlv_file( //print list of sides - STRING name, //basename of file - int32_t xsize, //image size - int32_t ysize, //image size - BLOCK_LIST *blocks //output list + std::string& name, //basename of file + int32_t xsize, //image size + int32_t ysize, //image size + BLOCK_LIST* blocks //output list ) { FILE *pdfp; //file pointer BLOCK *block; //current block diff --git a/src/ccstruct/blread.h b/src/ccstruct/blread.h index 9a6daa484e..ea2e4264ba 100644 --- a/src/ccstruct/blread.h +++ b/src/ccstruct/blread.h @@ -2,7 +2,6 @@ * File: blread.h (Formerly pdread.h) * Description: Friend function of BLOCK to read the uscan pd file. * Author: Ray Smith - * Created: Mon Mar 18 14:39:00 GMT 1991 * * (C) Copyright 1991, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,21 +19,21 @@ #ifndef BLREAD_H #define BLREAD_H -#include "strngs.h" // for STRING - #include // for int32_t +#include // for std::string namespace tesseract { class BLOCK_LIST; bool read_unlv_file( //print list of sides - STRING name, //basename of file - int32_t xsize, //image size - int32_t ysize, //image size - BLOCK_LIST *blocks //output list + std::string& name, //basename of file + int32_t xsize, //image size + int32_t ysize, //image size + BLOCK_LIST* blocks //output list ); -void FullPageBlock(int width, int height, BLOCK_LIST *blocks); + +void FullPageBlock(int width, int height, BLOCK_LIST* blocks); } // namespace tesseract