#include <baselinedetect.h>
Definition at line 242 of file baselinedetect.h.
◆ BaselineDetect()
tesseract::BaselineDetect::BaselineDetect |
( |
int |
debug_level, |
|
|
const FCOORD & |
page_skew, |
|
|
TO_BLOCK_LIST * |
blocks |
|
) |
| |
Definition at line 786 of file baselinedetect.cpp.
788 : page_skew_(page_skew), debug_level_(debug_level), pix_debug_(NULL),
789 debug_file_prefix_(
"") {
790 TO_BLOCK_IT it(blocks);
791 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
801 bool non_text = pb != NULL && !pb->
IsText();
802 blocks_.push_back(
new BaselineBlock(debug_level_, non_text, to_block));
POLY_BLOCK * poly_block() const
◆ ~BaselineDetect()
tesseract::BaselineDetect::~BaselineDetect |
( |
| ) |
|
◆ ComputeBaselineSplinesAndXheights()
void tesseract::BaselineDetect::ComputeBaselineSplinesAndXheights |
( |
const ICOORD & |
page_tr, |
|
|
bool |
enable_splines, |
|
|
bool |
remove_noise, |
|
|
bool |
show_final_rows, |
|
|
Textord * |
textord |
|
) |
| |
Definition at line 845 of file baselinedetect.cpp.
850 Pix* pix_spline = pix_debug_ ? pixConvertTo32(pix_debug_) : NULL;
851 for (
int i = 0; i < blocks_.size(); ++i) {
852 BaselineBlock* bl_block = blocks_[i];
854 bl_block->PrepareForSplineFitting(page_tr, remove_noise);
855 bl_block->FitBaselineSplines(enable_splines, show_final_rows, textord);
857 bl_block->DrawPixSpline(pix_spline);
859 if (show_final_rows) {
860 bl_block->DrawFinalRows(page_tr);
865 STRING outfile_name = debug_file_prefix_ +
"_spline.png";
866 pixWrite(outfile_name.
string(), pix_spline, IFF_PNG);
867 pixDestroy(&pix_spline);
const char * string() const
◆ ComputeStraightBaselines()
void tesseract::BaselineDetect::ComputeStraightBaselines |
( |
bool |
use_box_bottoms | ) |
|
Definition at line 813 of file baselinedetect.cpp.
815 for (
int i = 0; i < blocks_.size(); ++i) {
816 BaselineBlock* bl_block = blocks_[i];
817 if (debug_level_ > 0)
818 tprintf(
"Fitting initial baselines...\n");
819 if (bl_block->FitBaselinesAndFindSkew(use_box_bottoms)) {
820 block_skew_angles.
push_back(bl_block->skew_angle());
824 double default_block_skew = page_skew_.
angle();
825 if (!block_skew_angles.
empty()) {
828 if (debug_level_ > 0) {
829 tprintf(
"Page skew angle = %g\n", default_block_skew);
833 for (
int i = 0; i < blocks_.size(); ++i) {
834 BaselineBlock* bl_block = blocks_[i];
835 bl_block->ParallelizeBaselines(default_block_skew);
836 bl_block->SetupBlockParameters();
T MedianOfCircularValues(T modulus, GenericVector< T > *v)
float angle() const
find angle
◆ SetDebugImage()
void tesseract::BaselineDetect::SetDebugImage |
( |
Pix * |
pixIn, |
|
|
const STRING & |
output_path |
|
) |
| |
Definition at line 871 of file baselinedetect.cpp.
872 pixDestroy(&pix_debug_);
873 pix_debug_ = pixClone(pixIn);
874 debug_file_prefix_ = output_path;
The documentation for this class was generated from the following files: