#include "tessvars.h"
#include <cctype>
#include <cerrno>
#include <cstring>
#include <tesseract/genericvector.h>
#include "reject.h"
#include "control.h"
#include "docqual.h"
#include <tesseract/helpers.h>
#include "tesseractclass.h"
Go to the source code of this file.
◆ CLISTIZEH()
Definition at line 50 of file reject.cpp.
60 void Tesseract::set_done(
WERD_RES *word, int16_t pass) {
67 if (word->
done && (pass == 1) && (!word_from_dict || word_is_ambig) &&
68 one_ell_conflict(word,
false)) {
69 if (tessedit_rejection_debug)
tprintf(
"one_ell_conflict detected\n");
72 if (word->
done && ((!word_from_dict &&
74 if (tessedit_rejection_debug)
tprintf(
"non-dict or ambig word detected\n");
77 if (tessedit_rejection_debug) {
91 void Tesseract::make_reject_map(
WERD_RES *word,
ROW *row, int16_t pass) {
96 check_debug_pt(word, -1);
103 if (tessedit_reject_mode == 0) {
106 }
else if (tessedit_reject_mode == 5) {
115 one_ell_conflict(word,
true);
125 if (rej_use_tess_blanks &&
130 if (rej_use_good_perm) {
134 (!rej_use_sensible_wd ||
135 acceptable_word_string(*word->
uch_set,
141 if (rej_alphas_in_number_perm) {
142 for (i = 0, offset = 0;
160 tprintf(
"BAD tessedit_reject_mode\n");
161 ASSERT_HOST(
"Fatal error encountered!" ==
nullptr);
164 if (tessedit_image_border > -1)
165 reject_edge_blobs(word);
167 check_debug_pt (word, 10);
168 if (tessedit_rejection_debug) {
170 tprintf(
"Certainty: %f Rating: %f\n",
◆ compute_reject_threshold()
Definition at line 225 of file reject.cpp.
231 float bestgap = 0.0f;
234 int blob_count = word->
length();
237 for (
int i = 0; i < blob_count; ++i) {
241 gapstart = ratings[0] - 1;
242 if (blob_count >= 3) {
243 for (
int index = 0; index < blob_count - 1; index++) {
244 if (ratings[index + 1] - ratings[index] > bestgap) {
245 bestgap = ratings[index + 1] - ratings[index];
247 gapstart = ratings[index];
◆ reject_blanks()
◆ reject_poor_matches()
void reject_poor_matches |
( |
WERD_RES * |
word | ) |
|