Commit 48849ed3 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Improve documentation of Scribo.

	* doc/scribo/binarization/binarization.dox,
	* doc/scribo/binarization/kim.dox,
	* doc/scribo/binarization/otsu.dox,
	* doc/scribo/binarization/wolf.dox,
	* doc/scribo/core/component_set.dox,
	* doc/scribo/filter/component_groups.dox,
	* doc/scribo/filter/component_links.dox,
	* doc/scribo/filter/components.dox,
	* doc/scribo/filter/elements.dox,
	* doc/scribo/filter/line_links.dox,
	* doc/scribo/filter/paragraphs.dox,
	* doc/scribo/primitive/extract/separators.dox,
	* scribo/core/component_info.hh,
	* scribo/core/tag/component.hh: Add more documentation.

	* doc/scribo/layout/layout.dox,
	* doc/scribo/namespaces.dox,
	* doc/scribo/primitive/extract/components.dox,
	* doc/scribo/primitive/extract/extract.dox: New.

	* scribo/binarization/internal/local_threshold_core.hh,
	* scribo/binarization/internal/singh_formula.hh,
	* scribo/binarization/kim.hh,
	* scribo/binarization/niblack_fast.hh,
	* scribo/binarization/niblack_threshold.hh,
	* scribo/binarization/otsu.hh,
	* scribo/binarization/otsu_threshold.hh,
	* scribo/binarization/sauvola_ms_split.hh,
	* scribo/binarization/singh.hh,
	* scribo/binarization/wolf.hh,
	* scribo/binarization/wolf_fast.hh,
	* scribo/core/component_set.hh,
	* scribo/core/concept/serializable.hh,
	* scribo/core/object_links.hh,
	* scribo/debug/logger.hh,
	* scribo/filter/paragraphs_in_borders.hh,
	* scribo/filter/separators_in_borders.hh,
	* scribo/filter/separators_vert_in_borders.hh,
	* scribo/layout/xy_cut.hh,
	* scribo/primitive/extract/components.hh,
	* scribo/primitive/extract/lines_v_single.hh,
	* scribo/subsampling/bilinear.hh,
	* scribo/text/merging_hdoc.hh: Fix existing documentation.
parent 1ec09726
2013-03-20 Guillaume Lazzara <z@lrde.epita.fr>
Improve documentation of Scribo.
* doc/scribo/binarization/binarization.dox,
* doc/scribo/binarization/kim.dox,
* doc/scribo/binarization/otsu.dox,
* doc/scribo/binarization/wolf.dox,
* doc/scribo/core/component_set.dox,
* doc/scribo/filter/component_groups.dox,
* doc/scribo/filter/component_links.dox,
* doc/scribo/filter/components.dox,
* doc/scribo/filter/elements.dox,
* doc/scribo/filter/line_links.dox,
* doc/scribo/filter/paragraphs.dox,
* doc/scribo/primitive/extract/separators.dox,
* scribo/core/component_info.hh,
* scribo/core/tag/component.hh: Add more documentation.
* doc/scribo/layout/layout.dox,
* doc/scribo/namespaces.dox,
* doc/scribo/primitive/extract/components.dox,
* doc/scribo/primitive/extract/extract.dox: New.
* scribo/binarization/internal/local_threshold_core.hh,
* scribo/binarization/internal/singh_formula.hh,
* scribo/binarization/kim.hh,
* scribo/binarization/niblack_fast.hh,
* scribo/binarization/niblack_threshold.hh,
* scribo/binarization/otsu.hh,
* scribo/binarization/otsu_threshold.hh,
* scribo/binarization/sauvola_ms_split.hh,
* scribo/binarization/singh.hh,
* scribo/binarization/wolf.hh,
* scribo/binarization/wolf_fast.hh,
* scribo/core/component_set.hh,
* scribo/core/concept/serializable.hh,
* scribo/core/object_links.hh,
* scribo/debug/logger.hh,
* scribo/filter/paragraphs_in_borders.hh,
* scribo/filter/separators_in_borders.hh,
* scribo/filter/separators_vert_in_borders.hh,
* scribo/layout/xy_cut.hh,
* scribo/primitive/extract/components.hh,
* scribo/primitive/extract/lines_v_single.hh,
* scribo/subsampling/bilinear.hh,
* scribo/text/merging_hdoc.hh: Fix existing documentation.
2013-03-20 Guillaume Lazzara <z@lrde.epita.fr>
Replace \fixme with FIXME.
......
/*! \defgroup grpalgobin Binarization
*
* \brief Binarization algorithms.
*
* \ingroup grproutine
\brief Binarization algorithms.
\ingroup grproutine
*/
/*! \defgroup grpalgobinkim Kim
\brief Kim's Binarization implementations.
This algorithms performs a first rough binarization on the input
(here we use Sauvola's method). Then text lines are roughly
detected by grouping connected components. For each text lines,
character thickness and x height is computed. Finally, each
lines is binarized again, using text features as parameters for
adjusting the final threshold.
This algorithms considers that global and local statistics
should be used to compute a threshold in text areas.
This is an improvement of Sauvola's method.
This implementation is based on the paper "Multi-Window
Binarization of Camera Image for Document Recognition", In-Jung
Kim, Proceedings of the 9th International Workshop on Frontiers
in Handwriting Recognition (IWFHR-9 2004)
\ingroup grpalgobin
*/
/*! \defgroup grpalgobinotsu Otsu
*
* \brief Otsu's Binarization implementations.
*
* \ingroup grpalgobin
\brief Otsu's Binarization implementations.
This implementation is based on Ocropus's implementation.
http://code.google.com/p/ocropus/
\ingroup grpalgobin
*/
/*! \defgroup grpalgobinwolf Wolf
*
* \brief Wolf's Binarization implementations.
*
* \ingroup grpalgobin
*/
/*!
\class scribo::component_set
This structure is used to store rich information related to
components in an image.
It can be constructed directly from a labeled image and the number
of components, or using primitive::extract::components (easier and
recommanded) with a binary image.
\code
mln::image2d<bool> ima;
mln::io::pbm::load(ima, "document.pbm");
typedef scribo::def::lbl_type V;
typedef mln::image2d<V> L;
V ncomps;
component_set<L> comps = primitive::extract::components(ima, c4(), ncomps);
\endcode
Each component is associated to an id, \ref component_id_t. This
id is equivalent to the component label in the label image (\ref
labeled_image()).
A component_set is considered as valid if it has been initialized
(i.e. not instantiated with the default constructor).
On construction, information is automatically computed for each
components. To iterate over all the components and get that
information, use operator()() or info():
\code
for_all_comps(c,comps)
{
const scribo::component_info<L>& comp_info = comps.info(c);
// Some code here...
}
\endcode
Among component information, a component::Tag tag is stored and
used to mark specific components. This tag can be massively
updated for all components using update_tags(). The function
passed to this method must implement the following interface:
\code
template <typename L>
struct my_function
: mln::Function_v2b< my_function<L> >
{
// Constructor
my_function(const scribo::component_set<L>& components)
: components_(components)
{
}
// Core function
bool operator()(const mln_value(L)& l) const
{
if (l == mln::literal::zero)
return false;
return true;// your test here
}
/// Component set.
scribo::component_set<L> components_;
};
\endcode
Tags can be used to filter/make a selection of
components. Routines performing this selection/filtering
automatically are listed in \ref grpalgofiltercomp section.
Components considered as separators in the input image (lines,
blocks, ...) may be processed separately and are useful of the
rest of the layout analysis. This structure allows you to store a
binary image of separators which will be used in some routines to
prevent wrong regrouping. Note that no component information will
be computed for separators. The separator image can be managed
with has_separators(), add_separators(), separators(), and
clear_separators().
scribo::component_set is the first data structure in the
hierarchical representation of a document as explained in \ref
grpstruct.
\sa component_info, component::Tag, component::Type, grpstruct,
grpalgofiltercomp.
*/
\ No newline at end of file
/*! \defgroup grpalgofiltercompgroup Component Groups
/*! \defgroup grpalgofiltercompgroup Component Group Filtering
*
* \brief Component groups filtering routines.
*
......
/*! \defgroup grpalgofiltercomplink Component Links
/*! \defgroup grpalgofiltercomplink Component Link Filtering
*
* \brief Component links filtering routines.
*
......
/*! \defgroup grpalgofiltercomp Components
/*! \defgroup grpalgofiltercomp Component Filtering
*
* \brief Component filtering routines.
*
......
/*! \defgroup grpalgofilterelt Elements
/*! \defgroup grpalgofilterelt Element Filtering
*
* \brief Elements filtering routines.
*
......
/*! \defgroup grpalgofilterlinelink Line Links
/*! \defgroup grpalgofilterlinelink Line Link Filtering
*
* \brief Line links filtering routines.
* \brief Line link filtering routines.
*
* \ingroup grpalgofilter
*/
/*! \defgroup grpalgofilterpar Paragraphs
/*! \defgroup grpalgofilterpar Paragraph Filtering
*
* \brief Paragraphs filtering routines.
* \brief Paragraph filtering routines.
*
* \ingroup grpalgofilter
*/
/*! \defgroup grpalgolayout Layout Analysis
*
* \brief Document Layout Analysis algorithms.
*
* \ingroup grproutine
*/
/*! \namespace scribo
\brief The main namespace of the Scribo module.
*/
/*! \namespace scribo::component
\brief Namespace of classes related to components.
*/
\ No newline at end of file
/*! \defgroup extractprimitivecomps Components Extraction
\brief All routines/algorithms to extract components.
\ingroup grproutine
*/
\ No newline at end of file
/*! \defgroup extractprimitive Primitive Extraction
\brief All routines/algorithms to extract primitive objects.
\ingroup grproutine
*/
\ No newline at end of file
/*! \defgroup extractprimitiveseps Lines and Separators extraction
*
* \brief All routines/algorithms to extract lines and separators.
*
* \ingroup grproutine
\brief All routines/algorithms to extract lines and separators.
\ingroup extractprimitive
*/
......@@ -69,9 +69,9 @@ namespace scribo
/*! \brief Run Sauvola core algorithm. Use functor \p f to
compute the threshold and perform computation.
\input[in] input An image.
\input[in] f Functor computing Sauvola's formula.
\input[in] window_size The window size.
\param[in] input An image.
\param[in] f Functor computing Sauvola's formula.
\param[in] window_size The window size.
*/
template <typename I, typename F>
......
// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2012, 2013 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -59,20 +60,18 @@ namespace scribo
/*! \brief Compute a threshold using Singh's formula.
\param[in] v The current image value.
\param[in] m_x_y Mean value.
\param[in] s_x_y Standard deviation.
\param[in] k Control the threshold value in the local
\param[in] K Control the threshold value in the local
window. The higher, the lower the threshold
form the local mean m(x, y).
\param[in] R Maximum value of the standard deviation (128
for grayscale documents).
\return A threshold.
*/
double operator()(const V& v, const double m_x_y, const double K) const;
/*!
\overload K = 0.34.
/*! \overload
K = 0.34.
*/
double operator()(const V& v, const double m_x_y) const;
......
// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2012, 2013 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
//
......@@ -46,27 +47,14 @@ namespace scribo
/*! \brief Kim's binarization
This algorithms performs a first rough binarization on the input
(here we use Sauvola's method). Then text lines are roughly
detected by grouping connected components. For each text lines,
character thickness and x height is computed. Finally, each
lines is binarized again, using text features as parameters for
adjusting the final threshold.
This algorithms considers that global and local statistics
should be used to compute a threshold in text areas.
This is an improvement of Sauvola's method.
\copydetails grpalgobinkim
\param[in] input A gray-level image.
\param[in] window_size the window size to be used for the first
binarization.
\param[in] k Sauvola's formula parameter.
This implementation is based on the paper "Multi-Window
Binarization of Camera Image for Document Recognition", In-Jung
Kim, Proceedings of the 9th International Workshop on Frontiers
in Handwriting Recognition (IWFHR-9 2004)
\ingroup grpalgobinkim
*/
template <typename I>
mln_ch_value(I, bool)
......@@ -74,6 +62,8 @@ namespace scribo
/*! \overload
k is set to SCRIBO_DEFAULT_SAUVOLA_K.
\ingroup grpalgobinkim
*/
template <typename I>
mln_ch_value(I, bool)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment