Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes
BlamerBundle Struct Reference

`#include <pageres.h>`

List of all members.

## Public Member Functions
| BlamerBundle ()
| ~BlamerBundle ()
void | ClearResults ()
void | CopyTruth (const BlamerBundle &other)
void | CopyResults (const BlamerBundle &other)
| BlamerBundle (const BlamerBundle &other)
const char * | IncorrectReason () const
bool | NoTruth () const
void | SetBlame (IncorrectResultReason irr, const STRING &msg, const WERD_CHOICE *choice, bool debug)
void | FillDebugString (const STRING &msg, const WERD_CHOICE *choice, STRING *debug)

## Static Public Member Functions
static const char * | IncorrectReasonName (IncorrectResultReason irr)

## Public Attributes
bool | truth_has_char_boxes
tesseract::BoxWord | truth_word
tesseract::BoxWord | norm_truth_word
int | norm_box_tolerance
GenericVector< STRING > | truth_text
IncorrectResultReason | incorrect_result_reason
STRING | debug
STRING | misadaption_debug
bool | segsearch_is_looking_for_blame
float | best_correctly_segmented_rating
GenericVector< int > | correct_segmentation_cols
GenericVector< int > | correct_segmentation_rows
bool | best_choice_is_dict_and_top_choice
char * | lattice_data
int | lattice_size
tesseract::ParamsTrainingBundle | params_training_bundle

## Detailed Description

Definition at line 97 of file pageres.h.

## Constructor & Destructor Documentation

BlamerBundle::BlamerBundle | ( |  | ) |
| inline

Definition at line 99 of file pageres.h.

: truth_has_char_boxes(false),
incorrect_result_reason(IRR_CORRECT),
lattice_data(NULL) { ClearResults(); }

BlamerBundle::~BlamerBundle | ( |  | ) |
| inline

Definition at line 102 of file pageres.h.

{ delete[] lattice_data; }

BlamerBundle::BlamerBundle | ( | const BlamerBundle & | other | ) |
| inline

Definition at line 142 of file pageres.h.

{
this->CopyTruth(other);
this->CopyResults(other);
}

## Member Function Documentation

void BlamerBundle::ClearResults | ( |  | ) |
| inline

Definition at line 103 of file pageres.h.

{
norm_truth_word.DeleteAllBoxes();
norm_box_tolerance = 0;
if (!NoTruth()) incorrect_result_reason = IRR_CORRECT;
debug = "";
segsearch_is_looking_for_blame = false;
best_correctly_segmented_rating = WERD_CHOICE::kBadRating;
correct_segmentation_cols.clear();
correct_segmentation_rows.clear();
best_choice_is_dict_and_top_choice = false;
delete[] lattice_data;
lattice_data = NULL;
lattice_size = 0;
}

void BlamerBundle::CopyResults | ( | const BlamerBundle & | other | ) |
| inline

Definition at line 124 of file pageres.h.

{
norm_truth_word = other.norm_truth_word;
norm_box_tolerance = other.norm_box_tolerance;
incorrect_result_reason = other.incorrect_result_reason;
segsearch_is_looking_for_blame = other.segsearch_is_looking_for_blame;
best_correctly_segmented_rating =other.best_correctly_segmented_rating;
correct_segmentation_cols = other.correct_segmentation_cols;
correct_segmentation_rows = other.correct_segmentation_rows;
best_choice_is_dict_and_top_choice =
other.best_choice_is_dict_and_top_choice;
if (other.lattice_data != NULL) {
lattice_data = new char[other.lattice_size];
memcpy(lattice_data, other.lattice_data, other.lattice_size);
lattice_size = other.lattice_size;
} else {
lattice_data = NULL;
}
}

void BlamerBundle::CopyTruth | ( | const BlamerBundle & | other | ) |
| inline

Definition at line 117 of file pageres.h.

{
truth_has_char_boxes = other.truth_has_char_boxes;
truth_word = other.truth_word;
truth_text = other.truth_text;
incorrect_result_reason =
(other.NoTruth() ? other.incorrect_result_reason : IRR_CORRECT);
}

void BlamerBundle::FillDebugString | ( | const STRING & | msg,
|  | const WERD_CHOICE * | choice,
|  | STRING * | debug
| ) |  |

Definition at line 63 of file pageres.cpp.

{
(*debug) += "Truth ";
for (int i = 0; i < this->truth_text.length(); ++i) {
(*debug) += this->truth_text[i];
}
if (!this->truth_has_char_boxes) (*debug) += " (no char boxes)";
if (choice != NULL) {
(*debug) += " Choice ";
STRING choice_str;
choice->string_and_lengths(&choice_str, NULL);
(*debug) += choice_str;
}
if (msg.length() > 0) {
(*debug) += "\n";
(*debug) += msg;
}
(*debug) += "\n";
}

const char * BlamerBundle::IncorrectReason | ( |  | ) | const

Definition at line 59 of file pageres.cpp.

{
return kIncorrectResultReasonNames[incorrect_result_reason];
}

const char * BlamerBundle::IncorrectReasonName | ( | IncorrectResultReason | irr | ) |
| static

Definition at line 55 of file pageres.cpp.

{
return kIncorrectResultReasonNames[irr];
}

bool BlamerBundle::NoTruth | ( |  | ) | const
| inline

Definition at line 147 of file pageres.h.

{
return (incorrect_result_reason == IRR_NO_TRUTH ||
incorrect_result_reason == IRR_PAGE_LAYOUT);
}

void BlamerBundle::SetBlame | ( | IncorrectResultReason | irr,
|  | const STRING & | msg,
|  | const WERD_CHOICE * | choice,
|  | bool | debug
| ) |  |
| inline

Definition at line 151 of file pageres.h.

{
this->incorrect_result_reason = irr;
this->debug = this->IncorrectReason();
this->debug += " to blame: ";
this->FillDebugString(msg, choice, &(this->debug));
if (debug) tprintf("SetBlame(): %s", this->debug.string());
}

## Member Data Documentation

bool BlamerBundle::best_choice_is_dict_and_top_choice

Definition at line 194 of file pageres.h.

float BlamerBundle::best_correctly_segmented_rating

Definition at line 187 of file pageres.h.

GenericVector<int> BlamerBundle::correct_segmentation_cols

Definition at line 190 of file pageres.h.

GenericVector<int> BlamerBundle::correct_segmentation_rows

Definition at line 191 of file pageres.h.

STRING BlamerBundle::debug

Definition at line 178 of file pageres.h.

IncorrectResultReason BlamerBundle::incorrect_result_reason

Definition at line 176 of file pageres.h.

char* BlamerBundle::lattice_data

Definition at line 196 of file pageres.h.

int BlamerBundle::lattice_size

Definition at line 197 of file pageres.h.

STRING BlamerBundle::misadaption_debug

Definition at line 180 of file pageres.h.

int BlamerBundle::norm_box_tolerance

Definition at line 172 of file pageres.h.

tesseract::BoxWord BlamerBundle::norm_truth_word

Definition at line 170 of file pageres.h.

tesseract::ParamsTrainingBundle BlamerBundle::params_training_bundle

Definition at line 199 of file pageres.h.

bool BlamerBundle::segsearch_is_looking_for_blame

Definition at line 184 of file pageres.h.

bool BlamerBundle::truth_has_char_boxes

Definition at line 164 of file pageres.h.

GenericVector<STRING> BlamerBundle::truth_text

Definition at line 174 of file pageres.h.

tesseract::BoxWord BlamerBundle::truth_word

Definition at line 167 of file pageres.h.

The documentation for this struct was generated from the following files:

- /mnt/data/src/tesseract-ocr/ccstruct/pageres.h
- /mnt/data/src/tesseract-ocr/ccstruct/pageres.cpp