mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 12:49:35 +08:00
Remove whitespace at line endings
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
b95598a0b1
commit
b3bd23edb7
@ -41,7 +41,7 @@ all languages).
|
||||
You need an Internet connection and [curl](https://curl.haxx.se/) to compile `ScrollView.jar`
|
||||
because the build will automatically download
|
||||
[piccolo2d-core-3.0.jar](http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0/piccolo2d-core-3.0.jar > piccolo2d-core-3.0.jar) and
|
||||
[piccolo2d-extras-3.0.jar](http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0/piccolo2d-extras-3.0.jar) and
|
||||
[piccolo2d-extras-3.0.jar](http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0/piccolo2d-extras-3.0.jar) and
|
||||
[jaxb-api-2.3.1.jar](http://search.maven.org/remotecontent?filepath=javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar) and place them to `tesseract/java`.
|
||||
|
||||
Just run:
|
||||
|
@ -613,7 +613,7 @@ class TESS_API TessBaseAPI {
|
||||
* Returned string must be freed with the delete [] operator.
|
||||
*/
|
||||
char* GetTSVText(int page_number);
|
||||
|
||||
|
||||
/**
|
||||
* Make a box file for LSTM training from the internal data structures.
|
||||
* Constructs coordinates in the original image - not just the rectangle.
|
||||
@ -630,7 +630,7 @@ class TESS_API TessBaseAPI {
|
||||
* Returned string must be freed with the delete [] operator.
|
||||
*/
|
||||
char* GetBoxText(int page_number);
|
||||
|
||||
|
||||
/**
|
||||
* The recognized text is returned as a char* which is coded in the same
|
||||
* format as a WordStr box file used in training.
|
||||
@ -638,7 +638,7 @@ class TESS_API TessBaseAPI {
|
||||
* Returned string must be freed with the delete [] operator.
|
||||
*/
|
||||
char* GetWordStrBoxText(int page_number);
|
||||
|
||||
|
||||
/**
|
||||
* The recognized text is returned as a char* which is coded
|
||||
* as UNLV format Latin-1 with specific reject and suspect codes.
|
||||
|
@ -27,15 +27,15 @@ namespace tesseract {
|
||||
* page_number is a 0-base page index that will appear in the box file.
|
||||
* Returned string must be freed with the delete [] operator.
|
||||
*/
|
||||
static void AddBoxToLSTM(int right, int bottom, int top,
|
||||
static void AddBoxToLSTM(int right, int bottom, int top,
|
||||
int image_height_, int page_num,
|
||||
STRING* text) {
|
||||
text->add_str_int(" ", image_height_ - bottom);
|
||||
text->add_str_int(" ", right + 5);
|
||||
text->add_str_int(" ", image_height_ - top);
|
||||
text->add_str_int(" ", page_num);
|
||||
text->add_str_int(" ", page_num);
|
||||
}
|
||||
|
||||
|
||||
char* TessBaseAPI::GetLSTMBOXText(int page_number) {
|
||||
if (tesseract_ == nullptr || (page_res_ == nullptr && Recognize(nullptr) < 0))
|
||||
return nullptr;
|
||||
@ -44,7 +44,7 @@ char* TessBaseAPI::GetLSTMBOXText(int page_number) {
|
||||
int page_num = page_number;
|
||||
bool first_word = true;
|
||||
int left, top, right, bottom;
|
||||
|
||||
|
||||
LTRResultIterator* res_it = GetLTRIterator();
|
||||
while (!res_it->Empty(RIL_BLOCK)) {
|
||||
if (res_it->Empty(RIL_SYMBOL)) {
|
||||
|
@ -537,7 +537,7 @@ static void PreloadRenderers(
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
api->GetBoolVariable("tessedit_create_txt", &b);
|
||||
if (b || (!error && renderers->empty())) {
|
||||
tesseract::TessTextRenderer* renderer =
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Description: Beam search to decode from the re-encoded CJK as a sequence of
|
||||
// smaller numbers in place of a single large code.
|
||||
// Author: Ray Smith
|
||||
// Created: Fri Mar 13 09:12:01 PDT 2015
|
||||
//
|
||||
// (C) Copyright 2015, Google Inc.
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -210,8 +209,8 @@ class RecodeBeamSearch {
|
||||
|
||||
// Generates debug output of the content of the beams after a Decode.
|
||||
void DebugBeams(const UNICHARSET& unicharset) const;
|
||||
|
||||
// Stores the alternative characters of every timestep together with their
|
||||
|
||||
// Stores the alternative characters of every timestep together with their
|
||||
// probability.
|
||||
std::vector< std::vector<std::pair<const char*, float>>> timesteps;
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Description: Class to hold BLOBNBOXs in a grid for fast access
|
||||
// to neighbours.
|
||||
// Author: Ray Smith
|
||||
// Created: Wed Jun 06 17:22:01 PDT 2007
|
||||
//
|
||||
// (C) Copyright 2007, Google Inc.
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -926,7 +925,7 @@ void ColumnFinder::ComputeMeanColumnGap(bool any_multi_column) {
|
||||
&gap_samples);
|
||||
}
|
||||
mean_column_gap_ = any_multi_column && gap_samples > 0
|
||||
? total_gap / gap_samples : width_samples > 0
|
||||
? total_gap / gap_samples : width_samples > 0
|
||||
? total_width / width_samples : 0;
|
||||
}
|
||||
|
||||
|
@ -29,11 +29,11 @@ echo -e "USAGE: tesstrain.sh
|
||||
--maxpages # Specify maximum pages to output (default:0=all)
|
||||
--save_box_tiff # Save box/tiff pairs along with lstmf files.
|
||||
--xsize # Specify width of output image (default:3600)
|
||||
|
||||
|
||||
OPTIONAL flag for specifying directory with user specified box/tiff pairs.
|
||||
Files should be named similar to ${LANG_CODE}.${fontname}.exp${EXPOSURE}.box/tif
|
||||
--my_boxtiff_dir MY_BOXTIFF_DIR # Location of user specified box/tiff files.
|
||||
|
||||
|
||||
OPTIONAL flags for input data. If unspecified we will look for them in
|
||||
the langdata_dir directory.
|
||||
--training_text TEXTFILE # Text to render and use for training.
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
// Generating the training data:
|
||||
// If the format of the lstmf (ImageData) file changes, the training data will
|
||||
// have to be regenerated as follows:
|
||||
// have to be regenerated as follows:
|
||||
//
|
||||
// Use --xsize 800 for text2image to be similar to original training data.
|
||||
//
|
||||
|
@ -58,7 +58,7 @@ class LSTMTrainerTest : public testing::Test {
|
||||
return file::JoinPath(TESTING_DIR,
|
||||
"" + name);
|
||||
}
|
||||
|
||||
|
||||
void SetupTrainerEng(const std::string& network_spec, const std::string& model_name,
|
||||
bool recode, bool adam) {
|
||||
SetupTrainer(network_spec, model_name, "eng/eng.unicharset",
|
||||
|
@ -235,7 +235,7 @@ class ResultIteratorTest : public testing::Test {
|
||||
|
||||
// Tests layout analysis output (and scrollview) on the UNLV page numbered
|
||||
// 8087_054.3G.tif. (Dubrovnik), but only if --visual_test is true.
|
||||
//
|
||||
//
|
||||
//TEST_F(ResultIteratorTest, VisualTest) {
|
||||
// if (!FLAGS_visual_test) return;
|
||||
// const char* kIms[] = {"8087_054.3G.tif", "8071_093.3B.tif", nullptr};
|
||||
|
Loading…
Reference in New Issue
Block a user