#include <baselinedetect.h>
 | 
| static double  | SpacingModelError (double perp_disp, double line_spacing, double line_offset) | 
|   | 
Definition at line 129 of file baselinedetect.h.
 
◆ BaselineBlock()
      
        
          | tesseract::BaselineBlock::BaselineBlock  | 
          ( | 
          int  | 
          debug_level,  | 
        
        
           | 
           | 
          bool  | 
          non_text,  | 
        
        
           | 
           | 
          TO_BLOCK *  | 
          block  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 411 of file baselinedetect.cpp.
  412   : block_(
block), debug_level_(debug_level), non_text_block_(non_text),
   413     good_skew_angle_(
false), skew_angle_(0.0),
   415   TO_ROW_IT row_it(block_->
get_rows());
   416   for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
 
int blob_x_order(const void *item1, const void *item2)
 
 
 
 
◆ block()
  
  
      
        
          | TO_BLOCK* tesseract::BaselineBlock::block  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ DrawFinalRows()
      
        
          | void tesseract::BaselineBlock::DrawFinalRows  | 
          ( | 
          const ICOORD &  | 
          page_tr | ) | 
           | 
        
      
 
Definition at line 580 of file baselinedetect.cpp.
  581 #ifndef GRAPHICS_DISABLED   582   if (non_text_block_) 
return;
   583   double gradient = tan(skew_angle_);
   584   FCOORD rotation(1.0f, 0.0f);
   588   TO_ROW_IT row_it = block_->
get_rows();
   589   for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
   599   if (block_->
blobs.length() > 0)
   600     tprintf(
"%d blobs discarded as noise\n", block_->
blobs.length());
 void plot_blob_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour)
 
void draw_meanlines(TO_BLOCK *block, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation)
 
DLLSYM void tprintf(const char *format,...)
 
void plot_parallel_row(TO_ROW *row, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation)
 
void bounding_box(ICOORD &bottom_left, ICOORD &top_right) const
get box 
 
ScrollView * create_to_win(ICOORD page_tr)
 
 
 
 
◆ DrawPixSpline()
      
        
          | void tesseract::BaselineBlock::DrawPixSpline  | 
          ( | 
          Pix *  | 
          pix_in | ) | 
           | 
        
      
 
Definition at line 605 of file baselinedetect.cpp.
  606   if (non_text_block_) 
return;
   607   TO_ROW_IT row_it = block_->
get_rows();
   608   for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
   609     row_it.data()->baseline.plot(pix_in);
 
 
 
 
◆ FitBaselinesAndFindSkew()
      
        
          | bool tesseract::BaselineBlock::FitBaselinesAndFindSkew  | 
          ( | 
          bool  | 
          use_box_bottoms | ) | 
           | 
        
      
 
Definition at line 437 of file baselinedetect.cpp.
  438   if (non_text_block_) 
return false;
   440   for (
int r = 0; r < rows_.size(); ++r) {
   441     BaselineRow* row = rows_[r];
   442     if (row->FitBaseline(use_box_bottoms)) {
   443       double angle = row->BaselineAngle();
   446     if (debug_level_ > 1)
   450   if (!angles.
empty()) {
   452     good_skew_angle_ = 
true;
   455     good_skew_angle_ = 
false;
   457   if (debug_level_ > 0) {
   458     tprintf(
"Initial block skew angle = %g, good = %d\n",
   459             skew_angle_, good_skew_angle_);
   461   return good_skew_angle_;
 
DLLSYM void tprintf(const char *format,...)
 
T MedianOfCircularValues(T modulus, GenericVector< T > *v)
 
 
 
 
◆ FitBaselineSplines()
      
        
          | void tesseract::BaselineBlock::FitBaselineSplines  | 
          ( | 
          bool  | 
          enable_splines,  | 
        
        
           | 
           | 
          bool  | 
          show_final_rows,  | 
        
        
           | 
           | 
          Textord *  | 
          textord  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 551 of file baselinedetect.cpp.
  554   double gradient = tan(skew_angle_);
   555   FCOORD rotation(1.0f, 0.0f);
   557   if (enable_splines) {
   558     textord->make_spline_rows(block_, gradient, show_final_rows);
   562     TO_ROW_IT row_it = block_->
get_rows();
   563     for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
   564       TO_ROW* row = row_it.data();
   565       int32_t xstarts[2] = { block_box.
left(), block_box.
right() };
   566       double coeffs[3] = { 0.0, row->
line_m(), row->
line_c() };
   572   textord->compute_block_xheight(block_, gradient);
 
void restore_underlined_blobs(TO_BLOCK *block)
 
FCOORD classify_rotation() const
 
EXTERN bool textord_restore_underlines
 
void set_xheight(int32_t height)
set char size 
 
void bounding_box(ICOORD &bottom_left, ICOORD &top_right) const
get box 
 
 
 
 
◆ ParallelizeBaselines()
      
        
          | void tesseract::BaselineBlock::ParallelizeBaselines  | 
          ( | 
          double  | 
          default_block_skew | ) | 
           | 
        
      
 
Definition at line 466 of file baselinedetect.cpp.
  467   if (non_text_block_) 
return;
   468   if (!good_skew_angle_) skew_angle_ = default_block_skew;
   469   if (debug_level_ > 0)
   470     tprintf(
"Adjusting block to skew angle %g\n", skew_angle_);
   472   for (
int r = 0; r < rows_.size(); ++r) {
   473     BaselineRow* row = rows_[r];
   474     row->AdjustBaselineToParallel(debug_level_, 
direction);
   475     if (debug_level_ > 1)
   478   if (rows_.size() < 3 || !ComputeLineSpacing())
   485                                         line_spacing_, line_offset_);
   486   for (
int r = 1; r < rows_.size(); ++r) {
   488                                      line_spacing_, line_offset_);
   489     if (error < best_error) {
   495   double offset = line_offset_;
   496   for (
int r = best_row + 1; r < rows_.size(); ++r) {
   497     offset = rows_[r]->AdjustBaselineToGrid(debug_level_, 
direction,
   498                                             line_spacing_, offset);
   500   offset = line_offset_;
   501   for (
int r = best_row - 1; r >= 0; --r) {
   502     offset = rows_[r]->AdjustBaselineToGrid(debug_level_, 
direction,
   503                                             line_spacing_, offset);
 int direction(EDGEPT *point)
 
static double SpacingModelError(double perp_disp, double line_spacing, double line_offset)
 
DLLSYM void tprintf(const char *format,...)
 
 
 
 
◆ PrepareForSplineFitting()
      
        
          | void tesseract::BaselineBlock::PrepareForSplineFitting  | 
          ( | 
          ICOORD  | 
          page_tr,  | 
        
        
           | 
           | 
          bool  | 
          remove_noise  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 535 of file baselinedetect.cpp.
  536   if (non_text_block_) 
return;
   540   FCOORD rotation(1.0f, 0.0f);
   541   double gradient = tan(skew_angle_);
 void pre_associate_blobs(ICOORD page_tr, TO_BLOCK *block, FCOORD rotation, bool testing_on)
 
void separate_underlines(TO_BLOCK *block, float gradient, FCOORD rotation, bool testing_on)
 
void vigorous_noise_removal(TO_BLOCK *block)
 
 
 
 
◆ SetupBlockParameters()
      
        
          | void tesseract::BaselineBlock::SetupBlockParameters  | 
          ( | 
           | ) | 
           const | 
        
      
 
Definition at line 508 of file baselinedetect.cpp.
  509   if (line_spacing_ > 0.0) {
   511     float min_spacing = std::min(block_->
line_spacing, static_cast<float>(line_spacing_));
   512     if (min_spacing < block_->line_size)
   519   TO_ROW_IT row_it(block_->
get_rows());
   520   for (
int r = 0; r < rows_.size(); ++r, row_it.forward()) {
   521     BaselineRow* row = rows_[r];
   522     TO_ROW* to_row = row_it.data();
   523     row->SetupOldLineParameters(to_row);
 
const double kMaxBlobSizeMultiple
 
 
 
 
◆ skew_angle()
  
  
      
        
          | double tesseract::BaselineBlock::skew_angle  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ SpacingModelError()
  
  
      
        
          | double tesseract::BaselineBlock::SpacingModelError  | 
          ( | 
          double  | 
          perp_disp,  | 
         
        
           | 
           | 
          double  | 
          line_spacing,  | 
         
        
           | 
           | 
          double  | 
          line_offset  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Definition at line 425 of file baselinedetect.cpp.
  428   int multiple = 
IntCastRounded((perp_disp - line_offset) / line_spacing);
   429   double model_y = line_spacing * multiple + line_offset;
   430   return fabs(perp_disp - model_y);
 int IntCastRounded(double x)
 
 
 
 
The documentation for this class was generated from the following files: