tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
tesseract::LineFinder Class Reference

#include <linefind.h>

Static Public Member Functions

static void FindAndRemoveLines (int resolution, bool debug, Pix *pix, int *vertical_x, int *vertical_y, Pix **pix_music_mask, TabVector_LIST *v_lines, TabVector_LIST *h_lines)
 
static void ConvertBoxaToBlobs (int image_width, int image_height, Boxa **boxes, C_BLOB_LIST *blobs)
 

Static Private Member Functions

static void FindAndRemoveVLines (int resolution, Pix *pix_intersections, int *vertical_x, int *vertical_y, Pix **pix_vline, Pix *pix_non_vline, Pix *src_pix, TabVector_LIST *vectors)
 
static void FindAndRemoveHLines (int resolution, Pix *pix_intersections, int vertical_x, int vertical_y, Pix **pix_hline, Pix *pix_non_hline, Pix *src_pix, TabVector_LIST *vectors)
 
static void FindLineVectors (const ICOORD &bleft, const ICOORD &tright, BLOBNBOX_LIST *line_bblobs, int *vertical_x, int *vertical_y, TabVector_LIST *vectors)
 
static void GetLineMasks (int resolution, Pix *src_pix, Pix **pix_vline, Pix **pix_non_vline, Pix **pix_hline, Pix **pix_non_hline, Pix **pix_intersections, Pix **pix_music_mask, Pixa *pixa_display)
 
static void GetLineBoxes (bool horizontal_lines, Pix *pix_lines, Pix *pix_intersections, C_BLOB_LIST *line_cblobs, BLOBNBOX_LIST *line_bblobs)
 

Detailed Description

The LineFinder class is a simple static function wrapper class that mainly exposes the FindVerticalLines function.

Member Function Documentation

◆ ConvertBoxaToBlobs()

void tesseract::LineFinder::ConvertBoxaToBlobs ( int  image_width,
int  image_height,
Boxa **  boxes,
C_BLOB_LIST *  blobs 
)
static

Converts the Boxa array to a list of C_BLOB, getting rid of severely overlapping outlines and those that are children of a bigger one.

The output is a list of C_BLOBs that are owned by the list.

The C_OUTLINEs in the C_BLOBs contain no outline data - just empty bounding boxes. The Boxa is consumed and destroyed.

◆ FindAndRemoveHLines()

void tesseract::LineFinder::FindAndRemoveHLines ( int  resolution,
Pix *  pix_intersections,
int  vertical_x,
int  vertical_y,
Pix **  pix_hline,
Pix *  pix_non_hline,
Pix *  src_pix,
TabVector_LIST *  vectors 
)
staticprivate

◆ FindAndRemoveLines()

void tesseract::LineFinder::FindAndRemoveLines ( int  resolution,
bool  debug,
Pix *  pix,
int *  vertical_x,
int *  vertical_y,
Pix **  pix_music_mask,
TabVector_LIST *  v_lines,
TabVector_LIST *  h_lines 
)
static

Finds vertical and horizontal line objects in the given pix and removes them.

Uses the given resolution to determine size thresholds instead of any that may be present in the pix.

The output vertical_x and vertical_y contain a sum of the output vectors, thereby giving the mean vertical direction.

If pix_music_mask != nullptr, and music is detected, a mask of the staves and anything that is connected (bars, notes etc.) will be returned in pix_music_mask, the mask subtracted from pix, and the lines will not appear in v_lines or h_lines.

The output vectors are owned by the list and Frozen (cannot refit) by having no boxes, as there is no need to refit or merge separator lines.

The detected lines are removed from the pix.

◆ FindAndRemoveVLines()

void tesseract::LineFinder::FindAndRemoveVLines ( int  resolution,
Pix *  pix_intersections,
int *  vertical_x,
int *  vertical_y,
Pix **  pix_vline,
Pix *  pix_non_vline,
Pix *  src_pix,
TabVector_LIST *  vectors 
)
staticprivate

◆ FindLineVectors()

void tesseract::LineFinder::FindLineVectors ( const ICOORD bleft,
const ICOORD tright,
BLOBNBOX_LIST *  line_bblobs,
int *  vertical_x,
int *  vertical_y,
TabVector_LIST *  vectors 
)
staticprivate

◆ GetLineBoxes()

void tesseract::LineFinder::GetLineBoxes ( bool  horizontal_lines,
Pix *  pix_lines,
Pix *  pix_intersections,
C_BLOB_LIST *  line_cblobs,
BLOBNBOX_LIST *  line_bblobs 
)
staticprivate

◆ GetLineMasks()

void tesseract::LineFinder::GetLineMasks ( int  resolution,
Pix *  src_pix,
Pix **  pix_vline,
Pix **  pix_non_vline,
Pix **  pix_hline,
Pix **  pix_non_hline,
Pix **  pix_intersections,
Pix **  pix_music_mask,
Pixa *  pixa_display 
)
staticprivate

The documentation for this class was generated from the following files: