Olena-patches
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
October 2010
- 5 participants
- 154 discussions
* configure.ac: New.
* configure.gnu: New.
* Makefile.am (ACLOCAL_AMFLAGS): New.
(EXTRA_DIST): Add configure.gnu and img/lena.pgm.
* AUTHORS: New.
* README: New.
* NEWS: New (imported from Olena and updated).
* COPYING: New (imported from Olena).
* INSTALL: New (generated by Automake).
* run.mk: Adjust paths.
* m4/pypath.m4, m4/swig.m4: New (imported from Olena).
* img/lena.pgm: New (imported from Milena).
* python/Makefile.am: Adjust paths.
(%-wrap.cc %.py): Likewise.
(MILENA_CPPFLAGS): New. Use it...
(AM_CPPFLAGS, AM_SWIGFLAGS): ...here.
(TOOLS_CXXFLAGS): Remove. Superseded by
(SWILENA_CXXFLAGS): ...this (new) variable.
(AM_CXXFLAGS): Adjust.
* python/data.py: Adjust path.
---
swilena/.gitignore | 18 ++
swilena/AUTHORS | 32 ++++
swilena/COPYING | 1 +
swilena/ChangeLog | 25 +++
INSTALL => swilena/INSTALL | 0
swilena/Makefile.am | 13 ++-
swilena/NEWS | 376 ++++++++++++++++++++++++++++++++++++++++++++
swilena/README | 277 ++++++++++++++++++++++++++++++++
swilena/configure.ac | 168 ++++++++++++++++++++
swilena/configure.gnu | 39 +++++
swilena/img/lena.pgm | 1 +
swilena/m4/pypath.m4 | 6 +
{m4 => swilena/m4}/swig.m4 | 0
swilena/python/Makefile.am | 13 +-
swilena/python/data.py | 4 +-
swilena/run.mk | 9 +-
16 files changed, 968 insertions(+), 14 deletions(-)
create mode 100644 swilena/.gitignore
create mode 100644 swilena/AUTHORS
create mode 120000 swilena/COPYING
copy INSTALL => swilena/INSTALL (100%)
create mode 100644 swilena/NEWS
create mode 100644 swilena/README
create mode 100644 swilena/configure.ac
create mode 100755 swilena/configure.gnu
create mode 120000 swilena/img/lena.pgm
create mode 100644 swilena/m4/pypath.m4
copy {m4 => swilena/m4}/swig.m4 (100%)
diff --git a/swilena/.gitignore b/swilena/.gitignore
new file mode 100644
index 0000000..994b291
--- /dev/null
+++ b/swilena/.gitignore
@@ -0,0 +1,18 @@
+/build-aux/config.guess
+/build-aux/config.sub
+/build-aux/depcomp
+/build-aux/install-sh
+/build-aux/ltmain.sh
+/build-aux/missing
+/build-aux/py-compile
+
+/m4/libtool.m4
+/m4/ltoptions.m4
+/m4/ltsugar.m4
+/m4/ltversion.m4
+/m4/lt~obsolete.m4
+
+/*aclocal.m4
+/autom4te.cache*
+/configure
+/configure.scan
diff --git a/swilena/AUTHORS b/swilena/AUTHORS
new file mode 100644
index 0000000..2e82a7e
--- /dev/null
+++ b/swilena/AUTHORS
@@ -0,0 +1,32 @@
+This package was written by and with the assistance of
+
+==================
+Active LRDE Staff.
+==================
+
+* Guillaume Lazzara z(a)lrde.epita.fr
+* Roland Levillain roland(a)lrde.epita.fr
+
+================================
+Past contributors of LRDE Staff.
+================================
+
+* Akim Demaille akim(a)lrde.epita.fr
+
+=========
+Students.
+=========
+
+* Nicolas Burrus
+* David Lesage
+* Giovanni Palma
+* Raphaël Poss
+* Damien Thivolle
+* Niels Van Vliet
+* Astrid Wang
+
+
+.. Local Variables:
+.. mode: rst
+.. ispell-local-dictionary: "american"
+.. End:
diff --git a/swilena/COPYING b/swilena/COPYING
new file mode 120000
index 0000000..012065c
--- /dev/null
+++ b/swilena/COPYING
@@ -0,0 +1 @@
+../COPYING
\ No newline at end of file
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index 6d31d60..37c591f 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,5 +1,30 @@
2010-10-25 Roland Levillain <roland(a)lrde.epita.fr>
+ Autoconfiscate Swilena.
+
+ * configure.ac: New.
+ * configure.gnu: New.
+ * Makefile.am (ACLOCAL_AMFLAGS): New.
+ (EXTRA_DIST): Add configure.gnu and img/lena.pgm.
+ * AUTHORS: New.
+ * README: New.
+ * NEWS: New (imported from Olena and updated).
+ * COPYING: New (imported from Olena).
+ * INSTALL: New (generated by Automake).
+ * run.mk: Adjust paths.
+ * m4/pypath.m4, m4/swig.m4: New (imported from Olena).
+ * img/lena.pgm: New (imported from Milena).
+ * python/Makefile.am: Adjust paths.
+ (%-wrap.cc %.py): Likewise.
+ (MILENA_CPPFLAGS): New. Use it...
+ (AM_CPPFLAGS, AM_SWIGFLAGS): ...here.
+ (TOOLS_CXXFLAGS): Remove. Superseded by
+ (SWILENA_CXXFLAGS): ...this (new) variable.
+ (AM_CXXFLAGS): Adjust.
+ * python/data.py: Adjust path.
+
+2010-10-25 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix Swilena's dependency tracking.
* python/Makefile.am (%-wrap.cc %.py): Honor Automake's `AMDEP'
diff --git a/INSTALL b/swilena/INSTALL
similarity index 100%
copy from INSTALL
copy to swilena/INSTALL
diff --git a/swilena/Makefile.am b/swilena/Makefile.am
index 109fb2e..f696032 100644
--- a/swilena/Makefile.am
+++ b/swilena/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+# Laboratory (LRDE).
#
# This file is part of Olena.
#
@@ -14,8 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
+ACLOCAL_AMFLAGS = -I m4
+
SUBDIRS = python
+# `configure' wrapper used in recursive configuration.
+EXTRA_DIST = configure.gnu
+
# Meta-wrappers (templates), not generating a module, but factoring
# common parts.
meta_wrappers = \
@@ -50,6 +56,9 @@ wrappers = \
\
dynamic_image2d.i
-EXTRA_DIST = $(meta_wrappers) $(wrappers)
+EXTRA_DIST += $(meta_wrappers) $(wrappers)
+
+# Images used in tests.
+EXTRA_DIST += img/lena.pgm
check_SCRIPTS = run
diff --git a/swilena/NEWS b/swilena/NEWS
new file mode 100644
index 0000000..2054481
--- /dev/null
+++ b/swilena/NEWS
@@ -0,0 +1,376 @@
+* Swilena 1.0a
+
+ * Starting with Olena 1.1, Swilena is an independent component
+ of the project, distributed both together with the Olena
+ package and as a standalone package.
+
+ * Misc fixes and improvements.
+
+
+* Olena 1.0 July 14, 2009
+
+ * The core C++ library, renamed to Milena, has been rewritten from
+ scratch and features numerous additions over the past releases.
+ Some features have also been dropped or disabled, and some of them
+ will be reintegrated in future releases. The programming
+ interface has changed from previous versions, but most programs
+ using Olena 0.11 can be adapted to the Olena 1.0 API.
+
+ * Milena uses a simplified version of the SCOOP 2 paradigm
+ (informally called SCOOP 1.5), to improve the speed of compilation
+ and make developing easier while still providing very good
+ run-time performances.
+
+ * A first (re)implementation of Swilena featuring Python wrappers
+ for a very small subset of Milena is available. The bundled
+ Swilena Python Shell (sps) allows interactive Olena sessions.
+
+ * A reference documentation including a tutorial and a quick
+ reference guide have been started. They do not cover the whole
+ Milena library yet.
+
+ * Olena includes some demos and applications using Milena.
+
+
+* Olena 0.11 February 21, 2007
+
+ * The whole Olena distribution compiles with the GNU C++
+ Compiler (G++) 4.0 and 4.1. The compatibility with previous
+ versions of the compiler has been broken.
+
+ * Revamp of Swilena.
+ The Swilena wrappers have been repaired, as they had become
+ incompatible with recent versions of SWIG, G++, Python and Ruby.
+ Moreover, a lot of small bugs have been fixed in Swilena.
+ The test suite of Rblena, the Ruby wrappers for Olena, has
+ been completed and is comparable to Pylena's (the Python
+ wrappers for Olena).
+
+ * Libtool.
+ The whole package uses GNU Libtool to handle libraries.
+ Swilena benefits this, and uses Libtool to create shared
+ libraries upon which SWIG wrappers are built.
+
+ * Miscellaneous corrections in Olena and Integre, as well as in
+ their test suites.
+
+
+* Olena 0.10 April 15, 2004
+
+ * New documentation system.
+ Now any comment should use Doxygen style (i.e. /*! ... */).
+ You can also write some programs inside the comments. They are
+ compiled at documentation generation time. It is useful to
+ illustrate some algorithms with concrete input and output. To
+ use this feature the program has to be between \code and \endcode
+ tags. If you produce an image, you can include it in the comments
+ with the \image command, using the same name you used to produce
+ it, but with the png extension. To make sure your image will not
+ overwrite another existing one, you should name it taking care of
+ the namespace you are using: e.g. if you comment the function
+ oln::boo::bar::fun, the image should be named oln_foo_bar_fun.ppm.
+ The macros IMG_IN and IMG_OUT correspond to the path of the images.
+
+ * Border behavior can be controlled with the behavior hierarchy.
+ If an algorithm support it, you can choose the way the image
+ border will be seen. Three behaviors are available: mirror,
+ replicate or user defined value.
+
+ * Attribute opening/closing enhancement
+ - Make the algorithm more generic.
+ - Add a lot of attributes (area, disk, square, dist,
+ rectangle, volume, height, maxvalue, minvalue).
+
+ * Change the color conversion system
+ - CIE RGB is the main color system i.e. it can be converted
+ directly into any other color system.
+ - Conversion between 2 color systems should pass by the RGB one.
+
+ * Generic and concrete morphers are now implemented in Olena.
+ - Five morphers are included in this release:
+ Color morpher
+ Sub quantifying morpher
+ Piece morpher
+ Iter morpher
+ Slicing morpher
+ - These morphers can be manipulated as if they were normal images.
+
+
+* Olena 0.9 August 8, 2003
+
+ * New static hierarchy paradigm
+ - Complete rewrite of the image hierarchy.
+ - The new hierarchy benefits from multiple inheritance and
+ diamond constructs.
+ - Objects' abstract interfaces made available, leading to
+ safer and easier algorithm writing.
+ - Label images such as binary_image or vectorial_image added.
+
+ * Partial rewrite of images I/O
+ - Support for 1d, 3d images and windows.
+ - Better handling of built-in types.
+
+ * Color conversions fixed and improved.
+
+ * Cleanup and coding style conformance.
+
+ * Many bug fixes.
+ * Improved test-suite.
+
+
+* Olena 0.8 April 10, 2003
+
+ IMPORTANT NOTE: This version is not compatible with older
+ versions of Olena. The project has been split into three part,
+ so many header files have moved and new namespaces have been
+ created. Please read the UPGRADING file for more information.
+
+ * Many source code cleanups.
+ * The source code has been split into 3 parts: image
+ processing (olena/), data types (integre/) and meta-programming
+ tools (metalic/).
+ * First part of the new static hierarchy paradigm implementation.
+ * Support for combinatorial maps.
+ * Many bug fixes.
+
+
+* Olena 0.7 February 10, 2003
+
+ * Manual pages for the command-line utilities.
+ * New, saner, source tree layout.
+ * Each `part' of the source tree can be excluded from the
+ build process with configuration flags.
+ * New `oln.m4' file for use by autoconf'ed user projects.
+ * Major documentation updates.
+ * New `oln-config.sh' scripts for user Makefiles.
+ * Olena now works on Mac OS X, NetBSD, FreeBSD and Cygwin.
+
+
+* Olena 0.6 January 15, 2003
+
+ * Complete rewriting of data types.
+ * Command line utilities.
+ * Fully implementation of convolutions
+ * Fast Fourier Transform (FFT)
+ * Discrete Wavelet Transform (Daubechie's wavelet) (DWT)
+ * Many bug fixes.
+
+
+* Olena 0.5 July 25, 2002
+
+ * Documentation in LaTeX (instead of Texinfo).
+ * Support reading/writing gziped images
+ (include <oln/io/gz.hh> and link with libz).
+ * Complete rewrite of the static arrays
+ (meta::array1d, meta::array2d, meta::array3d).
+ * Preliminary implementation of convolutions
+ (oln::convol::convolve)
+ * All headers should now be referenced with the `oln/' prefix,
+ as in `#include <oln/basics2d.hh>'.
+ * New conversion operator: convert::stretch.
+ * Many bug fixes.
+
+
+* Olena 0.4.1 April 25, 2002
+
+ * Buglet in the 0.4 Makefiles.
+
+
+* Olena 0.4 April 24, 2002
+
+ * New morpho:: operators:
+ - thinning
+ - thickening
+ * New convert:: operators:
+ - ng_to_se
+ - ng_to_cse
+ * First sketch of a test suite.
+ * Many bug fixes.
+
+
+* Olena 0.3 January 14, 2002
+
+ * fast_morpho() speeded-up.
+ * Minor bug fixes.
+ * "Documentation" updates.
+
+
+* Olena 0.2b December 13, 2001
+
+ * Value:
+ - Support for HSL and HSV color systems.
+ - Define internal::default_less<vec<N,T>>.
+
+ * Core:
+ - New window generator: mk_win_ellipse, mk_win_disc,
+ mk_win_ellipsoid, and mk_win_ball.
+
+ * Various #include fixes.
+
+
+* Olena 0.2 November 28, 2001
+
+ * Color:
+ - nrgb_8, nrgb_16, nrgb_32: new types for NTSC RGB. The
+ conversion from and to YIQ and HSI which assumed NTSC RGB
+ has been adjusted to actually use nrgb_* (instead of rgb_*)
+ and renamed accordingly.
+ - yuv_8, yuv_16, yuv_32: New types.
+
+ The currently available conversions are
+
+ hsi yuv
+ \ /
+ rgb -- nrgb
+ \ / \
+ xyz yiq
+
+ * Various cleanups and bug fixes. Especially:
+ - border handling (mirroring, copying) simplified and fixed.
+ - ++k, --k: return a value with the same type as k.
+
+ * I/O:
+ - pnm/P1, pnm/P3, and pnm/P6 support for image_3d.
+
+
+* Olena 0.1f November 22, 2001
+
+ * Core:
+ - Several bug fixes in memory handling.
+
+ * Types:
+ - New color types: HSI, YIQ; with conversions to and from RGB.
+ - `min()' and `max()' are now defined with the types (i.e.
+ not in math/macros.hh), along with the other operators.
+ Also, these procedures will two arguments of different
+ types.
+
+ * Casts:
+ - `cast::round': similar to C's round()
+ - `cast::rbound': ditto, but constrained to fit the
+ output type's range.
+
+ * I/O:
+ - Support for `image_3d<int_u<N> >' (as PNM P2 & P5).
+
+ * Processings
+ - `level::is_greater_or_equal', `level::is_greater',
+ `level::is_lower_or_equal', `level::is_lower',
+ `level::is_equal': Comparisons between images.
+ - `level::connected_component': Number connected components.
+ - `morpho::geodesic_dilation', `morpho::simple_geodesic_dilation'.
+ - `morpho::geodesic_erosion', `morpho::simple_geodesic_erosion'.
+ - `morpho::get_plus_se_only', `morpho::get_plus_se_p',
+ `morpho::get_minus_se_only', `morpho::get_minus_se_p': Split
+ a structural element in a `plus' (lexically before than the center)
+ and `minus' (after).
+
+ * Misc:
+ - `utils::timer': for benchmarking
+ - `level::lut', `level::hlut': Lookup tables.
+
+
+* Olena 0.1d November 15, 2001
+
+ * Core:
+ - `point's, `dpoint's, and `image_size's feature a `nth()' method,
+ that returns the value of the nth coordinate.
+ - `fold': new high order operator.
+
+ * Types:
+ - `vec<N,T>' uses an array to store its elements
+ and accepts builtin types.
+ - `rgb<T>' has been replaced by `rgb_8', `rgb_16', `rgb_32'
+ - `xyz_8', `xyz_16', `xyz_32' are new types.
+ - the latter six types are instances of the `color' type.
+
+ * Processings:
+ - All basic morphological processings (`opening',
+ `hit_or_miss', `beucher_gradient', etc.) from namespace
+ `morpho::' have their fast equivalent in namespace
+ `morpho::fast::'.
+ - `convert::apply' is similar to `apply' but will work
+ for all types of conversions while `apply' can only work
+ on `conversion_to_type' conversions.
+
+ * Tools:
+ - `utils::fill': fill an image
+ - `utils::f_moments', `utils::f_minmax': statistical functors.
+
+ * Casts:
+ - `cast::bound': similar to `convert::bound'.
+
+ * I/O:
+ - It's possible to load and save as PPM any kind of image2d
+ whose color has 3 components on 8 bits.
+
+
+* Olena 0.1b November 8, 2001
+
+ * New type: rgb<T>
+
+ * New processings:
+ - morpho::watershed_con
+ - convol::fast::gaussian
+ - convol::fast::gaussian_derivative
+ - convol::fast::gaussian_second_derivative
+
+ * Conversion are organized in the following hierarchy
+
+ conversion<Inferior>
+ ^
+ |
+ conversion_to_type<To,Inferior>
+ ^
+ |
+ conversion_from_type_to_type<From,To,Inferior>
+
+ All children of conversion_from_type_to_type are models of
+ Adaptable Unary Function. See conversion.hh for more comments.
+
+ * The only two functions that perform file i/o are `load' and
+ `save'. The other functions (`read', `write', `read_pnm',
+ `write_pnm') have been removed.
+
+ * image2d<rgb<int_u8> > can be loaded and saved as ppm.
+
+ * All iterators support a new method, cur(), that returns
+ the current point (or dpoint). It is meant to be used
+ at places where the compiler is unable to implicitly convert
+ an iterator into a point (or dpoint).
+
+ * Bug fixes:
+ - Olena now compiles successfully with -pedantic.
+ - `image2d<int_u8> lena = load("lena.pgm");' works.
+ - Multiplications and subtractions on 'vec' no longer
+ perform additions.
+
+
+* Olena 0.1 November 1, 2001
+
+ * Initial public release.
+
+
+Local Variables:
+mode: outline
+ispell-local-dictionary: "american"
+End:
+
+----
+
+Copyright (C) 2001, 2002, 2003, 2004, 2007, 2009, 2010 EPITA Research and
+Development Laboratory (LRDE)
+
+This file is part of Olena.
+
+Olena is free software: you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation, version 2 of the License.
+
+Olena is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Olena. If not, see <http://www.gnu.org/licenses/>.
diff --git a/swilena/README b/swilena/README
new file mode 100644
index 0000000..69c7f3e
--- /dev/null
+++ b/swilena/README
@@ -0,0 +1,277 @@
+Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+Laboratory (LRDE)
+
+This file is part of Olena.
+
+Olena is free software: you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation, version 2 of the License.
+
+Olena is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Olena. If not, see <http://www.gnu.org/licenses/>.
+
+The complete GNU General Public License Notice can also be found in
+the 'COPYING' file in the root directory.
+
+
+=======================
+Introduction to Swilena
+=======================
+
+Swilena is a part of Olena_, a generic and efficient platform
+dedicated to image processing.
+
+.. _Olena: http://olena.lrde.epita.fr
+
+Swilena provides bindings of the Milena C++ library (also a part of
+Olena) to other languages (currently Python).
+
+Swilena is distributed in two ways:
+
+ * as a component of the Olena package
+
+ * and a standalone package.
+
+If you obtained Swilena as an project embedded an Olena package, we
+advise you to read Olena's README, at the top-level directory of the
+package, and not to configure nor compile Swilena separately (i.e., do
+not use `swilena/configure', use the top-level `configure' instead
+and run `make' from the top-level directory).
+
+Otherwise, you are in the case of a standalone package, and you might
+want to read the rest of this file.
+
+
+==========================================
+Detailed Instructions (Standalone Package)
+==========================================
+
+-----------------
+Required Software
+-----------------
+
+Here is a non-exhaustive list of required software required to build
+Swilena successfully.
+
+ * to compile the user examples:
+
+ - a POSIX shell, like Bash
+
+ - a decent C++ compiler, like GNU C++
+
+ - a `make' utility, like GNU `make'
+
+ - the Simplified Wrapper and Interface Generator (SWIG_).
+
+ - Python_
+
+.. _SWIG: http://www.swig.org
+
+.. _Python: http://www.python.org
+
+
+If you are using a standalone version of Swilena, you also need a
+working Milena_ install (Milena is shipped with Olena).
+
+.. _Milena: http://olena.lrde.epita.fr
+
+
+-------------
+Configuration
+-------------
+
+In order to prepare the build process, you need to configure the source
+tree.
+
+ Assuming your Swilena distribution is uncompressed in directory
+`swilena-1.1', follow these steps:
+
+ % cd swilena-1.1
+ % mkdir _build
+ % cd _build
+ % ../configure
+
+ The build process can be altered by a number of options you can pass
+to the `configure' script. The following sections describe them.
+
+
+Milena path
+===========
+
+Swilena requires the Milena library. If Swilena's `configure' is
+unable to find your installation of Milena, or if you want to use a
+specific installation, you must help `configure' find it using the
+`--with-milena' flag. For instance, if you have installed Milena in
+`$HOME/local', replace the call to `configure' from the previous
+section by this command:
+
+ % ../configure --with-milena=$HOME/local
+
+
+Installation Path
+=================
+
+By default, Swilena is installed in the standard "local" directory of
+your system. This is usually `/usr/local' under Unix.
+
+ You can change this path with the following flag:
+
+ --prefix=<installation prefix>
+
+
+Compiler Selection and Compilation Flags
+========================================
+
+By default, `configure' will try to use the first C++ compiler it
+encounters on your system. If `CXX' is not set, it will look, in order,
+for:
+
+ - the value of the `CXX' environment variable,
+
+ - the GNU C++ compiler (`g++'),
+
+ - the `c++' or `gpp' commands on your system,
+
+ - `aCC', the HP-UX standard C++ compiler,
+
+ - the `CC', `cxx', `cc++' or `cl' commands on your system,
+
+ - KAI's C++ compiler (`KCC'),
+
+ - `RCC', `xlC_r' or `xlC'.
+
+ You can override the detection system by passing your favorite
+compiler name to `configure', as follows:
+
+ % ../configure CXX=<your-favorite-C++-compiler>
+
+ As an alternative, you can also set the environment variable `CXX'.
+
+
+ For some compilers (GNU g++ and Intel's icpc to some extent) ,
+`configure' will use default CXXFLAGS. You can override the default
+C++ flags by giving `configure' your selection of flags:
+
+ % ../configure CXXFLAGS="<your-favorite-flags>"
+
+
+--------
+Building
+--------
+
+Once your build directory is `configure'd, you can run
+
+ % make
+
+to build Swilena.
+
+
+ Additionally, you can build and run the test suite with:
+
+ % make check
+
+However, this process is time- and memory- consuming, and you probably
+do not need it except if you are developing/debugging Swilena.
+
+
+----------
+Installing
+----------
+
+To install Swilena on your system, run:
+
+ % make install
+
+from the build directory.
+
+ If not overridden with `--prefix', this will install:
+
+ * the Swilena Python Shell (`sps' script) in `/usr/local/bin',
+
+ * Python bindings in `/usr/local/lib/python2.x/site-packages/'.
+
+
+ You can later remove Swilena from your system by running
+
+ % make uninstall
+
+from the build directory (if you have kept it). We recommend the use
+of GNU Stow (or any similar program) during the installation of Swilena,
+to make the uninstallation of Swilena easier.
+
+
+=====================
+Layout of the Tarball
+=====================
+
+The Swilena project directory layout is as follows:
+
+build-aux
+ Auxiliary tools used by the GNU Build System during ``configure``
+ and ``make`` stages.
+
+img
+ Some (2D) images, mostly used for test purpose.
+
+m4
+ Extra Autoconf macros.
+
+python
+ Some Python bindings for Milena.
+
+
+===================
+Supported Platforms
+===================
+
+Swilena has been tested on the following configurations:
+
+=========================== =============================================
+System Compiler
+=========================== =============================================
+GNU/Linux on IA-32 g++ (GNU GCC) 3.3, 4.1, 4.2 and 4.4
+GNU/Linux on IA-32 icpc (Intel C/C++ Compiler) 10.1 and 11.0
+GNU/Linux on AMD64/Intel 64 g++ (GNU GCC) 4.1
+Mac OS X (10.6) on IA-32 g++ (GNU GCC) 4.2.1
+=========================== =============================================
+
+
+See Also
+========
+
+There are other sources of interest in the distribution.
+
+- Headline news about the project can be found in the file ``NEWS`` at
+ the root of the source tree.
+
+
+License
+=======
+
+Swilena is released under the GNU General Public Licence. See the file
+``COPYING`` (at the root of the source tree) for details.
+
+
+Contacts
+========
+
+The team can be reached by mail at olena(a)lrde.epita.fr. The snail
+mail address follows.
+
+* Olena - LRDE
+
+ | Laboratoire de Recherche et Développement de l'EPITA (LRDE)
+ | 14-16 rue Voltaire
+ | FR-94276 Le Kremlin-Bicêtre CEDEX
+ | France
+
+
+
+.. Local Variables:
+.. mode: rst
+.. End:
diff --git a/swilena/configure.ac b/swilena/configure.ac
new file mode 100644
index 0000000..a0c90f3
--- /dev/null
+++ b/swilena/configure.ac
@@ -0,0 +1,168 @@
+# Copyright (C) 2006, 2007, 2008, 2009, 2010 EPITA Research and
+# Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Olena. If not, see <http://www.gnu.org/licenses/>.
+
+m4_pattern_forbid([^OLN_])
+
+AC_PREREQ([2.61])
+
+
+## ---------------- ##
+## Package set up. ##
+## ---------------- ##
+
+AC_INIT([Swilena], [1.0a], [olena(a)lrde.epita.fr] [swilena])
+
+# M4 macros.
+AC_CONFIG_MACRO_DIR([m4])
+
+# Auxiliary files.
+AC_CONFIG_AUX_DIR([build-aux])
+
+# Automake.
+AM_INIT_AUTOMAKE([1.10 subdir-objects check-news dist-bzip2 nostdinc -Wall])
+
+## --------------------- ##
+## C++ compiler set up. ##
+## --------------------- ##
+
+# If the user doesn't provide any CXXFLAGS, prevent Autoconf from
+# settings its own default ones (e.g., `-g -O2' for g++).
+if test ! ${CXXFLAGS+set}; then
+ CXXFLAGS=""
+fi
+
+# Look for a C++ compiler.
+AC_LANG([C++])
+AC_PROG_CXX
+
+# Set `ICPC' to `yes' if the Intel C++ compiler is used.
+test $CXX --version 2>/dev/null | grep '\bICC\b' >/dev/null 2>&1 && ICPC=yes
+
+# GNU C++ compiler setup.
+if test "$GXX" = yes; then
+ # Speed up compiling times.
+ CXXFLAGS="$CXXFLAGS -pipe"
+
+ # The code generated for mln::data::impl::memcpy__() by g++ 4.2 with
+ # a high optimization level (`-O3') and without
+ # `-fno-strict-aliasing' might be wrong, at least with Debian's g++
+ # 4.2 on IA-32 (see also milena/mln/memcpy_.hh). We observed this
+ # behavior with e.g. milena/apps/graph-morpho/samples-image2d.cc.
+ # Note that Debian's g++ 4.0, 4.1, 4.3 and 4.4 are fine.
+ #
+ # So, when the C++ compiler is g++ 4.2, set STRICT_ALIASING_CXXFLAGS
+ # to `-fno-strict-aliasing'.
+ if $CXX --version | head -n 1 | grep '\b4\.2' >/dev/null 2>&1; then
+ STRICT_ALIASING_CXXFLAGS=-fno-strict-aliasing
+ fi
+fi
+AC_SUBST([STRICT_ALIASING_CXXFLAGS])
+
+
+# Adjusting warning options according to compilers.
+AC_ARG_VAR([WARNINGS_CXXFLAGS], [C++ compiler warning flags])
+case "$CXX" in
+ # Intel compiler
+ *icpc*)
+ WARNINGS_CXXFLAGS="-Wall -wd111,193,279,383,444,522,654,810,981,1418"
+ ;;
+ *)
+ WARNINGS_CXXFLAGS="-Wall -W"
+ ;;
+esac
+
+
+## -------- ##
+## Milena. ##
+## -------- ##
+
+# The current approach to providing Swilena a path to Milena's headers
+# is naive: for instance, we cannot provide two paths (source and
+# build dirs) in the case of an Olena build using a parallel build
+# (where srcdir != builddir). Improve if needed.
+
+AC_ARG_WITH([milena],
+ [AC_HELP_STRING([--with-milena=DIR], [path to Milena headers])],
+ [if test x"$with_milena" = xno; then
+ AC_MSG_ERROR([Milena is required for Swilena. Try to invoke configure
+without `--with-milena=no' nor `--without-milena.'])
+ fi])
+if test -n "$with_milena" && test x"$with_milena" != xyes; then
+ MILENA_CPPFLAGS="-I$with_milena"
+fi
+swl_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$MILENA_CPPFLAGS $CPPFLAGS"
+AC_CHECK_HEADER([mln/core/essential.hh], [],
+ AC_MSG_ERROR([Cannot find Milena's headers. Try to invoke configure with
+`--with-milena=DIR'.]))
+CPPFLAGS=$swl_save_CPPFLAGS
+AC_SUBST([MILENA_CPPFLAGS])
+
+
+## --------- ##
+## Swilena. ##
+## --------- ##
+
+# Use Libtool.
+# To be replaced by a call to LT_INIT as soon as Libtool 2.2 is used.
+AC_PROG_LIBTOOL
+
+# Ensure dynamic libraries are enabled.
+if test "x$enable_shared" = xno; then
+ AC_MSG_ERROR([Dynamic libraries are disabled. Try to invoke
+configure with `--enable-shared'.])
+fi
+# Check for SWIG.
+AC_PROG_SWIG([1.3.35])
+if (eval "$SWIG -version") >/dev/null 2>&1; then :; else
+ AC_MSG_ERROR([SWIG 1.3.35 is required for Swilena])
+fi
+# Check for Python.
+AM_PATH_PYTHON([2.4], [],
+ [AC_MSG_ERROR([Python 2.4 is required for Swilena.])])
+AS_VERSION_COMPARE([2.5], [$am_cv_python_version],
+ [AC_MSG_WARN([Python 2.6 and greater may not work with Swilena.])])
+adl_CHECK_PYTHON
+# Check for Python headers.
+save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS -I$PYTHONINC"
+AC_CHECK_HEADERS([Python.h], [],
+ [AC_MSG_ERROR([`Python.h' is required for Swilena.
+Try adding `-I <Python include path>' to `CPPFLAGS'.])])
+CPPFLAGS=$save_CPPFLAGS
+
+AC_ARG_VAR([SWILENA_CXXFLAGS], [C++ compiler flags for tools])
+# We want fast binaries for tools.
+if test -z "$SWILENA_CXXFLAGS"; then
+ if test "$GXX" = yes; then
+ SWILENA_CXXFLAGS="-O3 -DNDEBUG -ggdb $WARNINGS_CXXFLAGS"
+ elif test "$ICPC" = yes; then
+ SWILENA_CXXFLAGS="-O3 -DNDEBUG -g $WARNINGS_CXXFLAGS"
+ fi
+fi
+
+AC_CONFIG_FILES([Makefile
+ python/Makefile])
+
+AC_CONFIG_FILES([run], [chmod +x run])
+
+AC_CONFIG_FILES([python/sps:python/sps-common.in:python/sps.in],
+ [chmod +x python/sps])
+AC_CONFIG_FILES([python/sps-local:python/sps-common.in:python/sps-local.in],
+ [chmod +x python/sps-local])
+
+AC_OUTPUT
diff --git a/swilena/configure.gnu b/swilena/configure.gnu
new file mode 100755
index 0000000..09a9463
--- /dev/null
+++ b/swilena/configure.gnu
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+# This `configure.gnu' script is invoked by the parent `configure'
+# instead of `configure' in recursive configurations (see
+# ``Configuring Other Packages in Subdirectories'' in Autoconf's
+# manual). This is convenient to pass extra options, like the path to
+# Milena's source directory.
+#
+# This idea was taken and adapted from this message:
+# http://lists.gnu.org/archive/html/autoconf/2002-12/msg00116.html
+
+# Is option checking disabled?
+no_option_checking_p=false
+# Is ``--with-milena' not provided?
+no_milena_p=true
+
+for i; do
+ case "$i" in
+ # First try to get SRCDIR from a possible `--srcdir' argument.
+ --srcdir=*) srcdir=`echo "$i" | sed 's/^--srcdir=//'`;;
+ --disable-option-checking) no_option_checking_p=true;;
+ --with-milena*) no_milena_p=false;;
+ esac
+done
+
+# Then try to guess it from this script's path.
+test x"${srcdir+set}" != xset && srcdir=`dirname $0`
+
+# Disabled option checking is a hint that this `configure.gnu' was
+# called from a parent `configure'. If so, and if no `--with-milena'
+# option was provided, pass our own `--with-milena' option to the
+# recursive call to the actual `configure', carrying the path to
+# Milena's source directory.
+if $no_option_checking_p && $no_milena_p; then
+ milena_dir=`cd "$srcdir/../milena" && pwd`
+ exec "$srcdir/configure" ${1+"$@"} "--with-milena=$milena_dir"
+else
+ exec "$srcdir/configure" ${1+"$@"}
+fi
diff --git a/swilena/img/lena.pgm b/swilena/img/lena.pgm
new file mode 120000
index 0000000..5a1f6d9
--- /dev/null
+++ b/swilena/img/lena.pgm
@@ -0,0 +1 @@
+../../milena/img/lena.pgm
\ No newline at end of file
diff --git a/swilena/m4/pypath.m4 b/swilena/m4/pypath.m4
new file mode 100644
index 0000000..a4e62d1
--- /dev/null
+++ b/swilena/m4/pypath.m4
@@ -0,0 +1,6 @@
+AC_DEFUN([adl_CHECK_PYTHON],
+ [AM_PATH_PYTHON([2.0])
+ AC_CACHE_CHECK([for $am_display_PYTHON includes directory],
+ [adl_cv_python_inc],
+ [adl_cv_python_inc=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()" 2>/dev/null`])
+ AC_SUBST([PYTHONINC], [$adl_cv_python_inc])])
diff --git a/m4/swig.m4 b/swilena/m4/swig.m4
similarity index 100%
copy from m4/swig.m4
copy to swilena/m4/swig.m4
diff --git a/swilena/python/Makefile.am b/swilena/python/Makefile.am
index 531880f..6a9991f 100644
--- a/swilena/python/Makefile.am
+++ b/swilena/python/Makefile.am
@@ -22,16 +22,17 @@
## FIXME: Factor as much as possible. See how we handled this in TC.
CLEANFILES =
-AM_CPPFLAGS = -I$(PYTHONINC) -I$(top_srcdir)/milena
-TOOLS_CXXFLAGS = @TOOLS_CXXFLAGS@
-AM_CXXFLAGS = $(TOOLS_CXXFLAGS)
-AM_SWIGFLAGS = -Wall -c++ -python -I$(top_srcdir)/milena
+MILENA_CPPFLAGS = @MILENA_CPPFLAGS@
+AM_CPPFLAGS = -I$(PYTHONINC) $(MILENA_CPPFLAGS)
+SWILENA_CXXFLAGS = @SWILENA_CXXFLAGS@
+AM_CXXFLAGS = $(SWILENA_CXXFLAGS)
+AM_SWIGFLAGS = -Wall -c++ -python $(MILENA_CPPFLAGS)
## We build modules, not plain libs.
AM_LDFLAGS = -avoid-version -module -shared
## Run Swig to create the C++ wrapper files, the Python interface
## files, and the dependency Makefile snippets.
-%-wrap.cc %.py: $(top_srcdir)/swilena/%.i
+%-wrap.cc %.py: $(top_srcdir)/%.i
@AMDEP_TRUE@ if $(SWIG) $(AM_SWIGFLAGS) $(SWIGFLAGS) -MD -MF "$(DEPDIR)/$*-wrap.Tcc" -o $@ $<; then \
@AMDEP_TRUE@ mv -f "$(DEPDIR)/$*-wrap.Tcc" "$(DEPDIR)/$*-wrap.Pcc";\
@AMDEP_TRUE@ else \
@@ -207,7 +208,7 @@ CLEANFILES += $(bin_SCRIPTS) $(noinst_SCRIPTS)
## Tests. ##
## ------- ##
-include $(top_srcdir)/swilena/run.mk
+include $(top_srcdir)/run.mk
## FIXME: Do we really need to pass top_srcdir and top_builddir to run?
TESTS_ENVIRONMENT = \
diff --git a/swilena/python/data.py b/swilena/python/data.py
index 4a162d9..0d715de 100644
--- a/swilena/python/data.py
+++ b/swilena/python/data.py
@@ -1,6 +1,6 @@
#! /usr/bin/env python
-# Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+# Copyright (C) 2008, 2010 EPITA Research and Development Laboratory (LRDE)
#
# This file is part of Olena.
#
@@ -22,5 +22,5 @@
import os
top_srcdir = os.environ["top_srcdir"]
-img_dir = os.path.join(top_srcdir, "milena", "img")
+img_dir = os.path.join(top_srcdir, "img")
lena = os.path.join (img_dir, "lena.pgm")
diff --git a/swilena/run.mk b/swilena/run.mk
index 993b5d4..e962c2e 100644
--- a/swilena/run.mk
+++ b/swilena/run.mk
@@ -1,4 +1,5 @@
-# Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+# Laboratory (LRDE).
#
# This file is part of Olena.
#
@@ -16,7 +17,7 @@
# A test/script wrapper.
-RUN = $(top_builddir)/swilena/run
-RUN_IN = $(top_srcdir)/swilena/run.in
+RUN = $(top_builddir)/run
+RUN_IN = $(top_srcdir)/run.in
$(RUN): $(RUN_IN)
- cd $(top_builddir)/swilena && $(MAKE) $(AM_MAKEFLAGS) run
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) run
--
1.5.6.5
1
0
last-svn-commit-535-g2eafecb Support for Tesseract 2.x and 3.x in Scribo.
by Guillaume Lazzara 25 Oct '10
by Guillaume Lazzara 25 Oct '10
25 Oct '10
* scribo/text/recognition.hh: Use the correct code depending on
Tesseract version.
* scribo/toolchain/nepomuk/text_extraction.hh: Add few comments
about how to handle Tesseract versions.
* src/Makefile.am,
* src/text/Makefile.am,
* src/toolchain/nepomuk/Makefile.am,
* tests/toolchain/nepomuk/Makefile.am: Add path to config.h.
* src/pbm_text_in_doc.cc,
* src/text/pbm_lines_recognition.cc,
* src/text/pbm_recognition.cc,
* src/text_recognition_in_picture.cc,
* src/toolchain/nepomuk/text_extraction.cc,
* tests/toolchain/nepomuk/text_extraction.cc: Include config.h
---
scribo/ChangeLog | 22 +++++++++
scribo/scribo/text/recognition.hh | 50 ++++++++++++++++++-
scribo/scribo/toolchain/nepomuk/text_extraction.hh | 9 +++-
scribo/src/Makefile.am | 6 ++-
scribo/src/pbm_text_in_doc.cc | 5 ++-
scribo/src/text/Makefile.am | 6 ++-
scribo/src/text/pbm_lines_recognition.cc | 4 ++
scribo/src/text/pbm_recognition.cc | 4 ++
scribo/src/text_recognition_in_picture.cc | 4 ++
scribo/src/toolchain/nepomuk/Makefile.am | 3 +-
scribo/src/toolchain/nepomuk/text_extraction.cc | 4 ++
scribo/tests/toolchain/nepomuk/Makefile.am | 3 +-
scribo/tests/toolchain/nepomuk/text_extraction.cc | 4 ++
13 files changed, 112 insertions(+), 12 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 82c02ca..cb05c44 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,27 @@
2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Support for Tesseract 2.x and 3.x in Scribo.
+
+ * scribo/text/recognition.hh: Use the correct code depending on
+ Tesseract version.
+
+ * scribo/toolchain/nepomuk/text_extraction.hh: Add few comments
+ about how to handle Tesseract versions.
+
+ * src/Makefile.am,
+ * src/text/Makefile.am,
+ * src/toolchain/nepomuk/Makefile.am,
+ * tests/toolchain/nepomuk/Makefile.am: Add path to config.h.
+
+ * src/pbm_text_in_doc.cc,
+ * src/text/pbm_lines_recognition.cc,
+ * src/text/pbm_recognition.cc,
+ * src/text_recognition_in_picture.cc,
+ * src/toolchain/nepomuk/text_extraction.cc,
+ * tests/toolchain/nepomuk/text_extraction.cc: Include config.h
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Cleanup files.
* scribo/debug/usage.hh,
diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh
index 17cbaa2..07f585d 100644
--- a/scribo/scribo/text/recognition.hh
+++ b/scribo/scribo/text/recognition.hh
@@ -61,6 +61,11 @@
# include <tesseract/baseapi.h>
+# if !defined HAVE_TESSERACT_2 && !defined HAVE_TESSERACT_3
+# define HAVE_TESSERACT_2
+# endif
+
+
namespace scribo
{
@@ -103,8 +108,19 @@ namespace scribo
{
trace::entering("scribo::text::recognition");
+
// Initialize Tesseract.
+# ifdef HAVE_TESSERACT_2
TessBaseAPI::InitWithLanguage(NULL, NULL, language, NULL, false, 0, NULL);
+# else // HAVE_TESSERACT_3
+ tesseract::TessBaseAPI tess;
+ if (tess.Init(NULL, language, NULL, 0, false) == -1)
+ {
+ std::cout << "Error: cannot initialize tesseract!" << std::endl;
+ abort();
+ }
+ tess.SetPageSegMode(tesseract::PSM_SINGLE_LINE);
+# endif // HAVE_TESSERACT_2
typedef mln_ch_value(L,bool) I;
int vals[] = { 0, 9, 0, 9, 0,
@@ -155,8 +171,8 @@ namespace scribo
data::fill(line_image, false);
data::paste_without_localization(text_ima, line_image);
-
// Recognize characters.
+# ifdef HAVE_TESSERACT_2
char* s = TessBaseAPI::TesseractRect(
(unsigned char*) line_image.buffer(),
sizeof (bool), // Pixel size.
@@ -165,7 +181,16 @@ namespace scribo
0, // Top
line_image.ncols(), // n cols
line_image.nrows()); // n rows
-
+# else // HAVE_TESSERACT_3
+ char* s = tess.TesseractRect(
+ (unsigned char*) line_image.buffer(),
+ sizeof (bool), // Pixel size.
+ line_image.ncols() * sizeof (bool), // Row_offset
+ 0, // Left
+ 0, // Top
+ line_image.ncols(), // n cols
+ line_image.nrows()); // n rows
+# endif // ! HAVE_TESSERACT_2
if (s != 0)
{
@@ -194,7 +219,16 @@ namespace scribo
mln_precondition(line.is_valid());
// Initialize Tesseract.
+# ifdef HAVE_TESSERACT_2
TessBaseAPI::InitWithLanguage(NULL, NULL, language, NULL, false, 0, NULL);
+# else // HAVE_TESSERACT_3
+ tesseract::TessBaseAPI tess;
+ if (tess.Init(NULL, language, NULL, 0, false) == -1)
+ {
+ std::cout << "Error: cannot initialize tesseract!" << std::endl;
+ abort();
+ }
+# endif // ! HAVE_TESSERACT_2
std::ofstream file;
if (!output_file.empty())
@@ -213,6 +247,7 @@ namespace scribo
border::resize(text_ima, 0);
// Recognize characters.
+# ifdef HAVE_TESSERACT_2
char* s = TessBaseAPI::TesseractRect(
(unsigned char*) text_ima.buffer(),
sizeof (bool), // Pixel size.
@@ -221,7 +256,16 @@ namespace scribo
0, // Top
text_ima.ncols(), // n cols
text_ima.nrows()); // n rows
-
+# else // HAVE_TESSERACT_3
+ char* s = tess.TesseractRect(
+ (unsigned char*) text_ima.buffer(),
+ sizeof (bool), // Pixel size.
+ text_ima.ncols() * sizeof (bool), // Row_offset
+ 0, // Left
+ 0, // Top
+ text_ima.ncols(), // n cols
+ text_ima.nrows()); // n rows
+# endif // ! HAVE_TESSERACT_2
if (s != 0)
{
diff --git a/scribo/scribo/toolchain/nepomuk/text_extraction.hh b/scribo/scribo/toolchain/nepomuk/text_extraction.hh
index e16cd56..effb13f 100644
--- a/scribo/scribo/toolchain/nepomuk/text_extraction.hh
+++ b/scribo/scribo/toolchain/nepomuk/text_extraction.hh
@@ -64,12 +64,17 @@ namespace scribo
This is a convenient routine to be used in Nepomuk.
-
-
\param[in] ima A document image. The
\return A set of recognized words.
+
+ Don't forget to define NDEBUG for compilation to disable debug
+ checks.
+
+ Depending on your version of Tesseract (OCR) you may define
+ HAVE_TESSERACT_2 or HAVE_TESSERACT_3 .
+
*/
QSet<QString>
text_extraction(const QImage& input);
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index d3f686b..c99a791 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -42,7 +42,8 @@ if HAVE_TESSERACT
pbm_text_in_doc_SOURCES = pbm_text_in_doc.cc
pbm_text_in_doc_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
- $(TIFF_CPPFLAGS)
+ $(TIFF_CPPFLAGS) \
+ -I$(top_builddir)
pbm_text_in_doc_LDFLAGS = $(AM_LDFLAGS) \
$(TESSERACT_LDFLAGS) \
$(TIFF_LDFLAGS) \
@@ -77,7 +78,8 @@ if HAVE_TESSERACT
text_recognition_in_picture_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
$(TIFF_CPPFLAGS) \
- $(MAGICKXX_CPPFLAGS)
+ $(MAGICKXX_CPPFLAGS) \
+ -I$(top_builddir)
text_recognition_in_picture_LDFLAGS = $(AM_LDFLAGS) \
-lpthread \
$(TESSERACT_LDFLAGS) \
diff --git a/scribo/src/pbm_text_in_doc.cc b/scribo/src/pbm_text_in_doc.cc
index fa8b5ae..23ed9e7 100644
--- a/scribo/src/pbm_text_in_doc.cc
+++ b/scribo/src/pbm_text_in_doc.cc
@@ -24,6 +24,9 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <libgen.h>
#include <fstream>
@@ -119,7 +122,7 @@ int main(int argc, char* argv[])
typedef image2d<scribo::def::lbl_type> L;
line_set<L>
lines = scribo::toolchain::text_in_doc(input, denoise, debug);
-
+
// Saving results
scribo::io::xml::save(argv[1], lines, "out.xml", true);
diff --git a/scribo/src/text/Makefile.am b/scribo/src/text/Makefile.am
index fc03ae8..dbdb1da 100644
--- a/scribo/src/text/Makefile.am
+++ b/scribo/src/text/Makefile.am
@@ -30,7 +30,8 @@ if HAVE_TIFF
pbm_lines_recognition_SOURCES = pbm_lines_recognition.cc
pbm_lines_recognition_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
- $(TIFF_CPPFLAGS)
+ $(TIFF_CPPFLAGS) \
+ -I$(top_builddir)
pbm_lines_recognition_LDFLAGS = $(AM_LDFLAGS) \
$(TESSERACT_LDFLAGS) \
$(TIFF_LDFLAGS) \
@@ -40,7 +41,8 @@ if HAVE_TIFF
pbm_recognition_SOURCES = pbm_recognition.cc
pbm_recognition_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
- $(TIFF_CPPFLAGS)
+ $(TIFF_CPPFLAGS) \
+ -I$(top_builddir)
pbm_recognition_LDFLAGS = $(AM_LDFLAGS) \
$(TESSERACT_LDFLAGS) \
$(TIFF_LDFLAGS) \
diff --git a/scribo/src/text/pbm_lines_recognition.cc b/scribo/src/text/pbm_lines_recognition.cc
index 5aaa15b..3451449 100644
--- a/scribo/src/text/pbm_lines_recognition.cc
+++ b/scribo/src/text/pbm_lines_recognition.cc
@@ -23,6 +23,10 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <iostream>
#include <mln/core/image/image2d.hh>
diff --git a/scribo/src/text/pbm_recognition.cc b/scribo/src/text/pbm_recognition.cc
index 082faef..b262aab 100644
--- a/scribo/src/text/pbm_recognition.cc
+++ b/scribo/src/text/pbm_recognition.cc
@@ -23,6 +23,10 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <iostream>
#include <mln/core/image/image2d.hh>
diff --git a/scribo/src/text_recognition_in_picture.cc b/scribo/src/text_recognition_in_picture.cc
index acf8fec..b94ed0b 100644
--- a/scribo/src/text_recognition_in_picture.cc
+++ b/scribo/src/text_recognition_in_picture.cc
@@ -24,6 +24,10 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <libgen.h>
#include <iostream>
diff --git a/scribo/src/toolchain/nepomuk/Makefile.am b/scribo/src/toolchain/nepomuk/Makefile.am
index 07c2c33..4328be5 100644
--- a/scribo/src/toolchain/nepomuk/Makefile.am
+++ b/scribo/src/toolchain/nepomuk/Makefile.am
@@ -30,7 +30,8 @@ text_extraction_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
$(TIFF_CPPFLAGS) \
- $(QT_CPPFLAGS)
+ $(QT_CPPFLAGS) \
+ -I$(top_builddir)
text_extraction_LDFLAGS = $(AM_LDFLAGS) \
$(MAGICKXX_LDFLAGS) \
$(TESSERACT_LDFLAGS) \
diff --git a/scribo/src/toolchain/nepomuk/text_extraction.cc b/scribo/src/toolchain/nepomuk/text_extraction.cc
index e5e2de4..41e843a 100644
--- a/scribo/src/toolchain/nepomuk/text_extraction.cc
+++ b/scribo/src/toolchain/nepomuk/text_extraction.cc
@@ -23,6 +23,10 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <libgen.h>
#include <iostream>
#include <QtCore/QDebug>
diff --git a/scribo/tests/toolchain/nepomuk/Makefile.am b/scribo/tests/toolchain/nepomuk/Makefile.am
index 4bce3bd..67a594b 100644
--- a/scribo/tests/toolchain/nepomuk/Makefile.am
+++ b/scribo/tests/toolchain/nepomuk/Makefile.am
@@ -31,7 +31,8 @@ text_extraction_SOURCES = text_extraction.cc
text_extraction_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS)
text_extraction_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
- $(TIFF_CPPFLAGS)
+ $(TIFF_CPPFLAGS) \
+ -I$(top_builddir)
text_extraction_LDFLAGS = $(QT_LDFLAGS) $(LDFLAGS) \
$(TESSERACT_LDFLAGS) \
$(TIFF_LDFLAGS) \
diff --git a/scribo/tests/toolchain/nepomuk/text_extraction.cc b/scribo/tests/toolchain/nepomuk/text_extraction.cc
index 027ad99..c475aa9 100644
--- a/scribo/tests/toolchain/nepomuk/text_extraction.cc
+++ b/scribo/tests/toolchain/nepomuk/text_extraction.cc
@@ -27,6 +27,10 @@
///
/// Test of scribo::toolchain::nepomuk::text_extraction
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <QtGui/QImage>
#include <QtCore>
#include <scribo/toolchain/nepomuk/text_extraction.hh>
--
1.5.6.5
1
0
last-svn-commit-534-g40966cc Handle Tesseract 2.x and 3.x in configuration.
by Guillaume Lazzara 25 Oct '10
by Guillaume Lazzara 25 Oct '10
25 Oct '10
* configure.ac: Call OLN_WITH_TESSERACT macro.
* m4/oln-with-lib.m4: Define a new macro OLN_WITH_TESSERACT.
---
ChangeLog | 8 ++++++++
configure.ac | 3 +--
m4/oln-with-lib.m4 | 47 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 56 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0beb3a3..17f0c42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Handle Tesseract 2.x and 3.x in configuration.
+
+ * configure.ac: Call OLN_WITH_TESSERACT macro.
+
+ * m4/oln-with-lib.m4: Define a new macro OLN_WITH_TESSERACT.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* configure.ac: Configure scribo/src/toolchain/nepomuk directory.
2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/configure.ac b/configure.ac
index 82216e6..88c8d15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -228,8 +228,7 @@ AM_CONDITIONAL([HAVE_QT], [test "x$oln_have_expected_qt_version" = xyes])
# Tesseract. #
# ----------- #
-OLN_WITH_LIB([TESSERACT], [tesseract/baseapi.h], [tesseract_full],
- [tesseract], [TESSERACT])
+OLN_WITH_TESSERACT
# -------------- #
# TIFF library. #
diff --git a/m4/oln-with-lib.m4 b/m4/oln-with-lib.m4
index b18b773..59c6e16 100644
--- a/m4/oln-with-lib.m4
+++ b/m4/oln-with-lib.m4
@@ -61,6 +61,53 @@ m4_default([$5], m4_toupper([$3])),dnl
])# OLN_WITH_LIB
+# OLN_WITH_TESSERACT()
+# -------------------------------------------------------------
+# Check if Tesseract 2 or 3 is available.
+#
+# FIXME: if version 3 is installed in a standard directory, version 2
+# is installed in a non standard directory and its path is passed with
+# the --with-tesseract option, this macro may use the version 3
+# anyway... This is because, the _OLN_WITH_LIB_SHARED_IMPL will try to
+# link to tesseract_api and it will be available in the standard
+# lib directory...
+
+AC_DEFUN([OLN_WITH_TESSERACT],
+[dnl
+ AC_REQUIRE([AC_PROG_CXX])
+ AC_LANG_PUSH([C++])
+ AC_ARG_WITH([tesseract],
+ [AC_HELP_STRING([--with-tesseract@<:@=DIR@:>@],
+ [use $1 (DIR = prefix for TESSERACT installation)])])
+ TESSERACT_CPPFLAGS=''
+ TESSERACT_LDFLAGS=''
+
+ if test "x$with_tesseract" != xno; then
+ # Checking for Tesseract 3.x
+ _OLN_WITH_LIB_SHARED_IMPL([TESSERACT], [tesseract/baseapi.h], [tesseract_api],
+ [tesseract], [TESSERACT_3], [])
+
+ if test x$oln_have_tesseract != xyes; then
+ # Tesseract 2.x not found, checking for Tesseract 2.x
+ _OLN_WITH_LIB_SHARED_IMPL([TESSERACT], [tesseract/baseapi.h], [tesseract_full],
+ [tesseract], [TESSERACT_2], [])
+ TESSERACT_CPPFLAGS="$TESSERACT_2_CPPFLAGS -DHAVE_TESSERACT_2"
+ TESSERACT_LDFLAGS=$TESSERACT_2_LDFLAGS
+ else
+ TESSERACT_CPPFLAGS="$TESSERACT_3_CPPFLAGS -DHAVE_TESSERACT_3"
+ TESSERACT_LDFLAGS=$TESSERACT_3_LDFLAGS
+ fi
+ fi
+
+
+ AC_SUBST([TESSERACT_CPPFLAGS])
+ AC_SUBST([TESSERACT_LDFLAGS])
+ AM_CONDITIONAL([HAVE_TESSERACT], [test x$oln_have_tesseract = xyes ])
+ AC_LANG_POP([C++])
+])# _OLN_WITH_LIB
+
+
+
# _OLN_WITH_LIB(PACKAGE, HEADER, LIBRARY, SHELL_NAME, CPP_NAME,
# OTHER-LIBRARIES)
# -------------------------------------------------------------
--
1.5.6.5
1
0
last-svn-commit-533-gf8cd44e Merge remote branch 'origin/next-next' into exp/next-build-ok
by Guillaume Lazzara 25 Oct '10
by Guillaume Lazzara 25 Oct '10
25 Oct '10
This is a merge commit message of the following branches:
Merge: 2f0dd88... b9df179...
ChangeLog | 101 ++++++
HACKING | 16 +-
README | 63 +++-
configure.ac | 375 +++++++-------------
m4/autotroll.m4 | 3 +
m4/oln-with-lib.m4 | 124 +++++--
milena/ChangeLog | 75 ++++
milena/headers.mk | 1 +
milena/mln/algebra/vec.hh | 4 +-
milena/mln/fun/x2x/rotation.hh | 222 ++++++------
milena/mln/value/ops.hh | 6 +-
milena/tests/accu/Makefile.am | 10 +-
milena/tests/fun/x2x/composed.cc | 6 +-
milena/tests/labeling/Makefile.am | 11 +-
milena/tests/unit_test/Makefile.am | 10 +-
.../cond_tests_boost-preprocessor_boost-tuple | 1 -
milena/tests/unit_test/cond_tests_boost-tuple | 1 +
milena/tests/unit_test/unit-tests.mk | 8 +-
milena/tests/value/builtin/Makefile.am | 6 +-
milena/tests/value/builtin/floatings.cc | 38 ++
scribo/ChangeLog | 15 +
scribo/src/text_in_picture.cc | 6 +-
scribo/tests/unit_test/cond_tests_tesseract_tiff | 1 +
scribo/tests/unit_test/unit-tests.mk | 8 +-
24 files changed, 673 insertions(+), 438 deletions(-)
diff --cc ChangeLog
index 6aeb05f,263dfff..0beb3a3
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,11 -1,104 +1,112 @@@
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * configure.ac: Configure scribo/src/toolchain/nepomuk directory.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * configure.ac: Configure new test directories.
+
+ 2010-10-22 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Do not trigger an error when Qt is missing, too old or not working.
+
+ * configure.ac: Here.
+ Protect a test from a variable expanding to an empty string.
+
+ 2010-10-22 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Have AutoTroll always restore the initial ``current directory''.
+
+ * m4/autotroll.m4 (AT_WITH_QT): Always come back to the top-level
+ directory upon failure.
+
+ 2010-10-22 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Add a warning about Python 2.6 and greater regarding Swilena.
+
+ * configure.ac: Here.
+
+ 2010-10-21 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Factor the implementations of OLN_WITH_LIB and OLN_WITH_LIB_PKG_CONFIG.
+
+ * m4/oln-with-lib.m4 (_OLN_WITH_LIB_SHARED_IMPL): New macro.
+ Use it to factor...
+ (_OLN_WITH_LIB, _OLN_WITH_LIB_PKG_CONFIG): ...these.
+
+ 2010-10-21 Roland Levillain <roland(a)lrde.epita.fr>
+
+ * configure.ac: Aesthetic changes.
+
+ 2010-10-21 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix configure option `--enable-all'.
+
+ * configure.ac: Check the value of `enable_all' before triggering
+ optional modules.
+
+ 2010-10-21 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Revamp the handling of Qt.
+
+ * configure.ac: Here.
+ Use autotroll.m4's features instead of duplicating them.
+
+ 2010-10-21 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Revamp the handling of Boost libraries.
+
+ * configure.ac: Here.
+ Use boost.m4's features instead of duplicating them.
+ Do not explictly look for the Boost Preprocessor (Boost.PP)
+ Library, as we do not directly use it.
+
+ 2010-10-21 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Revamp the handling of Magick++.
+
+ * m4/oln-with-lib.m4 (_OLN_WITH_LIB): Make all arguments
+ mandatory.
+ (OLN_WITH_LIB_PKG_CONFIG, _OLN_WITH_LIB_PKG_CONFIG): New macros.
+ * configure.ac: Use OLN_WITH_LIB_PKG_CONFIG to handle Magick++
+
+ 2010-10-20 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Have configure be terser.
+
+ * configure.ac: Remove intermediate messages.
+ Add option `--enable-verbose', and show the final summary only
+ when it is turned on.
+ Use escaped version of `[' and `]' in message.
+ Document this option...
+ * README (Verbose Display): ...here.
+
+ 2010-10-20 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Ensure paths passed to `--with-*' options are visited before others.
+
+ * m4/oln-with-lib.m4 (OLN_WITH_LIB): Here.
+
+ 2010-10-20 Roland Levillain <roland(a)lrde.epita.fr>
+
+ * m4/oln-with-lib.m4: Revert the previous changes.
+
+ 2010-10-21 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Update HACKING.
+
+ * HACKING (Required Software): Update.
+ (Useful Tools): New section.
+
+ 2010-10-21 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Update README.
+
+ * README: Aesthetic changes.
+ (Overview): Fix an URL.
+ (Other libraries): New section.
+ (Bibliography): Add publications of 2010.
+
2010-08-24 Guillaume Lazzara <z(a)lrde.epita.fr>
* m4/oln-with-lib.m4: Force headers lookup in specified path.
diff --cc scribo/ChangeLog
index 0813a97,104f9c6..82c02ca
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@@ -1,71 -1,18 +1,86 @@@
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Cleanup files.
+
+ * scribo/debug/usage.hh,
+ * scribo/text/recognition.hh: Remove useless comments.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add a new example.
+
+ * src/Makefile.am: Add toolchain subdir.
+
+ * src/toolchain/Makefile.am,
+ * src/toolchain/nepomuk/Makefile.am,
+ * src/toolchain/nepomuk/text_extraction.cc: New.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * scribo/core/line_info.hh: Fix line statistics.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Update tests in Scribo.
+
+ * tests/binarization/global_threshold.cc,
+ * tests/binarization/local_threshold.cc,
+ * tests/primitive/link/merge_double_link.cc: Fix tests.
+
+ * tests/core/Makefile.am: Add a new test.
+
+ * tests/core/line_info.cc: New.
+
+ * tests/filter/small_and_large_bboxes.cc: Remove useless arguments.
+
+ * tests/img/pixels.pbm: Update.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Small fixes in Scribo
+
+ * scribo/core/line_info.hh: Fix invalid extended bboxes.
+
+ * src/text_in_doc_preprocess.cc: Do not invert data anymore.
+
+ * tests/filter/objects_with_holes.cc: Remove useless arguments.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add a new test for primitive::link::merge_double_link.
+
+ * tests/img/pixels.pbm: New test image.
+
+ * tests/Makefile.am (SUBDIRS): add primitive directory.
+
+ * tests/primitive/Makefile.am,
+ * tests/primitive/link/Makefile.am,
+ * tests/primitive/link/merge_double_link.cc: New.
+
+2010-10-11 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Negate Sauvola's result.
+
+ * scribo/binarization/local_threshold.hh,
+ * scribo/binarization/sauvola_ms.hh: Invert threshold test.
+
+ * src/text_in_picture.cc: Do not negate Sauvola's output anymore.
+
+ 2010-10-22 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Require Tesseract for scribo/toolchain/text_in_doc.hh's unit test.
+
+ * tests/unit_test/cond_tests_tesseract_tiff:
+ Add scribo/toolchain/text_in_doc.hh.
+ * tests/unit_test/unit-tests.mk: Regen.
+
+ 2010-10-20 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix `link' name lookup in Scribo.
+
+ * src/text_in_picture.cc: Help the C++ compiler not to mix up
+ scribo::primitive::link with unistd.h's link(2).
+
2010-10-21 Guillaume Lazzara <z(a)lrde.epita.fr>
Small fixes in Scribo
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
last-svn-commit-506-g2f0dd88 configure.ac: Configure scribo/src/toolchain/nepomuk directory.
by Guillaume Lazzara 25 Oct '10
by Guillaume Lazzara 25 Oct '10
25 Oct '10
---
ChangeLog | 4 ++++
configure.ac | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6a1eee9..6aeb05f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * configure.ac: Configure scribo/src/toolchain/nepomuk directory.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* configure.ac: Configure new test directories.
2010-08-24 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/configure.ac b/configure.ac
index d54b3dc..24a15b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -477,6 +477,8 @@ AC_CONFIG_FILES([
scribo/src/primitive/group/Makefile
scribo/src/table/Makefile
scribo/src/text/Makefile
+ scribo/src/toolchain/Makefile
+ scribo/src/toolchain/nepomuk/Makefile
])
AC_CONFIG_FILES([scribo/tests/data.hh])
--
1.5.6.5
1
0
* scribo/debug/usage.hh,
* scribo/text/recognition.hh: Remove useless comments.
---
scribo/ChangeLog | 9 ++++++++-
scribo/scribo/debug/usage.hh | 9 +++------
scribo/scribo/text/recognition.hh | 8 --------
3 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 3b094e0..0813a97 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,6 +1,13 @@
2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
- Add a new toolchain.
+ Cleanup files.
+
+ * scribo/debug/usage.hh,
+ * scribo/text/recognition.hh: Remove useless comments.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add a new example.
* src/Makefile.am: Add toolchain subdir.
diff --git a/scribo/scribo/debug/usage.hh b/scribo/scribo/debug/usage.hh
index 2c6fa48..7a284e3 100644
--- a/scribo/scribo/debug/usage.hh
+++ b/scribo/scribo/debug/usage.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -41,7 +42,6 @@ namespace scribo
/// \param[in] desc Description of the program.
/// \param[in] args The expected arguments.
/// \param[in] args_desc The description of the expected arguments.
- /// \param[in] out_desc The description of the output.
///
/// \return Return 1.
//
@@ -67,11 +67,8 @@ namespace scribo
std::cout << " " << args_desc[i][0] << ": " << args_desc[i][1]
<< std::endl;
-// if (out_desc)
-// std::cout << std::endl << "Output: " << out_desc << std::endl;
-
std::cout << "-----------" << std::endl;
- std::cout << "EPITA/LRDE - Scribo 2009" << std::endl;
+ std::cout << "EPITA/LRDE - Scribo 2008-2010" << std::endl;
return 1;
}
diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh
index 8cb0e96..17cbaa2 100644
--- a/scribo/scribo/text/recognition.hh
+++ b/scribo/scribo/text/recognition.hh
@@ -121,10 +121,6 @@ namespace scribo
if (! lines(i).is_valid() || lines(i).is_hidden() || lines(i).type() != line::Text)
continue;
-// std::cout << "Text recognition... ("
-// << i << "/" << lines.nelements() << ")" << std::endl;
-// std::cout << "x_height = " << lines(i).x_height() << std::endl;
-
mln_domain(I) box = lines(i).bbox();
// Make sure characters are isolated from the borders.
@@ -150,7 +146,6 @@ namespace scribo
/// text_ima_cleaned domain may be larger than text_ima's.
text::clean_inplace(lines(i), text_ima);
-// mln::io::pbm::save(text_ima_cleaned, mln::debug::filename("line.pbm", debug_id++));
// Make sure characters are isolated from the borders.
// Help Tesseract.
@@ -160,7 +155,6 @@ namespace scribo
data::fill(line_image, false);
data::paste_without_localization(text_ima, line_image);
-// mln::io::pbm::save(line_image, mln::debug::filename("line_image.pbm", debug_id++));
// Recognize characters.
char* s = TessBaseAPI::TesseractRect(
@@ -175,7 +169,6 @@ namespace scribo
if (s != 0)
{
-// std::cerr << s << std::endl;
std::string str(s);
str = str.substr(0, str.length() - 2);
lines(i).update_text(str);
@@ -232,7 +225,6 @@ namespace scribo
if (s != 0)
{
-// std::cout << s << std::endl;
if (!output_file.empty())
{
std::string str(s);
--
1.5.6.5
1
0
* src/Makefile.am: Add toolchain subdir.
* src/toolchain/Makefile.am,
* src/toolchain/nepomuk/Makefile.am,
* src/toolchain/nepomuk/text_extraction.cc: New.
---
scribo/ChangeLog | 10 +++++
scribo/src/Makefile.am | 3 +-
.../{tests/primitive => src/toolchain}/Makefile.am | 6 +--
.../{tests => src}/toolchain/nepomuk/Makefile.am | 35 +++++++++----------
.../toolchain/nepomuk/text_extraction.cc | 36 ++++++++++++++------
5 files changed, 56 insertions(+), 34 deletions(-)
copy scribo/{tests/primitive => src/toolchain}/Makefile.am (91%)
copy scribo/{tests => src}/toolchain/nepomuk/Makefile.am (65%)
copy scribo/{tests => src}/toolchain/nepomuk/text_extraction.cc (75%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 807bdc8..3b094e0 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,15 @@
2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add a new toolchain.
+
+ * src/Makefile.am: Add toolchain subdir.
+
+ * src/toolchain/Makefile.am,
+ * src/toolchain/nepomuk/Makefile.am,
+ * src/toolchain/nepomuk/text_extraction.cc: New.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* scribo/core/line_info.hh: Fix line statistics.
2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index 52df66d..d3f686b 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -26,7 +26,8 @@ SUBDIRS = \
misc \
postprocessing \
preprocessing \
- text
+ text \
+ toolchain
# Disabled for the moment:
# table
diff --git a/scribo/tests/primitive/Makefile.am b/scribo/src/toolchain/Makefile.am
similarity index 91%
copy from scribo/tests/primitive/Makefile.am
copy to scribo/src/toolchain/Makefile.am
index 82c773a..36cfff4 100644
--- a/scribo/tests/primitive/Makefile.am
+++ b/scribo/src/toolchain/Makefile.am
@@ -14,8 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-include $(top_srcdir)/scribo/tests/tests.mk
-
-SUBDIRS = \
- link
+include $(top_srcdir)/scribo/scribo.mk
+SUBDIRS = nepomuk
\ No newline at end of file
diff --git a/scribo/tests/toolchain/nepomuk/Makefile.am b/scribo/src/toolchain/nepomuk/Makefile.am
similarity index 65%
copy from scribo/tests/toolchain/nepomuk/Makefile.am
copy to scribo/src/toolchain/nepomuk/Makefile.am
index 4bce3bd..07c2c33 100644
--- a/scribo/tests/toolchain/nepomuk/Makefile.am
+++ b/scribo/src/toolchain/nepomuk/Makefile.am
@@ -13,33 +13,32 @@
#
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
-#
-
-## Process this file through Automake to create Makefile.in.
-
-include $(top_srcdir)/scribo/tests/tests.mk
-
-check_PROGRAMS =
+include $(top_srcdir)/scribo/scribo.mk
+bin_PROGRAMS =
if HAVE_QT
+if HAVE_MAGICKXX
if HAVE_TESSERACT
-check_PROGRAMS += text_extraction
+bin_PROGRAMS += \
+text_extraction
+
text_extraction_SOURCES = text_extraction.cc
-text_extraction_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS)
-text_extraction_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS) \
+text_extraction_CPPFLAGS = $(AM_CPPFLAGS) \
+ $(MAGICKXX_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
- $(TIFF_CPPFLAGS)
-text_extraction_LDFLAGS = $(QT_LDFLAGS) $(LDFLAGS) \
+ $(TIFF_CPPFLAGS) \
+ $(QT_CPPFLAGS)
+text_extraction_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
$(TESSERACT_LDFLAGS) \
$(TIFF_LDFLAGS) \
- -lpthread
-text_extraction_LDADD = $(QT_LIBS) $(LDADD)
+ $(QT_LDFLAGS) \
+ $(QT_LIBS) \
+ -lpthread
endif HAVE_TESSERACT
-endif HAVE_QT
-
-
-TESTS = $(check_PROGRAMS)
+endif HAVE_MAGICKXX
+endif HAVE_QT
\ No newline at end of file
diff --git a/scribo/tests/toolchain/nepomuk/text_extraction.cc b/scribo/src/toolchain/nepomuk/text_extraction.cc
similarity index 75%
copy from scribo/tests/toolchain/nepomuk/text_extraction.cc
copy to scribo/src/toolchain/nepomuk/text_extraction.cc
index 027ad99..e5e2de4 100644
--- a/scribo/tests/toolchain/nepomuk/text_extraction.cc
+++ b/scribo/src/toolchain/nepomuk/text_extraction.cc
@@ -23,22 +23,36 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-/// \file
-///
-/// Test of scribo::toolchain::nepomuk::text_extraction
+#include <libgen.h>
+#include <iostream>
+#include <QtCore/QDebug>
-#include <QtGui/QImage>
-#include <QtCore>
+#include <scribo/debug/usage.hh>
#include <scribo/toolchain/nepomuk/text_extraction.hh>
-#include "tests/data.hh"
-int main()
+const char *args_desc[][2] =
{
- QImage ima(SCRIBO_IMG_DIR "/wildly.pbm");
+ { "input.*", "An image." },
+ {0, 0}
+};
+
+
+
+
+int main(int argc, char* argv[])
+{
+ if (argc != 2)
+ return scribo::debug::usage(argv,
+ "Extract text in a document.\n\n"
+ "Common usage: ./text_extraction input.*",
+ "<image>",
+ args_desc);
+
+
+ QImage ima(argv[1]);
QSet<QString> words = scribo::toolchain::nepomuk::text_extraction(ima);
- mln_assertion(words.size() == 1);
- mln_assertion(words.contains("Wildly"));
- return 0;
+ foreach(QString w, words)
+ qDebug() << w;
}
--
1.5.6.5
1
0
last-svn-commit-503-gdf42e56 scribo/core/line_info.hh: Fix line statistics.
by Guillaume Lazzara 25 Oct '10
by Guillaume Lazzara 25 Oct '10
25 Oct '10
---
scribo/ChangeLog | 4 ++++
scribo/scribo/core/line_info.hh | 37 +++++++++++++++++++++++--------------
2 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index b4c122c..807bdc8 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,9 @@
2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * scribo/core/line_info.hh: Fix line statistics.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Update tests in Scribo.
* tests/binarization/global_threshold.cc,
diff --git a/scribo/scribo/core/line_info.hh b/scribo/scribo/core/line_info.hh
index 5328b33..ed31d17 100644
--- a/scribo/scribo/core/line_info.hh
+++ b/scribo/scribo/core/line_info.hh
@@ -328,7 +328,7 @@ namespace scribo
0 1 2 3 4 5 6 7 8 9
---------------------
- 0 | | | |x| | | | | | | ----> a_height = 4
+ 0 | | | |x| | | | | | | ----> a_height = 5
---------------------
1 | | | |x| | | | | | |
---------------------
@@ -467,7 +467,7 @@ namespace scribo
int
line_info<L>::descent() const
{
- return baseline_ - d_height() + 1;
+ return baseline_ - d_height();
}
@@ -672,11 +672,6 @@ namespace scribo
if (D <= 2 && A > 2)
D = A;
- if (D < 0)
- D = 0;
- if (A < 0)
- A = 0;
-
int delta = delta_of_line();
ebbox_ = mln::make::box2d(meanline_ - A, bbox().pmin().col() - delta,
@@ -847,13 +842,27 @@ namespace scribo
+ // FIXME: we must guaranty here that the relationship is from
+ // right to left, otherwise, the space size computed between
+ // boxes might be wrong...
+ //
+ // x------| |-| != |------| x-|
+ // |------| x-| |------x |-|
+ //
+ // (incorrect) (correct)
+ // (right link) (left link)
+
// Space between characters.
- int space = bb.pmin().col()
- - comp_set(holder_.links()(c)).bbox().pmax().col() + 1;
+ if (holder_.links()(c) != c)
+ {
+ int
+ space = bb.pmin().col()
+ - comp_set(holder_.links()(c)).bbox().pmax().col() - 1;
- // -- Ignore overlapped characters.
- if (space > 0)
- char_space.take(space);
+ // -- Ignore overlapped characters.
+ if (space > 0)
+ char_space.take(space);
+ }
// Character width
// -- Ignore too large components.
@@ -896,7 +905,7 @@ namespace scribo
baseline_ = absolute_baseline_r;
meanline_ = absolute_meanline_r;
x_height_ = baseline_ - meanline_ + 1;
- d_height_ = baseline_ - bbox.to_result().pmax().row() + 1;
+ d_height_ = baseline_ - bbox.to_result().pmax().row();
a_height_ = baseline_ - bbox.to_result().pmin().row() + 1;
//FIXME
@@ -955,7 +964,7 @@ namespace scribo
}
-# endif // ! MLN_INCLUDE_ONLY
+# endif// ! MLN_INCLUDE_ONLY
} // end of namespace scribo
--
1.5.6.5
1
0
* tests/binarization/global_threshold.cc,
* tests/binarization/local_threshold.cc,
* tests/primitive/link/merge_double_link.cc: Fix tests.
* tests/core/Makefile.am: Add a new test.
* tests/core/line_info.cc: New.
* tests/filter/small_and_large_bboxes.cc: Remove useless arguments.
* tests/img/pixels.pbm: Update.
---
scribo/ChangeLog | 16 ++++++
scribo/tests/binarization/global_threshold.cc | 28 ++++++++++-
scribo/tests/binarization/local_threshold.cc | 34 +++++++++++--
scribo/tests/core/Makefile.am | 4 +-
.../line_info.cc} | 54 +++++++++++---------
scribo/tests/filter/small_and_large_bboxes.cc | 2 +-
scribo/tests/img/pixels.pbm | 2 +-
scribo/tests/primitive/link/merge_double_link.cc | 7 +--
8 files changed, 110 insertions(+), 37 deletions(-)
copy scribo/tests/{filter/small_and_large_bboxes.cc => core/line_info.cc} (56%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 98c90d6..b4c122c 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,21 @@
2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Update tests in Scribo.
+
+ * tests/binarization/global_threshold.cc,
+ * tests/binarization/local_threshold.cc,
+ * tests/primitive/link/merge_double_link.cc: Fix tests.
+
+ * tests/core/Makefile.am: Add a new test.
+
+ * tests/core/line_info.cc: New.
+
+ * tests/filter/small_and_large_bboxes.cc: Remove useless arguments.
+
+ * tests/img/pixels.pbm: Update.
+
+2010-10-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Small fixes in Scribo
* scribo/core/line_info.hh: Fix invalid extended bboxes.
diff --git a/scribo/tests/binarization/global_threshold.cc b/scribo/tests/binarization/global_threshold.cc
index 9da29e3..e43a487 100644
--- a/scribo/tests/binarization/global_threshold.cc
+++ b/scribo/tests/binarization/global_threshold.cc
@@ -1,10 +1,36 @@
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
#include <mln/core/image/image2d.hh>
#include <mln/make/image.hh>
#include <mln/data/compare.hh>
#include <scribo/binarization/global_threshold.hh>
-
int main(int argc, char *argv[])
{
using namespace mln;
diff --git a/scribo/tests/binarization/local_threshold.cc b/scribo/tests/binarization/local_threshold.cc
index 8fb5045..5de4dfd 100644
--- a/scribo/tests/binarization/local_threshold.cc
+++ b/scribo/tests/binarization/local_threshold.cc
@@ -1,11 +1,37 @@
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
#include <mln/core/image/image2d.hh>
#include <mln/make/image.hh>
#include <mln/data/compare.hh>
#include <scribo/binarization/local_threshold.hh>
-
-int main(int argc, char *argv[])
+int main()
{
using namespace mln;
@@ -15,8 +41,8 @@ int main(int argc, char *argv[])
unsigned data_threshold[2][2] = { { 12, 13 },
{ 14, 15 } };
- bool data_ref[2][2] = { { 1, 1 },
- { 0, 0 } };
+ bool data_ref[2][2] = { { 1, 0 },
+ { 1, 1 } };
image2d<unsigned> input = make::image(data);
image2d<unsigned> threshold = make::image(data_threshold);
diff --git a/scribo/tests/core/Makefile.am b/scribo/tests/core/Makefile.am
index cf1c528..356cc31 100644
--- a/scribo/tests/core/Makefile.am
+++ b/scribo/tests/core/Makefile.am
@@ -20,6 +20,8 @@
include $(top_srcdir)/scribo/tests/tests.mk
-check_PROGRAMS =
+check_PROGRAMS = line_info
+
+line_info_SOURCES = line_info.cc
TESTS = $(check_PROGRAMS)
diff --git a/scribo/tests/filter/small_and_large_bboxes.cc b/scribo/tests/core/line_info.cc
similarity index 56%
copy from scribo/tests/filter/small_and_large_bboxes.cc
copy to scribo/tests/core/line_info.cc
index 20ddd12..cc0c575 100644
--- a/scribo/tests/filter/small_and_large_bboxes.cc
+++ b/scribo/tests/core/line_info.cc
@@ -1,5 +1,4 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -28,28 +27,32 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
-#include <mln/util/graph.hh>
#include <mln/value/label_16.hh>
#include <mln/io/pbm/load.hh>
-#include <mln/literal/colors.hh>
#include <scribo/primitive/extract/components.hh>
-#include <scribo/primitive/group/apply.hh>
#include <scribo/primitive/link/with_single_left_link.hh>
#include <scribo/primitive/group/from_single_link.hh>
-#include <scribo/filter/objects_small.hh>
-
-#include <scribo/make/debug_filename.hh>
-#include <scribo/debug/save_bboxes_image.hh>
-#include <scribo/debug/save_linked_bboxes_image.hh>
+#include <scribo/core/line_set.hh>
#include "tests/data.hh"
-int main(int argc, char* argv[])
+
+int main()
{
using namespace scribo;
using namespace mln;
- std::string img = SCRIBO_IMG_DIR "/text_to_group_and_clean.pbm";
+
+ int ref[][9] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ // baseline, meanline, ascent, descent, x_height, d_height, a_height, char_space, char_width
+ { 2, 2, 2, 2, 1, 0, 1, 1, 1 },
+ { 4, 4, 4, 4, 1, 0, 1, 0, 1 },
+ { 6, 6, 6, 6, 1, 0, 1, 0, 1 },
+ { 7, 7, 7, 7, 1, 0, 1, 0, 1 },
+ { 12, 12, 10, 12, 1, 0, 3, 0, 1 },
+ { 17, 15, 15, 17, 3, 0, 3, 0, 4 } };
+
+ std::string img = SCRIBO_IMG_DIR "/pixels.pbm";
image2d<bool> input;
io::pbm::load(input, img.c_str());
@@ -61,23 +64,24 @@ int main(int argc, char* argv[])
object_links<L> links = primitive::link::with_single_left_link(text, 30);
-
- mln_assertion(nbboxes == 12u);
-
object_groups<L> groups = primitive::group::from_single_link(links);
- component_set<L> grouped_comps = primitive::group::apply(groups);
+ line_set<L> lines = scribo::line_set<L>(groups);
- mln_assertion(grouped_comps.nelements() == 6u);
- component_set<L>
- filtered_comps = scribo::filter::components_small(grouped_comps, 20);
+ for_all_lines(l, lines)
+ {
+ mln_assertion(lines(l).baseline() == ref[l][0]);
+ mln_assertion(lines(l).meanline() == ref[l][1]);
+ mln_assertion(lines(l).ascent() == ref[l][2]);
+ mln_assertion(lines(l).descent() == ref[l][3]);
+ mln_assertion(lines(l).x_height() == unsigned(ref[l][4]));
+ mln_assertion(lines(l).d_height() == ref[l][5]);
+ mln_assertion(lines(l).a_height() == ref[l][6]);
+ mln_assertion(lines(l).char_space() == unsigned(ref[l][7]));
+ mln_assertion(lines(l).char_width() == unsigned(ref[l][8]));
+ }
- unsigned valid_comps = 0;
- for_all_comps(c, filtered_comps)
- if (filtered_comps(c).is_valid())
- ++valid_comps;
+}
- mln_assertion(valid_comps == 2u);
-}
diff --git a/scribo/tests/filter/small_and_large_bboxes.cc b/scribo/tests/filter/small_and_large_bboxes.cc
index 20ddd12..b3d7d5f 100644
--- a/scribo/tests/filter/small_and_large_bboxes.cc
+++ b/scribo/tests/filter/small_and_large_bboxes.cc
@@ -44,7 +44,7 @@
#include "tests/data.hh"
-int main(int argc, char* argv[])
+int main()
{
using namespace scribo;
using namespace mln;
diff --git a/scribo/tests/img/pixels.pbm b/scribo/tests/img/pixels.pbm
index e69f06d..6f72469 100644
--- a/scribo/tests/img/pixels.pbm
+++ b/scribo/tests/img/pixels.pbm
@@ -1,4 +1,4 @@
P4
# CREATOR: GIMP PNM Filter Version 1.1
38 23
-ÿÿÿÿüÿÿÿÿüÿþ¿ÿüÿÿÿÿüÿþÿÿüÿÿÿÿüÿûÿÿüÿïÿÿüÿÿÿÿüÿÿÿÿüÿïÿÿüÿßÿÿüÿ×ÿÿüÿÿÿÿüÿÿÿÿüÿÿÿüÿoÿÿüÿïÿÿüÿÿÿÿüÿÿÿÿüÿÿÿÿüÿÿÿÿüÿÿÿÿü
\ No newline at end of file
+ÿÿÿÿüÿÿÿÿüÿþ¯ÿüÿÿÿÿüÿþÿÿüÿÿÿÿüÿûÿÿüÿïÿÿüÿÿÿÿüÿÿÿÿüÿïÿÿüÿßÿÿüÿ×ÿÿüÿÿÿÿüÿÿÿÿüÿÿÿüÿoÿÿüÿïÿÿüÿÿÿÿüÿÿÿÿüÿÿÿÿüÿÿÿÿüÿÿÿÿü
\ No newline at end of file
diff --git a/scribo/tests/primitive/link/merge_double_link.cc b/scribo/tests/primitive/link/merge_double_link.cc
index ca3002b..1b0674e 100644
--- a/scribo/tests/primitive/link/merge_double_link.cc
+++ b/scribo/tests/primitive/link/merge_double_link.cc
@@ -50,9 +50,9 @@ int main()
std::string img = SCRIBO_IMG_DIR "/pixels.pbm";
- unsigned ref_left[] = {0, 1, 1, 3, 4, 5, 6, 6, 8};
- unsigned ref_right[] = {0, 2, 2, 3, 4, 5, 6, 7, 8};
- unsigned ref_merged[] = {0, 1, 1, 3, 4, 5, 6, 7, 8};
+ unsigned ref_left[] = {0, 1, 1, 2, 4, 5, 6, 7, 7, 9};
+ unsigned ref_right[] = {0, 2, 3, 3, 4, 5, 6, 7, 8, 9};
+ unsigned ref_merged[] = {0, 1, 1, 2, 4, 5, 6, 7, 8, 9};
image2d<bool> input;
@@ -79,7 +79,6 @@ int main()
merged_links = primitive::link::merge_double_link(left_link,
right_link);
-
for_all_links(i, left_link)
mln_assertion(ref_left[i] == left_link(i));
--
1.5.6.5
1
0
branch fix-swilena-deps-tracking created: last-svn-commit-524-g7924629
by git@lrde.epita.fr 25 Oct '10
by git@lrde.epita.fr 25 Oct '10
25 Oct '10
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch fix-swilena-deps-tracking has been created
at 7924629f9a5ed75553a8fa6cee857bf59b634c0f (commit)
- Log -----------------------------------------------------------------
7924629 Fix Swilena's dependency tracking.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0