20 #ifndef TESSERACT_CCSTRUCT_BLAMER_H_
21 #define TESSERACT_CCSTRUCT_BLAMER_H_
27 #ifndef DISABLED_LEGACY_ENGINE
29 #endif // ndef DISABLED_LEGACY_ENGINE
48 static const int16_t kBlamerBoxTolerance = 5;
117 for (
int i = 0; i < truth_text_.
size(); ++i)
118 truth_str += truth_text_[i];
122 return incorrect_result_reason_;
129 return debug_.
length() > 0 || misadaption_debug_.
length() > 0;
135 return misadaption_debug_;
138 if (rating < best_correctly_segmented_rating_)
139 best_correctly_segmented_rating_ = rating;
142 return correct_segmentation_cols_.
size();
147 return correct_segmentation_cols_[index] == coord.
col &&
148 correct_segmentation_rows_[index] == coord.
row;
151 best_choice_is_dict_and_top_choice_ = value;
154 return lattice_data_;
157 return lattice_size_;
160 lattice_size_ = size;
161 delete [] lattice_data_;
162 lattice_data_ =
new char[lattice_size_];
163 memcpy(lattice_data_, data, lattice_size_);
165 #ifndef DISABLED_LEGACY_ENGINE
167 return params_training_bundle_;
173 #endif // ndef DISABLED_LEGACY_ENGINE
178 const char* truth_str,
const TBOX& word_box);
182 const char* char_str,
const TBOX& char_box);
192 norm_box_tolerance_ = 0;
195 segsearch_is_looking_for_blame_ =
false;
197 correct_segmentation_cols_.
clear();
198 correct_segmentation_rows_.
clear();
199 best_choice_is_dict_and_top_choice_ =
false;
200 delete[] lattice_data_;
201 lattice_data_ =
nullptr;
205 truth_has_char_boxes_ = other.truth_has_char_boxes_;
206 truth_word_ = other.truth_word_;
207 truth_text_ = other.truth_text_;
208 incorrect_result_reason_ =
212 norm_truth_word_ = other.norm_truth_word_;
213 norm_box_tolerance_ = other.norm_box_tolerance_;
214 incorrect_result_reason_ = other.incorrect_result_reason_;
215 segsearch_is_looking_for_blame_ = other.segsearch_is_looking_for_blame_;
216 best_correctly_segmented_rating_ = other.best_correctly_segmented_rating_;
217 correct_segmentation_cols_ = other.correct_segmentation_cols_;
218 correct_segmentation_rows_ = other.correct_segmentation_rows_;
219 best_choice_is_dict_and_top_choice_ =
220 other.best_choice_is_dict_and_top_choice_;
221 if (other.lattice_data_ !=
nullptr) {
222 lattice_data_ =
new char[other.lattice_size_];
223 memcpy(lattice_data_, other.lattice_data_, other.lattice_size_);
224 lattice_size_ = other.lattice_size_;
226 lattice_data_ =
nullptr;
251 const TBOX& blob_box,
252 const BLOB_CHOICE_LIST& choices,
278 double max_char_wh_ratio,
WERD_RES* word_res);
298 incorrect_result_reason_ = irr;
300 debug_ +=
" to blame: ";
307 bool truth_has_char_boxes_;
315 int norm_box_tolerance_;
323 STRING misadaption_debug_;
327 bool segsearch_is_looking_for_blame_;
330 float best_correctly_segmented_rating_;
337 bool best_choice_is_dict_and_top_choice_;
342 #ifndef DISABLED_LEGACY_ENGINE
344 #endif // ndef DISABLED_LEGACY_ENGINE
348 #endif // TESSERACT_CCSTRUCT_BLAMER_H_