$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
scribo::table Namespace Reference

Namespaces

namespace  internal

Functions

template<typename I , typename L >
mln::util::array< intalign_lines_horizontaly (const Image< I > &input, const component_set< L > &lines, component_set< L > &aligned_lines, unsigned max_alignment_diff)
template<typename I >
mln::util::array< intalign_lines_verticaly (const Image< I > &input, mln::util::array< box< typename I::site > > &line_bboxes, unsigned max_alignment_diff)
template<typename I >
void connect_horizontal_lines (const mln::util::array< int > &aligned_cols, mln::util::couple< mln::util::array< box< typename I::site > >, mln::util::array< box< typename I::site > > > &tablebboxes, const Image< I > &input, unsigned max_distance)
template<typename I >
void connect_vertical_lines (const mln::util::array< int > &aligned_rows, mln::util::couple< mln::util::array< box< typename I::site > >, mln::util::array< box< typename I::site > > > &tablebboxes, const Image< I > &input, unsigned max_distance)
template<typename I , typename L >
mln::trait::concrete< I >::ret erase (const Image< I > &input, const component_set< L > &hlines, const component_set< L > &vlines)
template<typename I , typename V >
mln::util::couple< typename
mln::trait::ch_value< I, V >
::ret, mln::util::couple
< mln::util::array< box
< typename I::site >
>, mln::util::array< box
< typename I::site > > > > 
extract (const Image< I > &input_, V &ncells)
template<typename I , typename L >
mln::util::couple< L,
mln::util::couple
< component_set< L >
, component_set< L > > > 
rebuild (const Image< I > &input, const component_set< L > &vlines, const component_set< L > &hlines, unsigned max_dist_lines, typename L::value &ncells)
template<typename I >
void repair_horizontal_lines (const Image< I > &input, mln::util::couple< mln::util::array< box< typename I::site > >, mln::util::array< box< typename I::site > > > &tablebboxes, unsigned max_discontinuity)
template<typename I >
void repair_vertical_lines (const Image< I > &input, mln::util::couple< mln::util::array< box< typename I::site > >, mln::util::array< box< typename I::site > > > &tablebboxes, unsigned max_discontinuity)

Detailed Description

Namespace of routines working on tables.

Function Documentation

template<typename I , typename L >
mln::util::array<int> scribo::table::align_lines_horizontaly ( const Image< I > &  input,
const component_set< L > &  lines,
component_set< L > &  aligned_lines,
unsigned  max_alignment_diff 
)

Align line bounding boxes horizontaly.

Parameters
[in]inputImage from which the line bboxes are extracted from.
[in]linesComponent set corresponding to table lines.
[in,out]aligned_linesComponent set where aligned table lines are stored.
[in]max_alignment_diffmax space between two lines to consider they are potentialy on the same line.
Returns
A list of the resulting aligned rows. Each integer is actually a row number.
template<typename I >
mln::util::array<int> scribo::table::align_lines_verticaly ( const Image< I > &  input,
mln::util::array< box< typename I::site > > &  line_bboxes,
unsigned  max_alignment_diff 
)

Align line bounding boxes verticaly.

Parameters
[in]inputImage from which the line bboxes are extracted from.
[in,out]line_bboxesvertical lines bounding boxes.
[in]max_alignment_diffmax space between two lines to consider they are potentialy on the same line.
Returns
A list of the resulting aligned cols. Each integer is actually a col number.
template<typename I >
void scribo::table::connect_horizontal_lines ( const mln::util::array< int > &  aligned_cols,
mln::util::couple< mln::util::array< box< typename I::site > >, mln::util::array< box< typename I::site > > > &  tablebboxes,
const Image< I > &  input,
unsigned  max_distance 
)

Connect horizontal lines with the new aligned columns.

Parameters
[in]aligned_colsa list of new aligned cols.
[in,out]tablebboxesthe vertical and horizontal lines bounding boxes.
[in]inputThe image from where the lines are extracted.
[in]max_distancemax distance allowed between a vertical and horizontal lines.
template<typename I >
void scribo::table::connect_vertical_lines ( const mln::util::array< int > &  aligned_rows,
mln::util::couple< mln::util::array< box< typename I::site > >, mln::util::array< box< typename I::site > > > &  tablebboxes,
const Image< I > &  input,
unsigned  max_distance 
)

Connect vertical lines with the new aligned rows.

Parameters
[in]aligned_rowsa list of new aligned rows.
[in,out]tablebboxesthe vertical and horizontal lines bounding boxes.
[in]inputThe image from where the lines are extracted.
[in]max_distancemax distance allowed between a vertical and horizontal lines.
template<typename I , typename L >
mln::trait::concrete< I >::ret scribo::table::erase ( const Image< I > &  input,
const component_set< L > &  hlines,
const component_set< L > &  vlines 
)

Erase vertical and horizontal lines from an image.

Parameters
[in]inputA binary image from which the table lines are extracted.
[in]hlinesA component set with horizontal lines.
[in]vlinesA component set with vertical lines.
Returns
A copy of in where the table lines are removed.
template<typename I , typename V >
mln::util::couple<typename mln::trait::ch_value< I , V >::ret, mln::util::couple<mln::util::array<box<typename I ::site> >, mln::util::array<box<typename I ::site> > > > scribo::table::extract ( const Image< I > &  input_,
V &  ncells 
)

Extract tables from a binary image.

Use arbitrary criterions.

template<typename I , typename L >
mln::util::couple<L, mln::util::couple<component_set<L>, component_set<L> > > scribo::table::rebuild ( const Image< I > &  input,
const component_set< L > &  vlines,
const component_set< L > &  hlines,
unsigned  max_dist_lines,
typename L::value ncells 
)

Rebuild a table from its line bounding boxes.

Parameters
[in]inputA binary image.
[in]vlinesComponent set corresponding to vertical lines.
[in]hlinesComponent set corresponding to horizontal lines.
[in]max_dist_linesThe maximum distance allowed between vertical and horizontal lines to connect them eachother.
[out]ncellsStore the number of cells found in the rebuilt tables.
Returns
A couple. The first argument is a label image in which each table cell is labeled. The second argument are the aligned and connected table line bounding boxes.
template<typename I >
void scribo::table::repair_horizontal_lines ( const Image< I > &  input,
mln::util::couple< mln::util::array< box< typename I::site > >, mln::util::array< box< typename I::site > > > &  tablebboxes,
unsigned  max_discontinuity 
)

Repair horizontal lines which have small discontinuities.

-— -— ==> -------—

Parameters
[in]inputImage from which the table bounding boxes are extracted.
[in,out]tablebboxesTable line bounding boxes.
[in]max_discontinuityRepair discontinuity which are smaller than this value.
template<typename I >
void scribo::table::repair_vertical_lines ( const Image< I > &  input,
mln::util::couple< mln::util::array< box< typename I::site > >, mln::util::array< box< typename I::site > > > &  tablebboxes,
unsigned  max_discontinuity 
)

Repair vertical lines which have small discontinuities.

| |
| |
==> |
| |
| |

Parameters
[in]inputImage from which the table bounding boxes are extracted.
[in,out]tablebboxesTable line bounding boxes.
[in]max_discontinuityRepair discontinuity which are smaller than this value.