tesseract  4.1.1
publictypes.h File Reference

Go to the source code of this file.

Namespaces

 tesseract
 

Enumerations

enum  PolyBlockType {
  PT_UNKNOWN , PT_FLOWING_TEXT , PT_HEADING_TEXT , PT_PULLOUT_TEXT ,
  PT_EQUATION , PT_INLINE_EQUATION , PT_TABLE , PT_VERTICAL_TEXT ,
  PT_CAPTION_TEXT , PT_FLOWING_IMAGE , PT_HEADING_IMAGE , PT_PULLOUT_IMAGE ,
  PT_HORZ_LINE , PT_VERT_LINE , PT_NOISE , PT_COUNT
}
 
enum  tesseract::Orientation { tesseract::ORIENTATION_PAGE_UP = 0 , tesseract::ORIENTATION_PAGE_RIGHT = 1 , tesseract::ORIENTATION_PAGE_DOWN = 2 , tesseract::ORIENTATION_PAGE_LEFT = 3 }
 
enum  tesseract::WritingDirection { tesseract::WRITING_DIRECTION_LEFT_TO_RIGHT = 0 , tesseract::WRITING_DIRECTION_RIGHT_TO_LEFT = 1 , tesseract::WRITING_DIRECTION_TOP_TO_BOTTOM = 2 }
 
enum  tesseract::TextlineOrder { tesseract::TEXTLINE_ORDER_LEFT_TO_RIGHT = 0 , tesseract::TEXTLINE_ORDER_RIGHT_TO_LEFT = 1 , tesseract::TEXTLINE_ORDER_TOP_TO_BOTTOM = 2 }
 
enum  tesseract::PageSegMode {
  tesseract::PSM_OSD_ONLY = 0 , tesseract::PSM_AUTO_OSD = 1 , tesseract::PSM_AUTO_ONLY = 2 , tesseract::PSM_AUTO = 3 ,
  tesseract::PSM_SINGLE_COLUMN = 4 , tesseract::PSM_SINGLE_BLOCK_VERT_TEXT = 5 , tesseract::PSM_SINGLE_BLOCK = 6 , tesseract::PSM_SINGLE_LINE = 7 ,
  tesseract::PSM_SINGLE_WORD = 8 , tesseract::PSM_CIRCLE_WORD = 9 , tesseract::PSM_SINGLE_CHAR = 10 , tesseract::PSM_SPARSE_TEXT = 11 ,
  tesseract::PSM_SPARSE_TEXT_OSD = 12 , tesseract::PSM_RAW_LINE = 13 , tesseract::PSM_COUNT
}
 
enum  tesseract::PageIteratorLevel {
  tesseract::RIL_BLOCK , tesseract::RIL_PARA , tesseract::RIL_TEXTLINE , tesseract::RIL_WORD ,
  tesseract::RIL_SYMBOL
}
 
enum  tesseract::ParagraphJustification { tesseract::JUSTIFICATION_UNKNOWN , tesseract::JUSTIFICATION_LEFT , tesseract::JUSTIFICATION_CENTER , tesseract::JUSTIFICATION_RIGHT }
 
enum  tesseract::OcrEngineMode {
  tesseract::OEM_TESSERACT_ONLY , tesseract::OEM_LSTM_ONLY , tesseract::OEM_TESSERACT_LSTM_COMBINED , tesseract::OEM_DEFAULT ,
  tesseract::OEM_COUNT
}
 

Functions

bool PTIsLineType (PolyBlockType type)
 
bool PTIsImageType (PolyBlockType type)
 
bool PTIsTextType (PolyBlockType type)
 
bool PTIsPulloutType (PolyBlockType type)
 
bool tesseract::PSM_OSD_ENABLED (int pageseg_mode)
 
bool tesseract::PSM_ORIENTATION_ENABLED (int pageseg_mode)
 
bool tesseract::PSM_COL_FIND_ENABLED (int pageseg_mode)
 
bool tesseract::PSM_SPARSE (int pageseg_mode)
 
bool tesseract::PSM_BLOCK_FIND_ENABLED (int pageseg_mode)
 
bool tesseract::PSM_LINE_FIND_ENABLED (int pageseg_mode)
 
bool tesseract::PSM_WORD_FIND_ENABLED (int pageseg_mode)
 

Variables

constexpr int kPointsPerInch = 72
 
constexpr int kMinCredibleResolution = 70
 
constexpr int kMaxCredibleResolution = 2400
 
constexpr int kResolutionEstimationFactor = 10
 
const char * kPolyBlockNames []
 

Enumeration Type Documentation

◆ PolyBlockType

Possible types for a POLY_BLOCK or ColPartition. Must be kept in sync with kPBColors in polyblk.cpp and PTIs*Type functions below, as well as kPolyBlockNames in publictypes.cpp. Used extensively by ColPartition, and POLY_BLOCK.

Enumerator
PT_UNKNOWN 
PT_FLOWING_TEXT 
PT_HEADING_TEXT 
PT_PULLOUT_TEXT 
PT_EQUATION 
PT_INLINE_EQUATION 
PT_TABLE 
PT_VERTICAL_TEXT 
PT_CAPTION_TEXT 
PT_FLOWING_IMAGE 
PT_HEADING_IMAGE 
PT_PULLOUT_IMAGE 
PT_HORZ_LINE 
PT_VERT_LINE 
PT_NOISE 
PT_COUNT 

Definition at line 53 of file publictypes.h.

53  {
54  PT_UNKNOWN, // Type is not yet known. Keep as the first element.
55  PT_FLOWING_TEXT, // Text that lives inside a column.
56  PT_HEADING_TEXT, // Text that spans more than one column.
57  PT_PULLOUT_TEXT, // Text that is in a cross-column pull-out region.
58  PT_EQUATION, // Partition belonging to an equation region.
59  PT_INLINE_EQUATION, // Partition has inline equation.
60  PT_TABLE, // Partition belonging to a table region.
61  PT_VERTICAL_TEXT, // Text-line runs vertically.
62  PT_CAPTION_TEXT, // Text that belongs to an image.
63  PT_FLOWING_IMAGE, // Image that lives inside a column.
64  PT_HEADING_IMAGE, // Image that spans more than one column.
65  PT_PULLOUT_IMAGE, // Image that is in a cross-column pull-out region.
66  PT_HORZ_LINE, // Horizontal Line.
67  PT_VERT_LINE, // Vertical Line.
68  PT_NOISE, // Lies outside of any column.
69  PT_COUNT
70 };
@ PT_VERT_LINE
Definition: publictypes.h:67
@ PT_PULLOUT_TEXT
Definition: publictypes.h:57
@ PT_COUNT
Definition: publictypes.h:69
@ PT_HEADING_TEXT
Definition: publictypes.h:56
@ PT_TABLE
Definition: publictypes.h:60
@ PT_NOISE
Definition: publictypes.h:68
@ PT_PULLOUT_IMAGE
Definition: publictypes.h:65
@ PT_HEADING_IMAGE
Definition: publictypes.h:64
@ PT_INLINE_EQUATION
Definition: publictypes.h:59
@ PT_FLOWING_TEXT
Definition: publictypes.h:55
@ PT_UNKNOWN
Definition: publictypes.h:54
@ PT_HORZ_LINE
Definition: publictypes.h:66
@ PT_VERTICAL_TEXT
Definition: publictypes.h:61
@ PT_EQUATION
Definition: publictypes.h:58
@ PT_FLOWING_IMAGE
Definition: publictypes.h:63
@ PT_CAPTION_TEXT
Definition: publictypes.h:62

Function Documentation

◆ PTIsImageType()

bool PTIsImageType ( PolyBlockType  type)
inline

Returns true if PolyBlockType is of image type

Definition at line 77 of file publictypes.h.

77  {
78  return type == PT_FLOWING_IMAGE || type == PT_HEADING_IMAGE ||
80 }

◆ PTIsLineType()

bool PTIsLineType ( PolyBlockType  type)
inline

Returns true if PolyBlockType is of horizontal line type

Definition at line 73 of file publictypes.h.

73  {
74  return type == PT_HORZ_LINE || type == PT_VERT_LINE;
75 }

◆ PTIsPulloutType()

bool PTIsPulloutType ( PolyBlockType  type)
inline

Definition at line 89 of file publictypes.h.

89  {
90  return type == PT_PULLOUT_IMAGE || type == PT_PULLOUT_TEXT;
91 }

◆ PTIsTextType()

bool PTIsTextType ( PolyBlockType  type)
inline

Returns true if PolyBlockType is of text type

Definition at line 82 of file publictypes.h.

82  {
83  return type == PT_FLOWING_TEXT || type == PT_HEADING_TEXT ||
84  type == PT_PULLOUT_TEXT || type == PT_TABLE ||
87 }

Variable Documentation

◆ kMaxCredibleResolution

constexpr int kMaxCredibleResolution = 2400
constexpr

Maximum believable resolution.

Definition at line 40 of file publictypes.h.

◆ kMinCredibleResolution

constexpr int kMinCredibleResolution = 70
constexpr

Minimum believable resolution. Used as a default if there is no other information, as it is safer to under-estimate than over-estimate.

Definition at line 38 of file publictypes.h.

◆ kPointsPerInch

constexpr int kPointsPerInch = 72
constexpr

Number of printers' points in an inch. The unit of the pointsize return.

Definition at line 33 of file publictypes.h.

◆ kPolyBlockNames

const char* kPolyBlockNames[]
extern

String name for each block type. Keep in sync with PolyBlockType.

Definition at line 23 of file publictypes.cpp.

◆ kResolutionEstimationFactor

constexpr int kResolutionEstimationFactor = 10
constexpr

Ratio between median blob size and likely resolution. Used to estimate resolution when none is provided. This is basically 1/usual text size in inches.

Definition at line 45 of file publictypes.h.