mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-04 18:29:06 +08:00
023e1b340e
* api: Replace Tesseract data types by POSIX data types Signed-off-by: Stefan Weil <sw@weilnetz.de> * ccmain: Replace Tesseract data types by POSIX data types Signed-off-by: Stefan Weil <sw@weilnetz.de> * ccstruct: Replace Tesseract data types by POSIX data types Signed-off-by: Stefan Weil <sw@weilnetz.de> * classify: Replace Tesseract data types by POSIX data types Signed-off-by: Stefan Weil <sw@weilnetz.de> * cutil: Replace Tesseract data types by POSIX data types Signed-off-by: Stefan Weil <sw@weilnetz.de> * dict: Replace Tesseract data types by POSIX data types Signed-off-by: Stefan Weil <sw@weilnetz.de> * textord: Replace Tesseract data types by POSIX data types Signed-off-by: Stefan Weil <sw@weilnetz.de> * training: Replace Tesseract data types by POSIX data types Signed-off-by: Stefan Weil <sw@weilnetz.de> * wordrec: Replace Tesseract data types by POSIX data types Signed-off-by: Stefan Weil <sw@weilnetz.de> * ccutil: Replace Tesseract data types by POSIX data types Now all Tesseract data types which are no longer needed can be removed from ccutil/host.h. Signed-off-by: Stefan Weil <sw@weilnetz.de> * ccmain: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX Signed-off-by: Stefan Weil <sw@weilnetz.de> * ccstruct: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX Signed-off-by: Stefan Weil <sw@weilnetz.de> * classify: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX Signed-off-by: Stefan Weil <sw@weilnetz.de> * dict: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX Signed-off-by: Stefan Weil <sw@weilnetz.de> * lstm: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX Signed-off-by: Stefan Weil <sw@weilnetz.de> * textord: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX Signed-off-by: Stefan Weil <sw@weilnetz.de> * wordrec: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX Signed-off-by: Stefan Weil <sw@weilnetz.de> * ccutil: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX Remove the macros which are now unused from ccutil/host.h. Remove also the obsolete history comments. Signed-off-by: Stefan Weil <sw@weilnetz.de> * Fix build error caused by ambiguous ClipToRange Error message vom Appveyor CI: C:\projects\tesseract\ccstruct\coutln.cpp(818): error C2672: 'ClipToRange': no matching overloaded function found [C:\projects\tesseract\build\libtesseract.vcxproj] C:\projects\tesseract\ccstruct\coutln.cpp(818): error C2782: 'T ClipToRange(const T &,const T &,const T &)': template parameter 'T' is ambiguous [C:\projects\tesseract\build\libtesseract.vcxproj] c:\projects\tesseract\ccutil\helpers.h(122): note: see declaration of 'ClipToRange' C:\projects\tesseract\ccstruct\coutln.cpp(818): note: could be 'char' C:\projects\tesseract\ccstruct\coutln.cpp(818): note: or 'int' Signed-off-by: Stefan Weil <sw@weilnetz.de> * unittest: Replace Tesseract's MAX_INT8 by POSIX INT8_MAX Signed-off-by: Stefan Weil <sw@weilnetz.de> * arch: Replace Tesseract's MAX_INT8 by POSIX INT8_MAX Signed-off-by: Stefan Weil <sw@weilnetz.de>
78 lines
3.3 KiB
C++
78 lines
3.3 KiB
C++
/**********************************************************************
|
|
* File: wordseg.h (Formerly wspace.h)
|
|
* Description: Code to segment the blobs into words.
|
|
* Author: Ray Smith
|
|
* Created: Fri Oct 16 11:32:28 BST 1992
|
|
*
|
|
* (C) Copyright 1992, Hewlett-Packard Ltd.
|
|
** 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
|
|
** http://www.apache.org/licenses/LICENSE-2.0
|
|
** Unless required by applicable law or agreed to in writing, software
|
|
** distributed under the License is distributed on an "AS IS" BASIS,
|
|
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
** See the License for the specific language governing permissions and
|
|
** limitations under the License.
|
|
*
|
|
**********************************************************************/
|
|
|
|
#ifndef WORDSEG_H
|
|
#define WORDSEG_H
|
|
|
|
#include "params.h"
|
|
#include "blobbox.h"
|
|
#include "textord.h"
|
|
|
|
namespace tesseract {
|
|
class Tesseract;
|
|
}
|
|
|
|
extern BOOL_VAR_H (textord_fp_chopping, TRUE, "Do fixed pitch chopping");
|
|
extern BOOL_VAR_H(textord_force_make_prop_words, FALSE,
|
|
"Force proportional word segmentation on all rows");
|
|
extern BOOL_VAR_H (textord_chopper_test, FALSE,
|
|
"Chopper is being tested.");
|
|
|
|
void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST* real_rows);
|
|
void make_words(tesseract::Textord *textord,
|
|
ICOORD page_tr, // top right
|
|
float gradient, // page skew
|
|
BLOCK_LIST *blocks, // block list
|
|
TO_BLOCK_LIST *port_blocks); // output list
|
|
void set_row_spaces( //find space sizes
|
|
TO_BLOCK *block, //block to do
|
|
FCOORD rotation, //for drawing
|
|
BOOL8 testing_on //correct orientation
|
|
);
|
|
int32_t row_words( //compute space size
|
|
TO_BLOCK *block, //block it came from
|
|
TO_ROW *row, //row to operate on
|
|
int32_t maxwidth, //max expected space size
|
|
FCOORD rotation, //for drawing
|
|
BOOL8 testing_on //for debug
|
|
);
|
|
int32_t row_words2( //compute space size
|
|
TO_BLOCK *block, //block it came from
|
|
TO_ROW *row, //row to operate on
|
|
int32_t maxwidth, //max expected space size
|
|
FCOORD rotation, //for drawing
|
|
BOOL8 testing_on //for debug
|
|
);
|
|
void make_real_words(
|
|
tesseract::Textord *textord,
|
|
TO_BLOCK *block, //block to do
|
|
FCOORD rotation //for drawing
|
|
);
|
|
ROW *make_rep_words( //make a row
|
|
TO_ROW *row, //row to convert
|
|
TO_BLOCK *block //block it lives in
|
|
);
|
|
WERD *make_real_word( //make a WERD
|
|
BLOBNBOX_IT *box_it, //iterator
|
|
int32_t blobcount, //no of blobs to use
|
|
BOOL8 bol, //start of line
|
|
uint8_t blanks //no of blanks
|
|
);
|
|
#endif
|