$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
scribo::toolchain::internal::text_in_doc_preprocess_functor< I > Struct Template Reference

#include <scribo/toolchain/internal/text_in_doc_preprocess_functor.hh>

Public Member Functions

virtual int nsteps () const
virtual void on_end ()
virtual void on_new_progress_label (const char *label)
virtual void on_progress ()
virtual void on_start ()
mln::trait::ch_value< I, bool >
::ret 
operator() (const Image< I > &input_)

Public Attributes

mln::trait::concrete< I >::ret bg
Binarization_Algo binarization_algo
bool enable_denoising
bool enable_deskew
bool enable_fg_extraction
bool enable_subsample
mln::trait::concrete< I >::ret fg
mln::util::timer gt
unsigned lambda
image2d< booloutput
double sauvola_k2
double sauvola_k3
double sauvola_k4
unsigned sauvola_win
mln::util::timer t
bool verbose

Detailed Description

template<typename I>
struct scribo::toolchain::internal::text_in_doc_preprocess_functor< I >

Functor performing custom preprocessing algorithms on documents.

Whatever the options selected, this functor converts an input image into a graylevel image and try to binarize the latter.

Optional algorithms can be performed too:

  • Subsampling (enable_subsample), disabled by default.
  • Extract Background/Foreground (enable_fg_extraction), split background and foreground objects, disabled by default.
  • Deskew (enable_deskew), disabled by default.
  • Denoise (enable_denoise), enabled by default.

The binarization algorithm can be chosen through binarization_algo option. It can be one of the algorithms detailed in enum Binarization_Algo.

Few parameters can be set for algorithms:

  • Sauvola Multi-scale: sauvola_win, the window size used in Sauvola based algorithms (default 101). sauvola_K2, a user parameter for Sauvola's threshold formula at scale 2. (default 0.34). sauvola_K3, a user parameter for Sauvola's threshold formula at scale 3. (default 0.34). sauvola_K4, a user parameter for Sauvola's threshold formula at scale 4. (default 0.34).
  • Extract background/foreground lambda, the maximum area of the possible foreground objects (default 0, auto).

Definition at line 115 of file text_in_doc_preprocess_functor.hh.