mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 12:49:35 +08:00
Refactor function Textord::clean_noise_from_row (#4225)
Co-authored-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
a1837f18e0
commit
d461867812
@ -533,16 +533,17 @@ bool Textord::clean_noise_from_row( // remove empties
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: check whether `&& super_norm_count < textord_noise_sncount`should always be added here.
|
||||
bool rejected = dot_count > norm_count * textord_noise_normratio &&
|
||||
dot_count > 2;
|
||||
if (textord_noise_debug) {
|
||||
tprintf("Row ending at (%d,%g):", blob_box.right(), row->base_line(blob_box.right()));
|
||||
tprintf(" R=%g, dc=%d, nc=%d, %s\n",
|
||||
norm_count > 0 ? static_cast<float>(dot_count) / norm_count : 9999, dot_count,
|
||||
norm_count,
|
||||
dot_count > norm_count * textord_noise_normratio && dot_count > 2 ? "REJECTED"
|
||||
: "ACCEPTED");
|
||||
rejected? "REJECTED": "ACCEPTED");
|
||||
}
|
||||
return super_norm_count < textord_noise_sncount &&
|
||||
dot_count > norm_count * textord_noise_rowratio && dot_count > 2;
|
||||
return super_norm_count < textord_noise_sncount && rejected;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user