Olena-patches
Threads by month
- ----- 2025 -----
- 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
June 2010
- 9 participants
- 276 discussions

last-svn-commit-116-g9c5c483 Move AFP's GUI into Scribo's demo directory.
by Guillaume Lazzara 03 Jun '10
by Guillaume Lazzara 03 Jun '10
03 Jun '10
* milena/sandbox/lazzara/afp/photos/gui/gui.pro,
* milena/sandbox/lazzara/afp/photos/gui/gui.qrc,
* milena/sandbox/lazzara/afp/photos/gui/icons/next.png,
* milena/sandbox/lazzara/afp/photos/gui/icons/ok.png,
* milena/sandbox/lazzara/afp/photos/gui/icons/photos.png,
* milena/sandbox/lazzara/afp/photos/gui/icons/prev.png,
* milena/sandbox/lazzara/afp/photos/gui/icons/remove.png,
* milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc,
* milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh,
* milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc,
* milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh,
* milena/sandbox/lazzara/afp/photos/gui/src/main.cc,
* milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc,
* milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh,
* milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui,
* milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui: Move...
* scribo/demo/tip/gui.pro,
* scribo/demo/tip/gui.qrc,
* scribo/demo/tip/icons/next.png,
* scribo/demo/tip/icons/ok.png,
* scribo/demo/tip/icons/photos.png,
* scribo/demo/tip/icons/prev.png,
* scribo/demo/tip/icons/remove.png,
* scribo/demo/tip/src/custom_delegate.cc,
* scribo/demo/tip/src/custom_delegate.hh,
* scribo/demo/tip/src/launch_dialog.cc,
* scribo/demo/tip/src/launch_dialog.hh,
* scribo/demo/tip/src/main.cc,
* scribo/demo/tip/src/main_window.cc,
* scribo/demo/tip/src/main_window.hh,
* scribo/demo/tip/ui/launch_dialog.ui,
* scribo/demo/tip/ui/main_window.ui: ... here.
---
scribo/ChangeLog | 38 ++++++++++++++++++++
.../afp/photos/gui => scribo/demo/tip}/gui.pro | 0
.../afp/photos/gui => scribo/demo/tip}/gui.qrc | 0
.../photos/gui => scribo/demo/tip}/icons/next.png | Bin 3337 -> 3337 bytes
.../photos/gui => scribo/demo/tip}/icons/ok.png | Bin 3953 -> 3953 bytes
.../gui => scribo/demo/tip}/icons/photos.png | Bin 3750 -> 3750 bytes
.../photos/gui => scribo/demo/tip}/icons/prev.png | Bin 3334 -> 3334 bytes
.../gui => scribo/demo/tip}/icons/remove.png | Bin 3704 -> 3704 bytes
.../gui => scribo/demo/tip}/src/custom_delegate.cc | 0
.../gui => scribo/demo/tip}/src/custom_delegate.hh | 0
.../gui => scribo/demo/tip}/src/launch_dialog.cc | 0
.../gui => scribo/demo/tip}/src/launch_dialog.hh | 0
.../afp/photos/gui => scribo/demo/tip}/src/main.cc | 0
.../gui => scribo/demo/tip}/src/main_window.cc | 0
.../gui => scribo/demo/tip}/src/main_window.hh | 0
.../gui => scribo/demo/tip}/ui/launch_dialog.ui | 0
.../gui => scribo/demo/tip}/ui/main_window.ui | 0
17 files changed, 38 insertions(+), 0 deletions(-)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/gui.pro (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/gui.qrc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/next.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/ok.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/photos.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/prev.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/remove.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/custom_delegate.cc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/custom_delegate.hh (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/launch_dialog.cc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/launch_dialog.hh (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/main.cc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/main_window.cc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/main_window.hh (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/ui/launch_dialog.ui (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/ui/main_window.ui (100%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 6acc319..0a98d9a 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,43 @@
2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Move AFP's GUI into Scribo's demo directory.
+
+ * milena/sandbox/lazzara/afp/photos/gui/gui.pro,
+ * milena/sandbox/lazzara/afp/photos/gui/gui.qrc,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/next.png,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/ok.png,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/photos.png,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/prev.png,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/remove.png,
+ * milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc,
+ * milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh,
+ * milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc,
+ * milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh,
+ * milena/sandbox/lazzara/afp/photos/gui/src/main.cc,
+ * milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc,
+ * milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh,
+ * milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui,
+ * milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui: Move...
+
+ * scribo/demo/tip/gui.pro,
+ * scribo/demo/tip/gui.qrc,
+ * scribo/demo/tip/icons/next.png,
+ * scribo/demo/tip/icons/ok.png,
+ * scribo/demo/tip/icons/photos.png,
+ * scribo/demo/tip/icons/prev.png,
+ * scribo/demo/tip/icons/remove.png,
+ * scribo/demo/tip/src/custom_delegate.cc,
+ * scribo/demo/tip/src/custom_delegate.hh,
+ * scribo/demo/tip/src/launch_dialog.cc,
+ * scribo/demo/tip/src/launch_dialog.hh,
+ * scribo/demo/tip/src/main.cc,
+ * scribo/demo/tip/src/main_window.cc,
+ * scribo/demo/tip/src/main_window.hh,
+ * scribo/demo/tip/ui/launch_dialog.ui,
+ * scribo/demo/tip/ui/main_window.ui: ... here.
+
+2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Introduce dmax_functor concept.
* core/concept/dmax_functor.hh,
diff --git a/milena/sandbox/lazzara/afp/photos/gui/gui.pro b/scribo/demo/tip/gui.pro
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/gui.pro
rename to scribo/demo/tip/gui.pro
diff --git a/milena/sandbox/lazzara/afp/photos/gui/gui.qrc b/scribo/demo/tip/gui.qrc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/gui.qrc
rename to scribo/demo/tip/gui.qrc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/next.png b/scribo/demo/tip/icons/next.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/next.png
rename to scribo/demo/tip/icons/next.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/ok.png b/scribo/demo/tip/icons/ok.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/ok.png
rename to scribo/demo/tip/icons/ok.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/photos.png b/scribo/demo/tip/icons/photos.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/photos.png
rename to scribo/demo/tip/icons/photos.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/prev.png b/scribo/demo/tip/icons/prev.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/prev.png
rename to scribo/demo/tip/icons/prev.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/remove.png b/scribo/demo/tip/icons/remove.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/remove.png
rename to scribo/demo/tip/icons/remove.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc b/scribo/demo/tip/src/custom_delegate.cc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc
rename to scribo/demo/tip/src/custom_delegate.cc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh b/scribo/demo/tip/src/custom_delegate.hh
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh
rename to scribo/demo/tip/src/custom_delegate.hh
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc b/scribo/demo/tip/src/launch_dialog.cc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc
rename to scribo/demo/tip/src/launch_dialog.cc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh b/scribo/demo/tip/src/launch_dialog.hh
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh
rename to scribo/demo/tip/src/launch_dialog.hh
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main.cc b/scribo/demo/tip/src/main.cc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/main.cc
rename to scribo/demo/tip/src/main.cc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc b/scribo/demo/tip/src/main_window.cc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
rename to scribo/demo/tip/src/main_window.cc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh b/scribo/demo/tip/src/main_window.hh
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
rename to scribo/demo/tip/src/main_window.hh
diff --git a/milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui b/scribo/demo/tip/ui/launch_dialog.ui
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui
rename to scribo/demo/tip/ui/launch_dialog.ui
diff --git a/milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui b/scribo/demo/tip/ui/main_window.ui
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui
rename to scribo/demo/tip/ui/main_window.ui
--
1.5.6.5
1
0

03 Jun '10
* core/concept/dmax_functor.hh,
* primitive/link/internal/dmax_default.hh,
* primitive/link/internal/dmax_functor_base.hh,
* primitive/link/internal/dmax_width_and_height.hh,
* primitive/link/internal/dmax_width_only.hh: New.
* primitive/link/internal/link_single_dmax_ratio_base.hh,
* primitive/link/with_single_left_link_dmax_ratio.hh,
* primitive/link/with_single_right_link_dmax_ratio.hh: Make use of
the new functors.
---
scribo/ChangeLog | 15 +++
.../concept/{link_functor.hh => dmax_functor.hh} | 15 +--
.../find_root.hh => link/internal/dmax_default.hh} | 54 ++++++-----
.../internal/dmax_functor_base.hh} | 69 ++++++++++----
.../dmax_width_and_height.hh} | 79 ++++++++--------
.../internal/dmax_width_only.hh} | 66 +++++++++-----
.../link/internal/link_single_dmax_ratio_base.hh | 69 +++++++++-----
.../link/with_single_left_link_dmax_ratio.hh | 100 +++++++++++++++-----
.../link/with_single_right_link_dmax_ratio.hh | 65 +++++++++----
9 files changed, 348 insertions(+), 184 deletions(-)
copy scribo/core/concept/{link_functor.hh => dmax_functor.hh} (80%)
copy scribo/primitive/{internal/find_root.hh => link/internal/dmax_default.hh} (61%)
copy scribo/primitive/{internal/find_root.hh => link/internal/dmax_functor_base.hh} (54%)
copy scribo/primitive/link/{with_rag.hh => internal/dmax_width_and_height.hh} (53%)
copy scribo/primitive/{internal/find_root.hh => link/internal/dmax_width_only.hh} (56%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 0408bf3..6acc319 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,20 @@
2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Introduce dmax_functor concept.
+
+ * core/concept/dmax_functor.hh,
+ * primitive/link/internal/dmax_default.hh,
+ * primitive/link/internal/dmax_functor_base.hh,
+ * primitive/link/internal/dmax_width_and_height.hh,
+ * primitive/link/internal/dmax_width_only.hh: New.
+
+ * primitive/link/internal/link_single_dmax_ratio_base.hh,
+ * primitive/link/with_single_left_link_dmax_ratio.hh,
+ * primitive/link/with_single_right_link_dmax_ratio.hh: Make use of
+ the new functors.
+
+2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Small fixes in Scribo.
* binarization/sauvola_ms.hh,
diff --git a/scribo/core/concept/link_functor.hh b/scribo/core/concept/dmax_functor.hh
similarity index 80%
copy from scribo/core/concept/link_functor.hh
copy to scribo/core/concept/dmax_functor.hh
index f51843a..755913c 100644
--- a/scribo/core/concept/link_functor.hh
+++ b/scribo/core/concept/dmax_functor.hh
@@ -23,24 +23,21 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_CORE_INTERNAL_LINK_FUNCTOR_HH
-# define SCRIBO_CORE_INTERNAL_LINK_FUNCTOR_HH
+#ifndef SCRIBO_CORE_INTERNAL_DMAX_FUNCTOR_HH
+# define SCRIBO_CORE_INTERNAL_DMAX_FUNCTOR_HH
/// \file
///
-/// Link functor concept.
+/// DMax functor concept.
# include <mln/core/concept/object.hh>
-# define scribo_support(T) typename T::support
-# define scribo_support_(T) T::support
-
namespace scribo
{
- /// \brief Link functor concept.
+ /// \brief Dmax functor concept.
template <typename E>
- class Link_Functor : public mln::Object<E>
+ class DMax_Functor : public mln::Object<E>
{
// typedef L support
@@ -50,4 +47,4 @@ namespace scribo
} // end of namespace scribo
-#endif // SCRIBO_CORE_INTERNAL_LINK_FUNCTOR_HH
+#endif // SCRIBO_CORE_INTERNAL_DMAX_FUNCTOR_HH
diff --git a/scribo/primitive/internal/find_root.hh b/scribo/primitive/link/internal/dmax_default.hh
similarity index 61%
copy from scribo/primitive/internal/find_root.hh
copy to scribo/primitive/link/internal/dmax_default.hh
index 4fa6d20..1444dfe 100644
--- a/scribo/primitive/internal/find_root.hh
+++ b/scribo/primitive/link/internal/dmax_default.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,15 +23,14 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
-# define SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#ifndef SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_DEFAULT_HH
+# define SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_DEFAULT_HH
/// \file
///
-/// Find root in a parent array arrays.
+/// Default class for dmax functors.
-
-# include <scribo/core/object_groups.hh>
+# include <scribo/primitive/link/internal/dmax_functor_base.hh>
namespace scribo
@@ -40,34 +39,45 @@ namespace scribo
namespace primitive
{
+ namespace link
+ {
+
namespace internal
{
- /// Find root in a parent array arrays.
- template <typename L>
- unsigned
- find_root(object_groups<L>& parent, unsigned x);
+
+ /// \brief Base class for dmax functors.
+ class dmax_default : public dmax_functor_base<dmax_default>
+ {
+ typedef dmax_functor_base<dmax_default> super_;
+
+ public:
+ dmax_default(const float& dmax_factor);
+
+ protected:
+ using super_::dmax_factor_;
+ };
+
# ifndef MLN_INCLUDE_ONLY
- template <typename L>
- inline
- unsigned
- find_root(object_groups<L>& parent, unsigned x)
- {
- if (parent(x) == x)
- return x;
- else
- return parent(x) = find_root(parent, parent(x));
+
+ dmax_default::dmax_default(const float& dmax_factor)
+ : super_(dmax_factor)
+ {
}
+
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace scribo::primitive::internal
- } // end of namespace scribo::text
+ } // end of namespace scribo::primitive::link::internal
+
+ } // end of namespace scribo::primitive::link
+
+ } // end of namespace scribo::primitive
} // end of namespace scribo
-#endif // ! SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#endif // ! SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_DEFAULT_HH
diff --git a/scribo/primitive/internal/find_root.hh b/scribo/primitive/link/internal/dmax_functor_base.hh
similarity index 54%
copy from scribo/primitive/internal/find_root.hh
copy to scribo/primitive/link/internal/dmax_functor_base.hh
index 4fa6d20..8ff3f10 100644
--- a/scribo/primitive/internal/find_root.hh
+++ b/scribo/primitive/link/internal/dmax_functor_base.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,16 +23,18 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
-# define SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#ifndef SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_FUNCTOR_BASE_HH
+# define SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_FUNCTOR_BASE_HH
/// \file
///
-/// Find root in a parent array arrays.
+/// Base class for dmax functors.
+# include <mln/core/alias/box2d.hh>
-# include <scribo/core/object_groups.hh>
+# include <mln/math/max.hh>
+# include <scribo/core/concept/dmax_functor.hh>
namespace scribo
{
@@ -40,34 +42,59 @@ namespace scribo
namespace primitive
{
+ namespace link
+ {
+
namespace internal
{
- /// Find root in a parent array arrays.
- template <typename L>
- unsigned
- find_root(object_groups<L>& parent, unsigned x);
+
+ /// \brief Base class for dmax functors.
+ template <typename E>
+ class dmax_functor_base : public DMax_Functor<E>
+ {
+
+ public:
+ dmax_functor_base(const float& dmax_factor);
+ float operator()(const box2d& b) const;
+
+ protected:
+ float dmax_factor_;
+ };
+
# ifndef MLN_INCLUDE_ONLY
- template <typename L>
- inline
- unsigned
- find_root(object_groups<L>& parent, unsigned x)
- {
- if (parent(x) == x)
- return x;
- else
- return parent(x) = find_root(parent, parent(x));
+
+ template <typename E>
+ dmax_functor_base<E>::dmax_functor_base(const float& dmax_factor)
+ : dmax_factor_(dmax_factor)
+ {
}
+
+ template <typename E>
+ float
+ dmax_functor_base<E>::operator()(const box2d& b) const
+ {
+ float
+ w = b.width(),
+ h = b.height();
+
+ return (w / 2.0f) + (dmax_factor_ * math::max(w, h));
+ }
+
+
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace scribo::primitive::internal
- } // end of namespace scribo::text
+ } // end of namespace scribo::primitive::link::internal
+
+ } // end of namespace scribo::primitive::link
+
+ } // end of namespace scribo::primitive
} // end of namespace scribo
-#endif // ! SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#endif // ! SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_FUNCTOR_BASE_HH
diff --git a/scribo/primitive/link/with_rag.hh b/scribo/primitive/link/internal/dmax_width_and_height.hh
similarity index 53%
copy from scribo/primitive/link/with_rag.hh
copy to scribo/primitive/link/internal/dmax_width_and_height.hh
index 3638ec7..3f19f1f 100644
--- a/scribo/primitive/link/with_rag.hh
+++ b/scribo/primitive/link/internal/dmax_width_and_height.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,26 +23,16 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_PRIMITIVE_LINK_WITH_RAG_HH
-# define SCRIBO_PRIMITIVE_LINK_WITH_RAG_HH
-
+#ifndef SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_AND_HEIGHT_HH
+# define SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_AND_HEIGHT_HH
/// \file
///
-/// Link objects with a region adjacency graph.
-
-# include <mln/core/concept/neighborhood.hh>
-
-# include <mln/util/graph.hh>
-# include <mln/util/couple.hh>
-
-# include <mln/transform/influence_zone_geodesic.hh>
-
-# include <mln/make/influence_zone_adjacency_graph.hh>
-
+/// Dmax functor relying on width only.
+///
+/// For newspapers like ICDAR documents, use dmax_factor = 1.
-# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
+# include <scribo/primitive/link/internal/dmax_functor_base.hh>
namespace scribo
@@ -54,46 +44,55 @@ namespace scribo
namespace link
{
- using namespace mln;
+ namespace internal
+ {
+
+ /// \brief Base class for dmax functors.
+ class dmax_width_and_height : public dmax_functor_base<dmax_width_and_height>
+ {
+ typedef dmax_functor_base<dmax_width_and_height> super_;
- template <typename L, typename N>
- util::couple<mln::util::graph, mln_concrete(L)>
- with_rag(const object_image(L)& objects,
- const Neighborhood<N>& nbh);
+ public:
+ dmax_width_and_height(const float& dmax_factor);
+ float operator()(const box2d&) const;
-# ifndef MLN_INCLUDE_ONLY
+ protected:
+ using super_::dmax_factor_;
+ };
- template <typename L, typename N>
- util::couple<mln::util::graph, mln_concrete(L)>
- with_rag(const object_image(L)& objects,
- const Neighborhood<N>& nbh)
- {
- trace::entering("scribo::primitive::link::with_rag");
+# ifndef MLN_INCLUDE_ONLY
- mln_precondition(objects.is_valid());
- mln_concrete(L)
- iz = transform::influence_zone_geodesic(objects, nbh);
+ dmax_width_and_height::dmax_width_and_height(const float& dmax_factor)
+ : super_(dmax_factor)
+ {
+ }
- mln::util::graph
- g = mln::make::influence_zone_adjacency_graph(iz,
- nbh,
- objects.nlabels());
- trace::exiting("scribo::primitive::link::with_rag");
- return make::couple(g, iz);
- }
+ float
+ dmax_width_and_height::operator()(const box2d& b) const
+ {
+ float
+ w = b.width(),
+ h = b.height();
+
+ return (w / 2.0f) + dmax_factor_ * (h + w);
+ }
# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::primitive::link::internal
+
} // end of namespace scribo::primitive::link
} // end of namespace scribo::primitive
} // end of namespace scribo
-#endif // ! SCRIBO_PRIMITIVE_LINK_WITH_RAG_HH
+
+#endif // ! SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_AND_HEIGHT_HH
diff --git a/scribo/primitive/internal/find_root.hh b/scribo/primitive/link/internal/dmax_width_only.hh
similarity index 56%
copy from scribo/primitive/internal/find_root.hh
copy to scribo/primitive/link/internal/dmax_width_only.hh
index 4fa6d20..034d40b 100644
--- a/scribo/primitive/internal/find_root.hh
+++ b/scribo/primitive/link/internal/dmax_width_only.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,15 +23,16 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
-# define SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#ifndef SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_ONLY_HH
+# define SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_ONLY_HH
/// \file
///
-/// Find root in a parent array arrays.
-
+/// Dmax functor relying on width only.
+///
+/// To use for paragraph alignment.
-# include <scribo/core/object_groups.hh>
+# include <scribo/primitive/link/internal/dmax_functor_base.hh>
namespace scribo
@@ -40,34 +41,55 @@ namespace scribo
namespace primitive
{
+ namespace link
+ {
+
namespace internal
{
- /// Find root in a parent array arrays.
- template <typename L>
- unsigned
- find_root(object_groups<L>& parent, unsigned x);
+
+ /// \brief Base class for dmax functors.
+ class dmax_width_only : public dmax_functor_base<dmax_width_only>
+ {
+ typedef dmax_functor_base<dmax_width_only> super_;
+
+
+ public:
+ dmax_width_only();
+ float operator()(const box2d&) const;
+
+ protected:
+ using super_::dmax_factor_;
+ };
+
# ifndef MLN_INCLUDE_ONLY
- template <typename L>
- inline
- unsigned
- find_root(object_groups<L>& parent, unsigned x)
- {
- if (parent(x) == x)
- return x;
- else
- return parent(x) = find_root(parent, parent(x));
+
+ dmax_width_only::dmax_width_only()
+ : super_(0)
+ {
+ }
+
+
+ float
+ dmax_width_only::operator()(const box2d& b) const
+ {
+ float w = b.width();
+ return (w / 2.0f) + (dmax_factor_ * w);
}
+
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace scribo::primitive::internal
- } // end of namespace scribo::text
+ } // end of namespace scribo::primitive::link::internal
+
+ } // end of namespace scribo::primitive::link
+
+ } // end of namespace scribo::primitive
} // end of namespace scribo
-#endif // ! SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#endif // ! SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_ONLY_HH
diff --git a/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh b/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh
index 1a4cb73..d3aba42 100644
--- a/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh
+++ b/scribo/primitive/link/internal/link_single_dmax_ratio_base.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.
//
@@ -43,6 +44,8 @@
# include <scribo/core/component_set.hh>
# include <scribo/core/object_links.hh>
+# include <scribo/core/concept/dmax_functor.hh>
+
# include <scribo/primitive/link/internal/compute_anchor.hh>
# include <scribo/primitive/link/internal/find_link.hh>
# include <scribo/primitive/link/internal/link_functor_base.hh>
@@ -65,9 +68,9 @@ namespace scribo
/// \brief Base class for link functors using bounding box
/// center and a proportional max distance.
//
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
class link_single_dmax_ratio_base
- : public link_functor_base<L, E>
+ : public link_functor_base<L,E>
{
typedef link_functor_base<L,E> super_;
typedef mln_result(accu::center<mln_psite(L)>) ms_t;
@@ -76,10 +79,9 @@ namespace scribo
typedef mln_site(L) P;
-
link_single_dmax_ratio_base(const component_set<L>& components,
- float dmax_ratio,
- anchor::Direction direction);
+ anchor::Direction direction,
+ const DMax_Functor<F>& dmax_f);
@@ -91,8 +93,8 @@ namespace scribo
void start_processing_object_(unsigned current_object);
- private:
- float dmax_ratio_;
+ protected:
+ const F dmax_f_;
float dmax_;
anchor::Direction direction_;
};
@@ -101,24 +103,24 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
inline
- link_single_dmax_ratio_base<L, E>::link_single_dmax_ratio_base(
+ link_single_dmax_ratio_base<L, F, E>::link_single_dmax_ratio_base(
const component_set<L>& components,
- float dmax_ratio,
- anchor::Direction direction)
+ anchor::Direction direction,
+ const DMax_Functor<F>& dmax_f)
- : super_(components),
- dmax_ratio_(dmax_ratio),
+ : super_(components),
+ dmax_f_(exact(dmax_f)),
dmax_(0),
direction_(direction)
{
}
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
inline
bool
- link_single_dmax_ratio_base<L, E>::verify_link_criterion_(
+ link_single_dmax_ratio_base<L, F, E>::verify_link_criterion_(
unsigned current_object,
const P& start_point,
const P& p) const
@@ -130,10 +132,10 @@ namespace scribo
}
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
inline
mln_site(L)
- link_single_dmax_ratio_base<L, E>::start_point_(unsigned current_object,
+ link_single_dmax_ratio_base<L, F, E>::start_point_(unsigned current_object,
anchor::Type anchor)
{
(void) anchor;
@@ -142,18 +144,33 @@ namespace scribo
}
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
inline
void
- link_single_dmax_ratio_base<L, E>::start_processing_object_(
+ link_single_dmax_ratio_base<L, F, E>::start_processing_object_(
unsigned current_object)
{
- float
- w = this->components_.info(current_object).bbox().width(),
- h = this->components_.info(current_object).bbox().height();
-// dmax_ = (w / 2.0f) + (dmax_ratio_ * math::max(w, h));
-// dmax_ = (w / 2.0f) + (dmax_ratio_ * w);
- dmax_ = (w / 2.0f) + (h + w);
+ dmax_ = dmax_f_(this->components_.info(current_object).bbox());
+
+
+// float
+// w = this->components_.info(current_object).bbox().width();
+// // h = this->components_.info(current_object).bbox().height();
+
+// // FIXME: default case
+// // dmax_ = (w / 2.0f) + (dmax_ratio_ * math::max(w, h));
+
+// // FIXME: to use for paragraph alignment
+// dmax_ = (w / 2.0f) + (dmax_ratio_ * w);
+
+ // FIXME: to use for newspapers like ICDAR documents!
+// dmax_ = (w / 2.0f) + (h + w);
+
+ // FIXME: more general use case for newspapers
+// dmax_ = (w / 2.0f) + dmax_ratio_ * (h + w);
+
+
+ // FIXME: WE WANT TO PROVIDE A DMAX RULE THROUGH A FUNCTOR.
}
diff --git a/scribo/primitive/link/with_single_left_link_dmax_ratio.hh b/scribo/primitive/link/with_single_left_link_dmax_ratio.hh
index 8be4ae2..dc99728 100644
--- a/scribo/primitive/link/with_single_left_link_dmax_ratio.hh
+++ b/scribo/primitive/link/with_single_left_link_dmax_ratio.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.
//
@@ -40,10 +41,12 @@
# include <mln/util/array.hh>
# include <scribo/core/macros.hh>
+# include <scribo/core/concept/dmax_functor.hh>
# include <scribo/core/component_set.hh>
# include <scribo/core/object_links.hh>
# include <scribo/primitive/link/internal/find_link.hh>
+# include <scribo/primitive/link/internal/dmax_default.hh>
# include <scribo/primitive/link/internal/link_single_dmax_ratio_base.hh>
# include <scribo/primitive/link/compute.hh>
@@ -60,19 +63,38 @@ namespace scribo
/*! \brief Link components with their left neighbor if exists.
- \param[in] components An component image.
- \param[in] dmax_ratio
+ \param[in] components A component set.
+ \param[in] anchor Starting point for the neighbor lookup.
+ \param[in] dmax_f DMax functor defining the maximum lookup
+ distance.
\return Object links data.
+ Look for a neighbor until a maximum distance is reached. The
+ maximum distance is defined thanks to a functor \p dmax_f.
+ */
+ template <typename L, typename F>
+ inline
+ object_links<L>
+ with_single_left_link_dmax_ratio(const component_set<L>& components,
+ const DMax_Functor<F>& dmax_f,
+ anchor::Type anchor);
- Look for a neighbor until a maximum distance defined by :
-
- dmax = w / 2 + dmax_ratio * max(h, w)
+ /// \overload
+ ///
+ /// The default dmax functor is used (internal::dmax_default).
+ //
+ template <typename L, typename F>
+ inline
+ object_links<L>
+ with_single_left_link_dmax_ratio(const component_set<L>& components,
+ float dmax_ratio,
+ anchor::Type anchor);
- where w is the bounding box width and h the bounding box height.
- */
+ /// \overload
+ /// anchor is set to anchor::MassCenter.
+ //
template <typename L>
inline
object_links<L>
@@ -81,14 +103,18 @@ namespace scribo
/// \overload
- /// dmax_ratio is set to 3.
- template <typename L>
+ ///
+ /// The default dmax functor is used (internal::dmax_default)
+ /// with dmax_ratio set to 3.
+ ///
+ /// anchor is set to anchor::MassCenter.
+ //
+ template <typename L, typename F>
inline
object_links<L>
with_single_left_link_dmax_ratio(const component_set<L>& components);
-
# ifndef MLN_INCLUDE_ONLY
@@ -97,20 +123,20 @@ namespace scribo
// Functor
- template <typename L>
+ template <typename L, typename F>
class single_left_dmax_ratio_functor
- : public internal::link_single_dmax_ratio_base<L,
- single_left_dmax_ratio_functor<L> >
+ : public internal::link_single_dmax_ratio_base<L, F,
+ single_left_dmax_ratio_functor<L, F> >
{
- typedef single_left_dmax_ratio_functor<L> self_t;
- typedef internal::link_single_dmax_ratio_base<L, self_t> super_;
+ typedef single_left_dmax_ratio_functor<L, F> self_t;
+ typedef internal::link_single_dmax_ratio_base<L, F, self_t> super_;
public:
typedef mln_site(L) P;
single_left_dmax_ratio_functor(const component_set<L>& components,
- unsigned dmax)
- : super_(components, dmax, anchor::Horizontal)
+ const DMax_Functor<F>& dmax_f)
+ : super_(components, anchor::Horizontal, exact(dmax_f))
{
}
@@ -127,26 +153,54 @@ namespace scribo
// Facades
- template <typename L>
+ template <typename L, typename F>
inline
object_links<L>
with_single_left_link_dmax_ratio(const component_set<L>& components,
- float dmax_ratio)
+ const DMax_Functor<F>& dmax_f,
+ anchor::Type anchor)
{
trace::entering("scribo::primitive::link::with_single_left_link_dmax_ratio");
mln_precondition(components.is_valid());
- internal::single_left_dmax_ratio_functor<L>
- functor(components, dmax_ratio);
+ internal::single_left_dmax_ratio_functor<L, F>
+ functor(components, dmax_f);
- object_links<L> output = compute(functor);
+ object_links<L> output = compute(functor, anchor);
trace::exiting("scribo::primitive::link::with_single_left_link_dmax_ratio");
return output;
}
+ template <typename L, typename F>
+ inline
+ object_links<L>
+ with_single_left_link_dmax_ratio(const component_set<L>& components,
+ float dmax_ratio,
+ anchor::Type anchor)
+ {
+ return
+ with_single_left_link_dmax_ratio(components,
+ internal::dmax_default(dmax_ratio),
+ anchor);
+ }
+
+
+ template <typename L>
+ inline
+ object_links<L>
+ with_single_left_link_dmax_ratio(const component_set<L>& components,
+ float dmax_ratio)
+ {
+ return
+ with_single_left_link_dmax_ratio(components,
+ internal::dmax_default(dmax_ratio),
+ anchor::MassCenter);
+ }
+
+
template <typename L>
inline
object_links<L>
diff --git a/scribo/primitive/link/with_single_right_link_dmax_ratio.hh b/scribo/primitive/link/with_single_right_link_dmax_ratio.hh
index d3637ef..dea51d1 100644
--- a/scribo/primitive/link/with_single_right_link_dmax_ratio.hh
+++ b/scribo/primitive/link/with_single_right_link_dmax_ratio.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.
//
@@ -61,25 +62,32 @@ namespace scribo
/*! \brief Link objects with their right neighbor if exists.
\param[in] components A component set.
- \param[in] dmax_ratio Size ratio defining the maximum lookup
- distance.
\param[in] anchor Starting point for the neighbor lookup.
+ \param[in] dmax_f DMax functor defining the maximum lookup
+ distance.
\return Object links data.
- Look for a neighbor until a maximum distance defined by :
-
- dmax = w / 2 + dmax_ratio * max(h, w)
+ Look for a neighbor until a maximum distance is reached. The
+ maximum distance is defined thanks to a functor \p dmax_f.
+ */
+ template <typename L, typename F>
+ inline
+ object_links<L>
+ with_single_right_link_dmax_ratio(const component_set<L>& components,
+ const DMax_Functor<F>& dmax_f,
+ anchor::Type anchor);
- where w is the bounding box width and h the bounding box height.
- */
+ /// \overload
+ /// \p dmax_f is set to internal::dmax_default.
template <typename L>
inline
object_links<L>
with_single_right_link_dmax_ratio(const component_set<L>& components,
- float dmax_ratio, anchor::Type anchor);
+ float dmax_ratio,
+ anchor::Type anchor);
/// \overload
/// anchor is set to MassCenter.
@@ -108,20 +116,20 @@ namespace scribo
// Functor
- template <typename L>
+ template <typename L, typename F>
class single_right_dmax_ratio_functor
- : public link_single_dmax_ratio_base<L,
- single_right_dmax_ratio_functor<L> >
+ : public link_single_dmax_ratio_base<L, F,
+ single_right_dmax_ratio_functor<L,F> >
{
- typedef single_right_dmax_ratio_functor<L> self_t;
- typedef link_single_dmax_ratio_base<L, self_t> super_;
+ typedef single_right_dmax_ratio_functor<L, F> self_t;
+ typedef link_single_dmax_ratio_base<L, F, self_t> super_;
public:
typedef mln_site(L) P;
single_right_dmax_ratio_functor(const component_set<L>& components,
- unsigned dmax)
- : super_(components, dmax, anchor::Horizontal)
+ const DMax_Functor<F>& dmax_f)
+ : super_(components, anchor::Horizontal, exact(dmax_f))
{
}
@@ -139,18 +147,19 @@ namespace scribo
// Facades
- template <typename L>
+ template <typename L, typename F>
inline
object_links<L>
with_single_right_link_dmax_ratio(const component_set<L>& components,
- float dmax_ratio, anchor::Type anchor)
+ const DMax_Functor<F>& dmax_f,
+ anchor::Type anchor)
{
trace::entering("scribo::primitive::link::with_single_right_link_dmax_ratio");
mln_precondition(components.is_valid());
- internal::single_right_dmax_ratio_functor<L>
- functor(components, dmax_ratio);
+ internal::single_right_dmax_ratio_functor<L, F>
+ functor(components, dmax_f);
object_links<L> output = compute(functor, anchor);
@@ -158,6 +167,19 @@ namespace scribo
return output;
}
+ template <typename L>
+ inline
+ object_links<L>
+ with_single_right_link_dmax_ratio(const component_set<L>& components,
+ float dmax_ratio,
+ anchor::Type anchor)
+ {
+ return
+ with_single_right_link_dmax_ratio(components,
+ internal::dmax_default(dmax_ratio),
+ anchor);
+ }
+
template <typename L>
@@ -166,7 +188,8 @@ namespace scribo
with_single_right_link_dmax_ratio(const component_set<L>& components,
float dmax_ratio)
{
- return with_single_right_link_dmax_ratio(components, dmax_ratio,
+ return with_single_right_link_dmax_ratio(components,
+ dmax_ratio,
anchor::MassCenter);
}
--
1.5.6.5
1
0
* binarization/sauvola_ms.hh,
* binarization/sauvola_threshold_image_debug.hh: Update prototypes.
* primitive/internal/rd.hh,
* primitive/group/apply.hh,
* debug/save_bboxes_image.hh: Add missing mln:: namespace prefix.
* filter/objects_large.hh: Split into a routine and a functor.
* fun/v2b/objects_large_filter.hh: New.
* io/xml/save_text_lines.hh: Save line type.
* table/internal/repair_lines.hh,
* table/internal/align_lines.hh,
* make/text.hh: Update macro name.
* core/erase_objects.hh,
* primitive/extract/lines_discontinued.hh,
* primitive/extract/lines_h_discontinued.hh,
* primitive/extract/lines_h_pattern.hh,
* primitive/extract/lines_h_single.hh,
* primitive/extract/lines_h_thick.hh,
* primitive/extract/lines_thick.hh,
* primitive/extract/lines_v_discontinued.hh,
* primitive/extract/lines_v_single.hh,
* primitive/extract/lines_v_thick.hh,
* primitive/group/from_graph.hh,
* primitive/internal/find_graph_link.hh,
* primitive/link/with_graph.hh,
* primitive/link/with_several_graphes.hh,
* primitive/link/with_several_left_links.hh,
* primitive/link/with_several_right_links.hh,
* table/erase.hh,
* table/extract.hh: Remove any references to object_image.
* table/internal/connect_lines.hh: use
influence_zone_geodesic_saturated
* filter/objects_small.hh: Duplicate component set.
* primitive/internal/all.hh,
* primitive/extract/all.hh,
* filter/all.hh,
* core/all.hh: Remove non existing includes.
* core/macros.hh: New macro.
* core/line_info.hh: Fix stats.
* filter/object_links_non_aligned.hh,
* filter/object_links_non_h_aligned.hh,
* filter/object_links_non_v_aligned.hh: Removed.
---
scribo/ChangeLog | 58 ++++++++
scribo/binarization/sauvola_ms.hh | 6 +-
.../binarization/sauvola_threshold_image_debug.hh | 44 +++---
scribo/core/all.hh | 4 +-
scribo/core/erase_objects.hh | 13 +-
scribo/core/line_info.hh | 2 +-
scribo/core/macros.hh | 3 +
scribo/debug/save_bboxes_image.hh | 6 +-
scribo/filter/all.hh | 3 -
scribo/filter/object_links_non_aligned.hh | 138 --------------------
scribo/filter/object_links_non_h_aligned.hh | 109 ---------------
scribo/filter/object_links_non_v_aligned.hh | 122 -----------------
scribo/filter/objects_large.hh | 130 +++----------------
scribo/filter/objects_small.hh | 2 +-
...cts_small_filter.hh => objects_large_filter.hh} | 36 +++---
scribo/io/xml/save_text_lines.hh | 1 +
scribo/make/text.hh | 2 +-
scribo/primitive/extract/all.hh | 5 +-
scribo/primitive/extract/lines_discontinued.hh | 14 +-
scribo/primitive/extract/lines_h_discontinued.hh | 10 +-
scribo/primitive/extract/lines_h_pattern.hh | 39 +++---
scribo/primitive/extract/lines_h_single.hh | 47 ++++----
scribo/primitive/extract/lines_h_thick.hh | 8 +-
scribo/primitive/extract/lines_thick.hh | 11 +-
scribo/primitive/extract/lines_v_discontinued.hh | 10 +-
scribo/primitive/extract/lines_v_single.hh | 47 +++----
scribo/primitive/extract/lines_v_thick.hh | 14 +-
scribo/primitive/group/apply.hh | 4 +-
scribo/primitive/group/from_graph.hh | 1 -
scribo/primitive/internal/all.hh | 3 -
scribo/primitive/internal/find_graph_link.hh | 1 -
scribo/primitive/internal/rd.hh | 2 +-
scribo/primitive/link/with_graph.hh | 2 -
scribo/primitive/link/with_several_graphes.hh | 6 +-
scribo/primitive/link/with_several_left_links.hh | 2 -
scribo/primitive/link/with_several_right_links.hh | 3 -
scribo/table/erase.hh | 10 +-
scribo/table/extract.hh | 3 +-
scribo/table/internal/align_lines.hh | 2 +-
scribo/table/internal/connect_lines.hh | 7 +-
scribo/table/internal/repair_lines.hh | 2 +-
41 files changed, 255 insertions(+), 677 deletions(-)
delete mode 100644 scribo/filter/object_links_non_aligned.hh
delete mode 100644 scribo/filter/object_links_non_h_aligned.hh
delete mode 100644 scribo/filter/object_links_non_v_aligned.hh
copy scribo/fun/v2b/{objects_small_filter.hh => objects_large_filter.hh} (74%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index a36b5e1..0408bf3 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,61 @@
+2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Small fixes in Scribo.
+
+ * binarization/sauvola_ms.hh,
+ * binarization/sauvola_threshold_image_debug.hh: Update prototypes.
+
+ * primitive/internal/rd.hh,
+ * primitive/group/apply.hh,
+ * debug/save_bboxes_image.hh: Add missing mln:: namespace prefix.
+
+ * filter/objects_large.hh: Split into a routine and a functor.
+
+ * fun/v2b/objects_large_filter.hh: New.
+
+ * io/xml/save_text_lines.hh: Save line type.
+
+ * table/internal/repair_lines.hh,
+ * table/internal/align_lines.hh,
+ * make/text.hh: Update macro name.
+
+ * core/erase_objects.hh,
+ * primitive/extract/lines_discontinued.hh,
+ * primitive/extract/lines_h_discontinued.hh,
+ * primitive/extract/lines_h_pattern.hh,
+ * primitive/extract/lines_h_single.hh,
+ * primitive/extract/lines_h_thick.hh,
+ * primitive/extract/lines_thick.hh,
+ * primitive/extract/lines_v_discontinued.hh,
+ * primitive/extract/lines_v_single.hh,
+ * primitive/extract/lines_v_thick.hh,
+ * primitive/group/from_graph.hh,
+ * primitive/internal/find_graph_link.hh,
+ * primitive/link/with_graph.hh,
+ * primitive/link/with_several_graphes.hh,
+ * primitive/link/with_several_left_links.hh,
+ * primitive/link/with_several_right_links.hh,
+ * table/erase.hh,
+ * table/extract.hh: Remove any references to object_image.
+
+ * table/internal/connect_lines.hh: use
+ influence_zone_geodesic_saturated
+
+ * filter/objects_small.hh: Duplicate component set.
+
+ * primitive/internal/all.hh,
+ * primitive/extract/all.hh,
+ * filter/all.hh,
+ * core/all.hh: Remove non existing includes.
+
+ * core/macros.hh: New macro.
+
+ * core/line_info.hh: Fix stats.
+
+ * filter/object_links_non_aligned.hh,
+ * filter/object_links_non_h_aligned.hh,
+ * filter/object_links_non_v_aligned.hh: Removed.
+
2010-03-19 Guillaume Lazzara <z(a)lrde.epita.fr>
Improve dematerialization wizard.
diff --git a/scribo/binarization/sauvola_ms.hh b/scribo/binarization/sauvola_ms.hh
index 6e70e04..621c638 100644
--- a/scribo/binarization/sauvola_ms.hh
+++ b/scribo/binarization/sauvola_ms.hh
@@ -94,16 +94,14 @@ namespace scribo
*/
template <typename I>
mln_ch_value(I,bool)
- sauvola_ms(const Image<I>& input_1_, unsigned w_1,
- unsigned s, unsigned lambda_min_1, double K);
+ sauvola_ms(const Image<I>& input_1_, unsigned w_1, unsigned s, double K);
/// \overload
/// K is set to 0.34.
//
template <typename I>
mln_ch_value(I,bool)
- sauvola_ms(const Image<I>& input_1, unsigned w_1,
- unsigned s, unsigned lambda_min_1);
+ sauvola_ms(const Image<I>& input_1, unsigned w_1, unsigned s);
diff --git a/scribo/binarization/sauvola_threshold_image_debug.hh b/scribo/binarization/sauvola_threshold_image_debug.hh
index 18216a6..359bb57 100644
--- a/scribo/binarization/sauvola_threshold_image_debug.hh
+++ b/scribo/binarization/sauvola_threshold_image_debug.hh
@@ -123,10 +123,10 @@ namespace scribo
\return A threshold.
*/
- template <typename P, typename I, typename J>
+ template <typename P, typename M, typename J>
double
compute_sauvola_threshold(const P& p,
- I& mean, I& stddev,
+ M& mean, M& stddev,
const J& simple,
const J& squared,
int win_width, double K, double R)
@@ -156,7 +156,7 @@ namespace scribo
double m_x_y = m_x_y_tmp / wh;
- mean(p) = m_x_y * mean_debug_factor;
+ mean(p) = m_x_y;// * mean_debug_factor;
// Standard deviation.
double s_x_y_tmp = (squared.at_(row_max, col_max)
@@ -166,7 +166,7 @@ namespace scribo
double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
- stddev(p) = s_x_y * stddev_debug_factor;
+ stddev(p) = s_x_y;// * stddev_debug_factor;
// Thresholding.
double t_x_y = sauvola_threshold_formula(m_x_y, s_x_y, K, R);
@@ -198,21 +198,21 @@ namespace scribo
namespace generic
{
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_concrete(I)
sauvola_threshold_image_debug(const Image<I>& input_,
unsigned window_size,
double K,
- Image<I>& mean_, Image<I>& stddev_,
+ Image<M>& mean_, Image<M>& stddev_,
Image<J>& simple_,
Image<J>& squared_)
{
trace::entering("scribo::binarization::impl::generic::sauvola_threshold_image_debug");
const I& input = exact(input_);
- I& mean = exact(mean_);
- I& stddev = exact(stddev_);
+ M& mean = exact(mean_);
+ M& stddev = exact(stddev_);
J& simple = exact(simple_);
J& squared = exact(squared_);
@@ -248,13 +248,13 @@ namespace scribo
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_concrete(I)
sauvola_threshold_image_debug_gl(const Image<I>& input,
unsigned window_size,
double K,
- Image<I>& mean, Image<I>& stddev,
+ Image<M>& mean, Image<M>& stddev,
Image<J>& simple,
Image<J>& squared)
{
@@ -265,13 +265,13 @@ namespace scribo
}
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug_rgb8(const Image<I>& input,
unsigned window_size,
double K,
- Image<I>& mean, Image<I>& stddev,
+ Image<M>& mean, Image<M>& stddev,
Image<J>& simple,
Image<J>& squared)
{
@@ -302,14 +302,14 @@ namespace scribo
namespace internal
{
- template <unsigned n, typename I, typename J>
+ template <unsigned n, typename I, typename M, typename J>
inline
mln_ch_value(I, value::int_u<n>)
sauvola_threshold_image_debug_dispatch(const value::int_u<n>&,
const I& input,
unsigned window_size,
double K,
- I& mean, I& stddev,
+ M& mean, M& stddev,
J& simple,
J& squared)
{
@@ -318,13 +318,13 @@ namespace scribo
simple, squared);
}
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug_dispatch(const value::rgb8&, const I& input,
unsigned window_size,
double K,
- I& mean, I& stddev,
+ M& mean, M& stddev,
J& simple,
J& squared)
{
@@ -333,11 +333,11 @@ namespace scribo
simple, squared);
}
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug_dispatch(const mln_value(I)&, const I& input,
- I& mean, I& stddev,
+ M& mean, M& stddev,
unsigned window_size,
double K,
J& simple,
@@ -355,11 +355,11 @@ namespace scribo
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug(const Image<I>& input, unsigned window_size,
double K,
- Image<I>& mean, Image<I>& stddev,
+ Image<M>& mean, Image<M>& stddev,
Image<J>& simple,
Image<J>& squared)
{
@@ -384,12 +384,12 @@ namespace scribo
}
- template <typename I>
+ template <typename I, typename M>
inline
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug(const Image<I>& input, unsigned window_size,
double K,
- Image<I>& mean, Image<I>& stddev)
+ Image<M>& mean, Image<M>& stddev)
{
mln_ch_value(I, double)
simple = init_integral_image(input, scribo::internal::identity_),
diff --git a/scribo/core/all.hh b/scribo/core/all.hh
index b98bf04..d00ccf8 100644
--- a/scribo/core/all.hh
+++ b/scribo/core/all.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.
//
@@ -44,6 +45,5 @@ namespace scribo
#include <scribo/core/central_sites.hh>
#include <scribo/core/erase_objects.hh>
#include <scribo/core/macros.hh>
-#include <scribo/core/object_image.hh>
#endif // ! SCRIBO_CORE_ALL_HH
diff --git a/scribo/core/erase_objects.hh b/scribo/core/erase_objects.hh
index 59a1346..3e401f0 100644
--- a/scribo/core/erase_objects.hh
+++ b/scribo/core/erase_objects.hh
@@ -32,12 +32,11 @@
# include <mln/core/concept/image.hh>
# include <mln/core/site_set/box.hh>
-# include <mln/data/paste.hh>
+# include <mln/data/fill.hh>
# include <mln/pw/all.hh>
# include <mln/util/array.hh>
# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
namespace scribo
{
@@ -47,14 +46,13 @@ namespace scribo
/// Remove labeled components from a binary image.
///
/// \param[in,out] input_ A binary image.
- /// \param[in] objects An object image. Objects will be set to
- /// false in \p input_.
+ /// \param[in] objects An image of objects (object value must be
+ /// different from 0).
///
//
template <typename I, typename L>
void
- erase_objects(Image<I>& input_,
- const object_image(L)& objects);
+ erase_objects(Image<I>& input, const Image<L>& objects);
# ifndef MLN_INCLUDE_ONLY
@@ -63,13 +61,14 @@ namespace scribo
template <typename I, typename L>
void
erase_objects(Image<I>& input_,
- const object_image(L)& objects)
+ const Image<L>& objects_)
{
trace::entering("scribo::erase_objects");
mlc_equal(mln_value(I),bool)::check();
I& input = exact(input_);
+ I& objects = exact(objects_);
mln_precondition(input.is_valid());
mln_precondition(objects.is_valid());
diff --git a/scribo/core/line_info.hh b/scribo/core/line_info.hh
index 0445f85..9ecf600 100644
--- a/scribo/core/line_info.hh
+++ b/scribo/core/line_info.hh
@@ -795,7 +795,7 @@ namespace scribo
// Space between characters.
int space = bb.pmin().col()
- - comp_set(holder_.links()(c)).bbox().pmax().col();
+ - comp_set(holder_.links()(c)).bbox().pmax().col() + 1;
// -- Ignore overlapped characters.
if (space > 0)
diff --git a/scribo/core/macros.hh b/scribo/core/macros.hh
index f644db3..040220c 100644
--- a/scribo/core/macros.hh
+++ b/scribo/core/macros.hh
@@ -52,6 +52,9 @@
# define for_all_lines(E, S) \
for_all_comps(E, S)
+# define for_all_line_comps(E, S) \
+ for_all_elements(E, S)
+
# define for_all_lines_info(E, S) \
for_all_comp_data(E, S)
diff --git a/scribo/debug/save_bboxes_image.hh b/scribo/debug/save_bboxes_image.hh
index f2c34e8..356ea6e 100644
--- a/scribo/debug/save_bboxes_image.hh
+++ b/scribo/debug/save_bboxes_image.hh
@@ -35,6 +35,7 @@
# include <mln/value/rgb8.hh>
# include <mln/util/array.hh>
# include <mln/io/ppm/save.hh>
+# include <mln/literal/colors.hh>
# include <scribo/core/line_set.hh>
# include <scribo/draw/bounding_boxes.hh>
@@ -108,13 +109,14 @@ namespace scribo
trace::entering("scribo::debug::save_bboxes_image");
mln_precondition(exact(input).is_valid());
- image2d<value::rgb8> output = data::convert(value::rgb8(), input);
+ mln_ch_value(I, value::rgb8)
+ output = data::convert(value::rgb8(), input);
for_all_lines(l, lines)
if (! lines(l).hidden())
mln::draw::box(output, lines(l).bbox(), value);
- io::ppm::save(output, filename);
+ mln::io::ppm::save(output, filename);
trace::exiting("scribo::debug::save_bboxes_image");
}
diff --git a/scribo/filter/all.hh b/scribo/filter/all.hh
index f9ef9ce..0b5bc11 100644
--- a/scribo/filter/all.hh
+++ b/scribo/filter/all.hh
@@ -42,9 +42,6 @@ namespace scribo
} // end of namespace scribo
# include <scribo/filter/object_groups_small.hh>
-# include <scribo/filter/object_links_non_aligned.hh>
-# include <scribo/filter/object_links_non_h_aligned.hh>
-# include <scribo/filter/object_links_non_v_aligned.hh>
# include <scribo/filter/objects_large.hh>
# include <scribo/filter/objects_small.hh>
# include <scribo/filter/objects_thick.hh>
diff --git a/scribo/filter/object_links_non_aligned.hh b/scribo/filter/object_links_non_aligned.hh
deleted file mode 100644
index b81a0ab..0000000
--- a/scribo/filter/object_links_non_aligned.hh
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright (C) 2009 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.
-
-#ifndef SCRIBO_FILTER_OBJECT_LINKS_NON_ALIGNED_HH
-# define SCRIBO_FILTER_OBJECT_LINKS_NON_ALIGNED_HH
-
-/// \file
-///
-/// Invalidate links between two non aligned objects.
-
-
-# include <mln/math/abs.hh>
-# include <mln/util/array.hh>
-
-# include <scribo/core/macros.hh>
-# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
-
-namespace scribo
-{
-
- namespace filter
- {
-
- using namespace mln;
-
- /*! \brief Invalidate links between two non aligned objects.
- Alignment is based on object bounding boxes.
-
- \param[in] objects An object image.
- \param[in] links Object links information.
- \param[in] dim Choose the dimension on which applying the
- filter.
- \param[in] max_delta Maximum delta.
-
-
- Exemple with dim == 1 (horizontal filter):
-
- \verbatim
- v
- ------ ~ ~ ~
- | | |\
- ------ ~ ~ ~ |~ ~ | ~ ~ ~ \
- | | | | ^ \
- | x------------x | => delta, must be < to max_delta
- | | | | v /
- ------ ~ ~ ~ |~ ~ | ~ ~ ~ /
- object1 | | |/
- ------ ~ ~ ~
- object2 ^
-
- \endverbatim
-
- */
- template <typename L>
- object_links<L>
- object_links_non_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- unsigned dim,
- unsigned max_delta);
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-
- template <typename L>
- object_links<L>
- object_links_non_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- unsigned dim,
- unsigned max_delta)
- {
- trace::entering("scribo::filter::object_links_non_aligned");
-
- mln_precondition(objects.is_valid());
-
-
- typedef typename object_image(L)::bbox_t bbox_t;
- const mln::util::array<bbox_t>& bboxes = objects.bboxes();
- object_links<L> output(links);
-
- for_all_components(i, objects.bboxes())
- if (links[i] != i)
- {
- unsigned
- lnbh = bboxes(links[i]).pmax()[dim] - bboxes(links[i]).pmin()[dim],
- lcurrent = bboxes(i).pmax()[dim] - bboxes(i).pmin()[dim],
- hmin = i,
- hmax = links[i];
-
- if (lnbh < lcurrent)
- {
- hmin = links[i];
- hmax = i;
- }
-
- if (static_cast<unsigned>(math::abs((bboxes[hmin].pmin()[dim] - bboxes[hmax].pmin()[dim]))) > max_delta
- || static_cast<unsigned>(math::abs((bboxes[hmin].pmax()[dim] - bboxes[hmax].pmax()[dim]))) > max_delta)
- output[i] = i;
-
- }
-
- trace::exiting("scribo::filter::object_links_non_aligned");
- return output;
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
-
- } // end of namespace scribo::filter
-
-} // end of namespace scribo
-
-
-#endif // ! SCRIBO_FILTER_OBJECT_LINKS_NON_ALIGNED_HH
diff --git a/scribo/filter/object_links_non_h_aligned.hh b/scribo/filter/object_links_non_h_aligned.hh
deleted file mode 100644
index 8216316..0000000
--- a/scribo/filter/object_links_non_h_aligned.hh
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright (C) 2009 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.
-
-#ifndef SCRIBO_FILTER_OBJECT_LINKS_NON_H_ALIGNED_HH
-# define SCRIBO_FILTER_OBJECT_LINKS_NON_H_ALIGNED_HH
-
-/// \file
-///
-/// Invalidate links between two non horizontaly aligned objects.
-
-
-# include <mln/util/array.hh>
-
-# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/filter/object_links_non_aligned.hh>
-
-namespace scribo
-{
-
- namespace filter
- {
-
- using namespace mln;
-
-
- /*! \brief Invalidate links between two non horizontaly aligned objects.
- Alignment is based on object bounding boxes.
-
- \param[in] objects An object image.
- \param[in] links Object links information.
- \param[in] max_delta Maximum delta.
-
- \result Filtered object links data.
-
- \verbatim
- v
- ------ ~ ~ ~
- | | |\
- ------ ~ ~ ~ |~ ~ | ~ ~ ~ \
- | | | | ^ \
- | x- - - - - --x | => delta, must be < to max_delta
- | | | | v /
- ------ ~ ~ ~ |~ ~ | ~ ~ ~ /
- object1 | | |/
- ------ ~ ~ ~
- object2 ^
-
- \endverbatim
-
-
- */
- template <typename L>
- object_links<L>
- object_links_non_h_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- float max_delta);
-
-# ifndef MLN_INCLUDE_ONLY
-
-
- template <typename L>
- object_links<L>
- object_links_non_h_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- float max_delta)
- {
- trace::entering("scribo::filter::object_links_non_h_aligned");
-
- mln_precondition(objects.is_valid());
-
- object_links<L>
- output = object_links_non_aligned(objects, links, 0, max_delta);
-
- trace::exiting("scribo::filter::object_links_non_h_aligned");
- return output;
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace scribo::filter
-
-} // end of namespace scribo
-
-
-#endif // ! SCRIBO_FILTER_OBJECT_LINKS_NON_H_ALIGNED_HH
diff --git a/scribo/filter/object_links_non_v_aligned.hh b/scribo/filter/object_links_non_v_aligned.hh
deleted file mode 100644
index bd2aeee..0000000
--- a/scribo/filter/object_links_non_v_aligned.hh
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright (C) 2009 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.
-
-#ifndef SCRIBO_FILTER_OBJECT_LINKS_NON_V_ALIGNED_HH
-# define SCRIBO_FILTER_OBJECT_LINKS_NON_V_ALIGNED_HH
-
-/// \file
-///
-/// Invalidate links between two non verticaly aligned objects.
-
-
-# include <mln/util/array.hh>
-
-# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/filter/object_links_non_aligned.hh>
-
-namespace scribo
-{
-
- namespace filter
- {
-
- using namespace mln;
-
- /*! \brief Invalidate links between two non verticaly aligned objects.
- Alignment is based on object bounding boxes.
-
- \param[in] objects An object image.
- \param[in] links Object links information.
- \param[in] max_delta Maximum delta.
-
-
- \verbatim
-
- delta (must be < to max_delta)
- /\
- / \
- / \
- >:-:<>:-:<
- : :
- : :
- : ---:--
- | |
- : | x: | object1
- | | |
- : --|:--
-
- : |:
-
- : |:
- -- ---
- | ||
- | |
- | ||
- | x| object2
- | |
- | |
- | |
- ------
-
- \endverbatim
-
- */
- template <typename L>
- object_links<L>
- object_links_non_v_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- float ratio);
-
-# ifndef MLN_INCLUDE_ONLY
-
-
- template <typename L>
- object_links<L>
- object_links_non_v_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- float ratio)
- {
- trace::entering("scribo::object_links::object_links_non_v_aligned");
-
- mln_precondition(objects.is_valid());
-
- object_links<L>
- output = object_links_non_aligned(objects, links, 0, ratio);
-
- trace::exiting("scribo::filter::object_links_non_v_aligned");
- return output;
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
-
- } // end of namespace scribo::filter
-
-} // end of namespace scribo
-
-
-#endif // ! SCRIBO_FILTER_OBJECT_LINKS_NON_V_ALIGNED_HH
diff --git a/scribo/filter/objects_large.hh b/scribo/filter/objects_large.hh
index dfef95c..81986e4 100644
--- a/scribo/filter/objects_large.hh
+++ b/scribo/filter/objects_large.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.
//
@@ -23,8 +24,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FILTER_OBJECTS_LARGE_HH
-# define SCRIBO_FILTER_OBJECTS_LARGE_HH
+#ifndef SCRIBO_FILTER_COMPONENTS_LARGE_HH
+# define SCRIBO_FILTER_COMPONENTS_LARGE_HH
/// \file
///
@@ -42,8 +43,9 @@
# include <mln/pw/all.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/core/component_set.hh>
+# include <scribo/primitive/extract/components.hh>
+# include <scribo/fun/v2b/objects_large_filter.hh>
namespace scribo
{
@@ -65,134 +67,40 @@ namespace scribo
/// \return A binary image without large objects.
template <typename I, typename N, typename V>
mln_concrete(I)
- objects_large(const Image<I>& input_,
+ components_large(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned max_size);
- /// Remove too large text objects.
- ///
- /// \param[in] objects An object image.
- /// \param[in] max_size The minimum cardinality of an object.
- ///
- /// \return updated text data.
- template <typename L>
- object_image(L)
- objects_large(const object_image(L)& objects,
- unsigned max_size);
-
-
# ifndef MLN_INCLUDE_ONLY
- namespace internal
- {
-
-
- /// Filter Functor.
- /// Return false for all objects which are too large.
- template <typename L>
- struct objects_large_filter
- : Function_v2b< objects_large_filter<L> >
- {
-
- typedef accu::math::count<mln_psite(L)> card_t;
-
- /// Constructor
- ///
- /// \param[in] compbboxes Component bounding boxes.
- /// \param[in] max_size Maximum object size.
- objects_large_filter(const object_image(L)& objects,
- unsigned max_size)
- {
- card_ = labeling::compute(card_t(), objects, objects.nlabels());
- max_size_ = max_size;
- }
-
-
- /// Check if the object is large enough.
- ///
- /// \param l A label.
- ///
- /// \return false if the object area is strictly inferior to
- /// \p max_size_.
- bool operator()(const mln_value(L)& l) const
- {
- if (l == literal::zero)
- return true;
- return card_[l] <= max_size_;
- }
-
-
- /// The object bounding boxes.
- mln::util::array<mln_result(card_t)> card_;
- /// The maximum area.
- unsigned max_size_;
- };
-
-
- } // end of namespace scribo::filter::internal
-
-
-
- template <typename I, typename N, typename V>
- inline
- mln_concrete(I)
- objects_large(const Image<I>& input_,
- const Neighborhood<N>& nbh_,
- const V& label_type,
- unsigned max_size)
- {
- trace::entering("scribo::filter::objects_large");
-
- const I& input = exact(input_);
- const N& nbh = exact(nbh_);
-
- mln_precondition(input.is_valid());
- mln_precondition(nbh.is_valid());
-
- V nlabels;
- typedef object_image(mln_ch_value(I,V)) lbl_t;
- lbl_t lbl = primitive::extract::objects(input, nbh, nlabels);
-
- typedef internal::objects_large_filter<lbl_t> func_t;
- func_t fv2b(lbl, max_size);
- labeling::relabel_inplace(lbl, nlabels, fv2b);
-
- mln_concrete(I) output = duplicate(input);
- data::fill((output | pw::value(lbl) == literal::zero).rw(), false);
-
- trace::exiting("scribo::filter::objects_large");
- return output;
- }
-
-
template <typename L>
inline
- object_image(L)
- objects_large(const object_image(L)& objects,
- unsigned max_size)
+ component_set<L>
+ components_large(const component_set<L>& components,
+ unsigned max_size)
{
- trace::entering("scribo::filter::objects_large");
+ trace::entering("scribo::filter::components_large");
- mln_precondition(objects.is_valid());
+ mln_precondition(components.is_valid());
- internal::objects_large_filter<L> f(objects, max_size);
+ fun::v2b::components_large_filter<L> f(components, max_size);
- object_image(L) output;
- output.init_from_(objects);
- output.relabel(f);
+ component_set<L> output = components.duplicate();
+ output.update_tags(f, component::Ignored);
- trace::exiting("scribo::filter::objects_large");
+ trace::exiting("scribo::filter::components_large");
return output;
}
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace scribo::filter
} // end of namespace scribo
-#endif // ! SCRIBO_FILTER_OBJECTS_LARGE_HH
+#endif // ! SCRIBO_FILTER_COMPONENTS_LARGE_HH
diff --git a/scribo/filter/objects_small.hh b/scribo/filter/objects_small.hh
index 31112c9..f97a79e 100644
--- a/scribo/filter/objects_small.hh
+++ b/scribo/filter/objects_small.hh
@@ -143,7 +143,7 @@ namespace scribo
fun::v2b::components_small_filter<L> f(components, min_size);
- component_set<L> output = components;
+ component_set<L> output = components.duplicate();
output.update_tags(f, component::Ignored);
trace::exiting("scribo::filter::components_small");
diff --git a/scribo/fun/v2b/objects_small_filter.hh b/scribo/fun/v2b/objects_large_filter.hh
similarity index 74%
copy from scribo/fun/v2b/objects_small_filter.hh
copy to scribo/fun/v2b/objects_large_filter.hh
index 8e0ae8a..1707c9c 100644
--- a/scribo/fun/v2b/objects_small_filter.hh
+++ b/scribo/fun/v2b/objects_large_filter.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,12 +23,12 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FUN_V2B_COMPONENTS_SMALL_FILTER_HH
-# define SCRIBO_FUN_V2B_COMPONENTS_SMALL_FILTER_HH
+#ifndef SCRIBO_FUN_V2B_COMPONENTS_LARGE_FILTER_HH
+# define SCRIBO_FUN_V2B_COMPONENTS_LARGE_FILTER_HH
/// \file
///
-/// Remove small components in a binary image.
+/// Remove large components in a binary image.
@@ -56,20 +56,20 @@ namespace scribo
/// Filter Functor.
- /// Return false for all components which are too small.
+ /// Return false for all components which are too large.
template <typename L>
- struct components_small_filter
- : Function_v2b< components_small_filter<L> >
+ struct components_large_filter
+ : Function_v2b< components_large_filter<L> >
{
typedef accu::math::count<mln_psite(L)> card_t;
/// Constructor
///
/// \param[in] components Component bounding boxes.
- /// \param[in] min_size Minimum component size.
+ /// \param[in] max_size Maximum component size.
//
- components_small_filter(const component_set<L>& components,
- unsigned min_size);
+ components_large_filter(const component_set<L>& components,
+ unsigned max_size);
/// Check if the component is large enough.
@@ -77,12 +77,12 @@ namespace scribo
/// \param l A label.
///
/// \return false if the component area is strictly inferion to
- /// \p min_size_.
+ /// \p max_size_.
//
bool operator()(const mln_value(L)& l) const;
/// The minimum area.
- unsigned min_size_;
+ unsigned max_size_;
/// The component set to filter.
const component_set<L> components_;
@@ -96,10 +96,10 @@ namespace scribo
template <typename L>
inline
- components_small_filter<L>::components_small_filter(
+ components_large_filter<L>::components_large_filter(
const component_set<L>& components,
- unsigned min_size)
- : min_size_(min_size), components_(components)
+ unsigned max_size)
+ : max_size_(max_size), components_(components)
{
}
@@ -108,11 +108,11 @@ namespace scribo
template <typename L>
inline
bool
- components_small_filter<L>::operator()(const mln_value(L)& l) const
+ components_large_filter<L>::operator()(const mln_value(L)& l) const
{
if (l == literal::zero)
return true;
- return components_.info(l).card() >= min_size_;
+ return components_.info(l).card() <= max_size_;
}
@@ -125,4 +125,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_FUN_V2B_COMPONENTS_SMALL_FILTER_HH
+#endif // ! SCRIBO_FUN_V2B_COMPONENTS_LARGE_FILTER_HH
diff --git a/scribo/io/xml/save_text_lines.hh b/scribo/io/xml/save_text_lines.hh
index 7f0fdf4..06caf58 100644
--- a/scribo/io/xml/save_text_lines.hh
+++ b/scribo/io/xml/save_text_lines.hh
@@ -104,6 +104,7 @@ namespace scribo
<< "\" txt_orientation=\"" << lines(l).orientation()
<< "\" txt_reading_orientation=\"" << lines(l).reading_orientation()
<< "\" txt_reading_direction=\"" << lines(l).reading_direction()
+ << "\" txt_text_type=\"" << lines(l).type()
<< "\" txt_reverse_video=\"" << (lines(l).reverse_video() ? "true" : "false")
<< "\" txt_indented=\"" << (lines(l).indented() ? "true" : "false")
<< "\" kerning=\"" << lines(l).char_space()
diff --git a/scribo/make/text.hh b/scribo/make/text.hh
index 7a8456b..6d10ef3 100644
--- a/scribo/make/text.hh
+++ b/scribo/make/text.hh
@@ -154,7 +154,7 @@ namespace scribo
mln::util::array< accu::shape::bbox<mln_site(L)> > tboxes(new_nbboxes.next());
mln::util::array< accu::center<mln_site(L)> > tcenters(new_nbboxes.next());
- for_all_components(i, text.bboxes())
+ for_all_comps(i, text.bboxes())
{
tboxes[fv2v(i)].take(text.bbox(i));
tcenters[fv2v(i)].take(text.mass_center(i));
diff --git a/scribo/primitive/extract/all.hh b/scribo/primitive/extract/all.hh
index de1688e..5ccb83b 100644
--- a/scribo/primitive/extract/all.hh
+++ b/scribo/primitive/extract/all.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.
//
@@ -58,7 +59,7 @@ namespace scribo
# include <scribo/primitive/extract/lines_v_thick.hh>
# include <scribo/primitive/extract/lines_v_discontinued.hh>
# include <scribo/primitive/extract/lines_h_pattern.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/primitive/extract/components.hh>
# include <scribo/primitive/extract/cells.hh>
# include <scribo/primitive/extract/lines_thick.hh>
# include <scribo/primitive/extract/lines_h_discontinued.hh>
diff --git a/scribo/primitive/extract/lines_discontinued.hh b/scribo/primitive/extract/lines_discontinued.hh
index 2ea7de6..63953ac 100644
--- a/scribo/primitive/extract/lines_discontinued.hh
+++ b/scribo/primitive/extract/lines_discontinued.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,8 +42,7 @@
# include <mln/morpho/dilation.hh>
# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/primitive/extract/components.hh>
namespace scribo
{
@@ -70,7 +70,7 @@ namespace scribo
* \return An image in which lines are labeled.
*/
template <typename I, typename N, typename V, typename W>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_discontinued(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_, unsigned rank_k);
@@ -111,7 +111,7 @@ namespace scribo
template <typename I, typename N, typename V, typename W>
inline
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_discontinued(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_, unsigned rank_k)
@@ -132,8 +132,8 @@ namespace scribo
mln_ch_value(I,bool) filter
= morpho::dilation(morpho::rank_filter(input, win, rank_k), W(dil));
- object_image(mln_ch_value(I,V)) output
- = primitive::extract::objects(filter, nbh, nlines);
+ component_set<mln_ch_value(I,V)> output
+ = primitive::extract::components(filter, nbh, nlines);
trace::exiting("scribo::primitive::extract::lines_discontinued");
return output;
diff --git a/scribo/primitive/extract/lines_h_discontinued.hh b/scribo/primitive/extract/lines_h_discontinued.hh
index 48ba12a..f1deb98 100644
--- a/scribo/primitive/extract/lines_h_discontinued.hh
+++ b/scribo/primitive/extract/lines_h_discontinued.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.
//
@@ -34,7 +35,6 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/hline2d.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/primitive/extract/lines_discontinued.hh>
@@ -63,7 +63,7 @@ namespace scribo
* from 0.
*/
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_h_discontinued(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length, unsigned rank_k);
@@ -101,7 +101,7 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_h_discontinued(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length, unsigned rank_k)
@@ -113,7 +113,7 @@ namespace scribo
win::hline2d win(line_length);
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
output = lines_discontinued(input, nbh, nlines, win, rank_k);
trace::exiting("scribo::primitive::lines_h_discontinued");
diff --git a/scribo/primitive/extract/lines_h_pattern.hh b/scribo/primitive/extract/lines_h_pattern.hh
index fa1823d..08025a1 100644
--- a/scribo/primitive/extract/lines_h_pattern.hh
+++ b/scribo/primitive/extract/lines_h_pattern.hh
@@ -30,15 +30,18 @@
///
/// Extract horizontal lines matching a specific pattern.
-#include <mln/core/concept/image.hh>
-#include <mln/core/alias/window2d.hh>
-
-# include <mln/win/hline2d.hh>
-
+# include <mln/core/concept/image.hh>
+# include <mln/core/alias/window2d.hh>
+# include <mln/win/rectangle2d.hh>
# include <mln/morpho/dilation.hh>
+# include <mln/arith/times.hh>
+
# include <scribo/primitive/extract/lines_pattern.hh>
+# include <scribo/primitive/internal/rd.hh>
+
+
namespace scribo
{
@@ -74,17 +77,6 @@ namespace scribo
mln_precondition(exact(input).is_valid());
mln_precondition(length % 2 == 1);
-// bool win_def[7][1] = { {1},
-// {0},
-// {0},
-// {0},
-// {0},
-// {0},
-// {1} };
-
-// window2d win;
-// convert::from_to(win_def, win);
-
// FIXME: not generic.
window2d win;
mln_deduce(I, site, dpsite)
@@ -93,11 +85,16 @@ namespace scribo
win.insert(dp1);
win.insert(dp2);
- //FIXME: Add reconstruction instead of this arbitrary dilation.
- win::hline2d hwin(length/2 + 2);
-// win::hline2d hwin(length);
- return morpho::dilation(lines_pattern(input, length, 1, win), hwin);
-// return lines_pattern(input, length, 1, win);
+ mln_concrete(I) output = lines_pattern(input, length, 1, win);
+
+ mln_concrete(I)
+ output_dil = morpho::dilation(output,
+ win::rectangle2d(3, length / 2 + delta));
+
+ output = scribo::primitive::internal::rd(output, input * output_dil);
+
+ trace::exiting("scribo::primitive::extract::lines_h_pattern");
+ return output;
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/scribo/primitive/extract/lines_h_single.hh b/scribo/primitive/extract/lines_h_single.hh
index 4e9cb74..ad6b794 100644
--- a/scribo/primitive/extract/lines_h_single.hh
+++ b/scribo/primitive/extract/lines_h_single.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.
//
@@ -34,7 +35,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/hline2d.hh>
-# include <scribo/core/object_image.hh>
+# include <scribo/primitive/extract/components.hh>
namespace scribo
@@ -67,9 +68,9 @@ namespace scribo
* labeled.
*/
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_single(const Image<I>& input,
- const Neighborhood<N>& nbh, V& nlines,
+ const Neighborhood<N>& nbh, const V& nlines,
unsigned min_line_length,
float w_h_ratio);
@@ -79,7 +80,7 @@ namespace scribo
* Only single non discontinued lines are correctly extracted
* with this routine.
*
- * \param[in] objects A labeled image.
+ * \param[in] components A labeled image.
* \param[in] line_length The minimum line length.
* \param[in] w_h_ratio The minimum ratio width/height object
* bounding boxes to consider an
@@ -89,8 +90,8 @@ namespace scribo
* labeled.
*/
template <typename L>
- object_image(L)
- lines_h_single(const object_image(L)& objects,
+ component_set<L>
+ lines_h_single(const component_set<L>& components,
unsigned min_line_length,
float w_h_ratio);
@@ -106,17 +107,17 @@ namespace scribo
{
typedef bool result;
- is_line_h_single(const object_image(L)& objects,
+ is_line_h_single(const component_set<L>& components,
float w_h_ratio, unsigned min_line_length)
: w_h_ratio_(w_h_ratio), min_line_length_(min_line_length),
- objects_(objects)
+ components_(components)
{
}
bool operator()(const mln_value(L)& label) const
{
- mln_domain(L) box = objects_.bbox(label);
+ const mln_domain(L)& box = components_(label).bbox();
unsigned
height = box.pmax().row() - box.pmin().row() + 1,
@@ -129,7 +130,7 @@ namespace scribo
float w_h_ratio_;
unsigned min_line_length_;
- object_image(L) objects_;
+ component_set<L> components_;
};
@@ -139,9 +140,9 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_h_single(const Image<I>& input_,
- const Neighborhood<N>& nbh_, V& nlines,
+ const Neighborhood<N>& nbh_, const V& nlines,
unsigned min_line_length,
float w_h_ratio)
{
@@ -153,14 +154,13 @@ namespace scribo
mln_precondition(nbh.is_valid());
typedef mln_ch_value(I,V) L;
- object_image(L)
- output = objects(input, nbh, nlines);
+ component_set<L>
+ output = primitive::extract::components(input, nbh, nlines);
internal::is_line_h_single<L>
is_line(output, w_h_ratio, min_line_length);
- output.relabel(is_line);
- nlines = output.nlabels();
+ output.update_tags(is_line, component::Ignored);
trace::exiting("scribo::primitive::lines_h_single");
return output;
@@ -170,21 +170,20 @@ namespace scribo
template <typename L>
- object_image(L)
- lines_h_single(const object_image(L)& objects,
+ component_set<L>
+ lines_h_single(const component_set<L>& components,
unsigned min_line_length,
float w_h_ratio)
{
trace::entering("scribo::primitive::lines_h_single");
- mln_precondition(objects.is_valid());
+ mln_precondition(components.is_valid());
internal::is_line_h_single<L>
- is_line(objects, w_h_ratio, min_line_length);
+ is_line(components, w_h_ratio, min_line_length);
- object_image(L) output;
- output.init_from_(objects);
- output.relabel(is_line);
+ component_set<L> output = components.duplicate();
+ output.update_tags(is_line, component::Ignored);
trace::exiting("scribo::primitive::lines_h_single");
return output;
diff --git a/scribo/primitive/extract/lines_h_thick.hh b/scribo/primitive/extract/lines_h_thick.hh
index 817f47d..b1dfcfd 100644
--- a/scribo/primitive/extract/lines_h_thick.hh
+++ b/scribo/primitive/extract/lines_h_thick.hh
@@ -34,7 +34,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/hline2d.hh>
-# include <scribo/core/object_image.hh>
+# include <scribo/core/component_set.hh>
# include <scribo/primitive/extract/lines_thick.hh>
namespace scribo
@@ -61,7 +61,7 @@ namespace scribo
* \return An image in which lines are labeled.
*/
template <typename I, typename N, typename V, typename W>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
unsigned line_length);
@@ -99,7 +99,7 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_h_thick(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length)
@@ -111,7 +111,7 @@ namespace scribo
win::hline2d win(line_length);
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
output = lines_thick(input, nbh, nlines, win);
trace::exiting("scribo::primitive::lines_h_thick");
diff --git a/scribo/primitive/extract/lines_thick.hh b/scribo/primitive/extract/lines_thick.hh
index 230b63c..726dab4 100644
--- a/scribo/primitive/extract/lines_thick.hh
+++ b/scribo/primitive/extract/lines_thick.hh
@@ -37,9 +37,8 @@
# include <mln/morpho/opening/structural.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/primitive/extract/components.hh>
namespace scribo
{
@@ -66,7 +65,7 @@ namespace scribo
* \return An image in which lines are labeled.
*/
template <typename I, typename N, typename V, typename W>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_);
@@ -105,7 +104,7 @@ namespace scribo
template <typename I, typename N, typename V, typename W>
inline
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_)
@@ -119,8 +118,8 @@ namespace scribo
const W& win = exact(win_);
mln_ch_value(I,bool) filter = morpho::opening::structural(input, win);
- object_image(mln_ch_value(I,V)) output
- = primitive::extract::objects(filter, nbh, nlines);
+ component_set<mln_ch_value(I,V)> output
+ = primitive::extract::components(filter, nbh, nlines);
trace::exiting("scribo::primitive::lines_thick");
return output;
diff --git a/scribo/primitive/extract/lines_v_discontinued.hh b/scribo/primitive/extract/lines_v_discontinued.hh
index 8f64472..c0e8b92 100644
--- a/scribo/primitive/extract/lines_v_discontinued.hh
+++ b/scribo/primitive/extract/lines_v_discontinued.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.
//
@@ -33,7 +34,6 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/primitive/extract/lines_discontinued.hh>
@@ -61,7 +61,7 @@ namespace scribo
* from 0.
*/
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_discontinued(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length, unsigned rank_k);
@@ -99,7 +99,7 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_discontinued(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length, unsigned rank_k)
@@ -111,7 +111,7 @@ namespace scribo
win::vline2d win(line_length);
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
output = lines_discontinued(input, nbh, nlines, win, rank_k);
trace::exiting("scribo::primitive::lines_v_discontinued");
diff --git a/scribo/primitive/extract/lines_v_single.hh b/scribo/primitive/extract/lines_v_single.hh
index 74391f6..c67dfca 100644
--- a/scribo/primitive/extract/lines_v_single.hh
+++ b/scribo/primitive/extract/lines_v_single.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.
//
@@ -34,8 +35,6 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/hline2d.hh>
-# include <scribo/core/object_image.hh>
-
namespace scribo
{
@@ -66,9 +65,9 @@ namespace scribo
* labeled.
*/
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_single(const Image<I>& input,
- const Neighborhood<N>& nbh, V& nlines,
+ const Neighborhood<N>& nbh, const V& nlines,
unsigned min_line_length,
float h_w_ratio);
@@ -78,7 +77,7 @@ namespace scribo
* Only single non discontinued lines are correctly extracted
* with this routine.
*
- * \param[in] objects A labeled image.
+ * \param[in] components A labeled image.
* \param[in] line_length The minimum line length.
* \param[in] h_w_ratio The minimum ratio height/width object
* bounding boxes to consider an
@@ -88,8 +87,8 @@ namespace scribo
* labeled.
*/
template <typename L>
- object_image(L)
- lines_v_single(const object_image(L)& objects,
+ component_set<L>
+ lines_v_single(const component_set<L>& components,
unsigned min_line_length,
float h_w_ratio);
@@ -105,17 +104,17 @@ namespace scribo
{
typedef bool result;
- is_line_v_single(const object_image(L)& objects,
+ is_line_v_single(const component_set<L>& components,
float h_w_ratio, unsigned min_line_length)
: h_w_ratio_(h_w_ratio), min_line_length_(min_line_length),
- objects_(objects)
+ components_(components)
{
}
bool operator()(const mln_value(L)& label) const
{
- mln_domain(L) box = objects_.bbox(label);
+ const mln_domain(L)& box = components_(label).bbox();
unsigned
height = box.pmax().row() - box.pmin().row() + 1,
width = box.pmax().col() - box.pmin().col() + 1;
@@ -127,7 +126,7 @@ namespace scribo
float h_w_ratio_;
unsigned min_line_length_;
- object_image(L) objects_;
+ component_set<L> components_;
};
@@ -136,9 +135,9 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_single(const Image<I>& input_,
- const Neighborhood<N>& nbh_, V& nlines,
+ const Neighborhood<N>& nbh_, const V& nlines,
unsigned min_line_length,
float h_w_ratio)
{
@@ -150,14 +149,13 @@ namespace scribo
mln_precondition(nbh.is_valid());
typedef mln_ch_value(I,V) L;
- object_image(L)
- output = objects(input, nbh, nlines);
+ component_set<L>
+ output = primitive::extract::components(input, nbh, nlines);
internal::is_line_v_single<L>
is_line(output, h_w_ratio, min_line_length);
- output.relabel(is_line);
- nlines = output.nlabels();
+ output.update_tags(is_line, component::Ignored);
trace::exiting("scribo::primitive::lines_v_single");
return output;
@@ -166,21 +164,20 @@ namespace scribo
template <typename L>
- object_image(L)
- lines_v_single(const object_image(L)& objects,
+ component_set<L>
+ lines_v_single(const component_set<L>& components,
unsigned min_line_length,
float h_w_ratio)
{
trace::entering("scribo::primitive::lines_v_single");
- mln_precondition(objects.is_valid());
+ mln_precondition(components.is_valid());
internal::is_line_v_single<L>
- is_line(objects, h_w_ratio, min_line_length);
+ is_line(components, h_w_ratio, min_line_length);
- object_image(L) output;
- output.init_from_(objects);
- output.relabel(is_line);
+ component_set<L> output = components.duplicate();
+ output.update_tags(is_line, component::Ignored);
trace::exiting("scribo::primitive::lines_v_single");
return output;
diff --git a/scribo/primitive/extract/lines_v_thick.hh b/scribo/primitive/extract/lines_v_thick.hh
index 2ee09dd..8b8a656 100644
--- a/scribo/primitive/extract/lines_v_thick.hh
+++ b/scribo/primitive/extract/lines_v_thick.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.
//
@@ -34,7 +35,6 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/vline2d.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/primitive/extract/lines_thick.hh>
namespace scribo
@@ -61,7 +61,7 @@ namespace scribo
* \return An image in which lines are labeled.
*/
template <typename I, typename N, typename V, typename W>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
unsigned line_length);
@@ -99,10 +99,10 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_thick(const Image<I>& input,
- const Neighborhood<N>& nbh, V& nlines,
- unsigned line_length)
+ const Neighborhood<N>& nbh, V& nlines,
+ unsigned line_length)
{
trace::entering("scribo::primitive::extract::lines_v_thick");
@@ -111,7 +111,7 @@ namespace scribo
win::vline2d win(line_length);
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
output = lines_thick(input, nbh, nlines, win);
trace::exiting("scribo::primitive::extract::lines_v_thick");
diff --git a/scribo/primitive/group/apply.hh b/scribo/primitive/group/apply.hh
index 026171d..3370104 100644
--- a/scribo/primitive/group/apply.hh
+++ b/scribo/primitive/group/apply.hh
@@ -75,7 +75,7 @@ namespace scribo
template <typename L>
component_set<L>
apply(const object_groups<L>& groups,
- fun::i2v::array<mln_value(L)>& relabel_fun)
+ mln::fun::i2v::array<mln_value(L)>& relabel_fun)
{
trace::entering("scribo::primitive::group::apply");
@@ -105,7 +105,7 @@ namespace scribo
component_set<L>
apply(const object_groups<L>& groups)
{
- fun::i2v::array<mln_value(L)> relabel_fun;
+ mln::fun::i2v::array<mln_value(L)> relabel_fun;
return apply(groups, relabel_fun);
}
diff --git a/scribo/primitive/group/from_graph.hh b/scribo/primitive/group/from_graph.hh
index 55cb56d..602be90 100644
--- a/scribo/primitive/group/from_graph.hh
+++ b/scribo/primitive/group/from_graph.hh
@@ -48,7 +48,6 @@
# include <scribo/core/object_links.hh>
# include <scribo/core/object_groups.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
diff --git a/scribo/primitive/internal/all.hh b/scribo/primitive/internal/all.hh
index 86aa62a..26f5d5b 100644
--- a/scribo/primitive/internal/all.hh
+++ b/scribo/primitive/internal/all.hh
@@ -47,14 +47,11 @@ namespace scribo
} // end of namespace scribo
-# include <scribo/primitive/internal/init_link_array.hh>
# include <scribo/primitive/internal/is_link_valid.hh>
# include <scribo/primitive/internal/find_root.hh>
# include <scribo/primitive/internal/find_graph_link.hh>
-# include <scribo/primitive/internal/find_right_link.hh>
# include <scribo/primitive/internal/update_graph_link.hh>
# include <scribo/primitive/internal/update_link_array.hh>
-# include <scribo/primitive/internal/find_left_link.hh>
#endif // ! SCRIBO_PRIMITIVE_INTERNAL_ALL_HH
diff --git a/scribo/primitive/internal/find_graph_link.hh b/scribo/primitive/internal/find_graph_link.hh
index b2f6549..f5a1039 100644
--- a/scribo/primitive/internal/find_graph_link.hh
+++ b/scribo/primitive/internal/find_graph_link.hh
@@ -37,7 +37,6 @@
# include <mln/util/array.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/primitive/internal/update_graph_link.hh>
//FIXME: not generic.
diff --git a/scribo/primitive/internal/rd.hh b/scribo/primitive/internal/rd.hh
index 7b8f069..49b6abb 100644
--- a/scribo/primitive/internal/rd.hh
+++ b/scribo/primitive/internal/rd.hh
@@ -100,7 +100,7 @@ namespace scribo
initialize(parent, f);
}
- util::array<int> dp = negative_offsets_wrt(f, nbh);
+ mln::util::array<int> dp = negative_offsets_wrt(f, nbh);
const unsigned n_nbhs = dp.nelements();
// First pass.
diff --git a/scribo/primitive/link/with_graph.hh b/scribo/primitive/link/with_graph.hh
index 5f16ec8..2d579aa 100644
--- a/scribo/primitive/link/with_graph.hh
+++ b/scribo/primitive/link/with_graph.hh
@@ -42,8 +42,6 @@
# include <mln/util/graph.hh>
# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/primitive/internal/init_link_array.hh>
# include <scribo/primitive/internal/find_graph_link.hh>
diff --git a/scribo/primitive/link/with_several_graphes.hh b/scribo/primitive/link/with_several_graphes.hh
index 148d3cc..98d631e 100644
--- a/scribo/primitive/link/with_several_graphes.hh
+++ b/scribo/primitive/link/with_several_graphes.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.
//
@@ -38,10 +39,7 @@
# include <mln/util/array.hh>
# include <mln/util/graph.hh>
-
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
-# include <scribo/primitive/internal/init_link_array.hh>
# include <scribo/primitive/internal/find_graph_link.hh>
namespace scribo
diff --git a/scribo/primitive/link/with_several_left_links.hh b/scribo/primitive/link/with_several_left_links.hh
index 2de4cee..5a685a1 100644
--- a/scribo/primitive/link/with_several_left_links.hh
+++ b/scribo/primitive/link/with_several_left_links.hh
@@ -37,8 +37,6 @@
# include <scribo/core/object_links.hh>
# include <scribo/core/macros.hh>
-# include <scribo/primitive/internal/init_link_array.hh>
-# include <scribo/primitive/internal/find_left_link.hh>
# include <scribo/util/text.hh>
diff --git a/scribo/primitive/link/with_several_right_links.hh b/scribo/primitive/link/with_several_right_links.hh
index b302dcb..14d3229 100644
--- a/scribo/primitive/link/with_several_right_links.hh
+++ b/scribo/primitive/link/with_several_right_links.hh
@@ -38,10 +38,7 @@
# include <mln/util/array.hh>
# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
-# include <scribo/primitive/internal/init_link_array.hh>
-# include <scribo/primitive/internal/find_right_link.hh>
# include <scribo/util/text.hh>
diff --git a/scribo/table/erase.hh b/scribo/table/erase.hh
index 7cc9461..a34e5a0 100644
--- a/scribo/table/erase.hh
+++ b/scribo/table/erase.hh
@@ -62,8 +62,8 @@ namespace scribo
template <typename I, typename L>
mln_concrete(I)
erase(const Image<I>& input,
- const object_image(L)& hlines,
- const object_image(L)& vlines);
+ const Image<L>& hlines,
+ const Image<L>& vlines);
# ifndef MLN_INCLUDE_ONLY
@@ -73,12 +73,14 @@ namespace scribo
inline
mln_concrete(I)
erase(const Image<I>& input,
- const object_image(L)& hlines,
- const object_image(L)& vlines)
+ const Image<L>& hlines,
+ const Image<L>& vlines)
{
trace::entering("scribo::internal::erase");
mlc_equal(mln_value(I),bool)::check();
mln_precondition(exact(input).is_valid());
+ mln_precondition(exact(hlines).is_valid());
+ mln_precondition(exact(vlines).is_valid());
I output = duplicate(input);
diff --git a/scribo/table/extract.hh b/scribo/table/extract.hh
index efd030c..aca2321 100644
--- a/scribo/table/extract.hh
+++ b/scribo/table/extract.hh
@@ -38,12 +38,11 @@
# include <mln/io/ppm/all.hh>
# include <mln/labeling/colorize.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/table/rebuild.hh>
# include <scribo/table/erase.hh>
# include <scribo/primitive/extract/lines_h_pattern.hh>
# include <scribo/primitive/extract/lines_v_pattern.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/primitive/extract/components.hh>
# include <scribo/debug/save_bboxes_image.hh>
diff --git a/scribo/table/internal/align_lines.hh b/scribo/table/internal/align_lines.hh
index bd72af8..9af00fc 100644
--- a/scribo/table/internal/align_lines.hh
+++ b/scribo/table/internal/align_lines.hh
@@ -124,7 +124,7 @@ namespace scribo
lines.resize(nsites);
// Map components with actual lines.
- for_all_components(i, line_bboxes)
+ for_all_comps(i, line_bboxes)
{
int minline = line_bboxes[i].pmin()[dim] - max_alignment_diff;
minline = (minline < min_coord ? min_coord : minline);
diff --git a/scribo/table/internal/connect_lines.hh b/scribo/table/internal/connect_lines.hh
index b2f9273..667060a 100644
--- a/scribo/table/internal/connect_lines.hh
+++ b/scribo/table/internal/connect_lines.hh
@@ -43,7 +43,7 @@
# include <mln/opt/at.hh>
-# include <mln/transform/influence_zone_geodesic.hh>
+# include <mln/transform/influence_zone_geodesic_saturated.hh>
# include <scribo/core/macros.hh>
# include <scribo/core/central_sites.hh>
@@ -96,9 +96,10 @@ namespace scribo
for_all_elements(i, aligned_lines)
opt::at(l, aligned_lines[i]) = aligned_lines[i];
- l = transform::influence_zone_geodesic(l, c2(), max_distance, -1);
+ l = transform::influence_zone_geodesic_saturated(l, c2(),
+ max_distance, -1);
- for_all_components(i, boxes)
+ for_all_comps(i, boxes)
{
mln::util::couple<P,P> cp = central_sites(boxes[i], dim);
if (opt::at(l, cp.first()[dim]) != -1
diff --git a/scribo/table/internal/repair_lines.hh b/scribo/table/internal/repair_lines.hh
index f197979..481728c 100644
--- a/scribo/table/internal/repair_lines.hh
+++ b/scribo/table/internal/repair_lines.hh
@@ -112,7 +112,7 @@ namespace scribo
typedef mln_ch_value(I,value::label_16) L;
L l(input.domain());
data::fill(l, literal::zero);
- for_all_components(i, tableboxes)
+ for_all_comps(i, tableboxes)
{
mln::util::couple<P,P> cp = central_sites(tableboxes[i], axis);
l(cp.first()) = i;
--
1.5.6.5
1
0
---
milena/sandbox/lazzara/afp/photos/gui/gui.pro | 2 +
.../lazzara/afp/photos/gui/src/main_window.cc | 50 +++++++++++++++-----
.../lazzara/afp/photos/gui/src/main_window.hh | 5 ++
.../lazzara/afp/photos/gui/ui/main_window.ui | 20 ++++----
4 files changed, 55 insertions(+), 22 deletions(-)
diff --git a/milena/sandbox/lazzara/afp/photos/gui/gui.pro b/milena/sandbox/lazzara/afp/photos/gui/gui.pro
index 41b8006..7c6aa8e 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/gui.pro
+++ b/milena/sandbox/lazzara/afp/photos/gui/gui.pro
@@ -9,6 +9,8 @@ INCLUDEPATH += . src
CONFIG += release
+QMAKE_CXXFLAGS = -g
+
# Input
HEADERS += src/main_window.hh src/custom_delegate.hh src/launch_dialog.hh
FORMS += ui/main_window.ui ui/launch_dialog.ui
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
index c421b81..c1d92c1 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
@@ -152,8 +152,10 @@ namespace mln
file_list_ = dir_.entryInfoList();
current_file_ = 0;
+
withTextListWidget->clear();
withoutTextListWidget->clear();
+ update_tab_title();
progressToolBar_->show();
progressLabel_.setText(tr("Processing images..."));
@@ -276,13 +278,8 @@ namespace mln
withoutTextListWidget->addItem(item);
}
- // Update tab titles.
- tabWidget->setTabText(0,
- QString(tr("With text (%1)"))
- .arg(withTextListWidget->count()));
- tabWidget->setTabText(1,
- QString(tr("Without text (%1)"))
- .arg(withoutTextListWidget->count()));
+ // Update tab title.
+ update_tab_title();
next_process();
}
@@ -307,8 +304,17 @@ namespace mln
void
+ main_window::on_withTextListWidget_itemClicked(QListWidgetItem * item)
+ {
+ on_withTextListWidget_currentItemChanged(item);
+ }
+
+ void
main_window::on_withTextListWidget_currentItemChanged(QListWidgetItem * item)
{
+ if (!withTextListWidget->count())
+ return;
+
if (fullImageButton->isChecked())
on_fullImageButton_toggled(true);
else if (textOnlyButton->isChecked())
@@ -325,15 +331,22 @@ namespace mln
}
void
+ main_window::on_withoutTextListWidget_itemClicked(QListWidgetItem * item)
+ {
+ on_withoutTextListWidget_currentItemChanged(item);
+ }
+
+ void
main_window::on_withoutTextListWidget_currentItemChanged(QListWidgetItem * item)
{
- display_image(file_list_.at(item->data(Qt::UserRole).toInt()).absoluteFilePath());
+ if (withoutTextListWidget->count() && item)
+ display_image(file_list_.at(item->data(Qt::UserRole).toInt()).absoluteFilePath());
}
void
main_window::on_fullImageButton_toggled(bool)
{
- if (withTextListWidget->count())
+ if (withTextListWidget->count() && withTextListWidget->currentItem())
{
QString filename = file_list_.at(withTextListWidget->currentItem()->data(Qt::UserRole).toInt()).absoluteFilePath();
display_image(filename);
@@ -343,7 +356,7 @@ namespace mln
void
main_window::on_textBoxesButton_toggled(bool)
{
- if (withTextListWidget->count())
+ if (withTextListWidget->count() && withTextListWidget->currentItem())
{
QFileInfo f(withTextListWidget->currentItem()->text());
display_image(textBoxes_file(f.baseName()));
@@ -353,7 +366,7 @@ namespace mln
void
main_window::on_textMaskButton_toggled(bool)
{
- if (withTextListWidget->count())
+ if (withTextListWidget->count() && withTextListWidget->currentItem())
{
QFileInfo f(withTextListWidget->currentItem()->text());
display_image(textMask_file(f.baseName()));
@@ -363,7 +376,7 @@ namespace mln
void
main_window::on_textOnlyButton_toggled(bool)
{
- if (withTextListWidget->count())
+ if (withTextListWidget->count() && withTextListWidget->currentItem())
{
QFileInfo f(withTextListWidget->currentItem()->text());
display_image(output_file(f.baseName()));
@@ -493,6 +506,19 @@ namespace mln
event->ignore();
}
+
+ void
+ main_window::update_tab_title()
+ {
+ tabWidget->setTabText(0,
+ QString(tr("With text (%1)"))
+ .arg(withTextListWidget->count()));
+ tabWidget->setTabText(1,
+ QString(tr("Without text (%1)"))
+ .arg(withoutTextListWidget->count()));
+ }
+
+
} // end of namespace scribo::demo
} // end of namespace scribo
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
index 5b42d41..6732f29 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
@@ -48,7 +48,10 @@ namespace mln
void process__error_slot(QProcess::ProcessError);
void process__finished_slot(int exitCode,
QProcess::ExitStatus exitStatus);
+
+ void on_withTextListWidget_itemClicked(QListWidgetItem * item);
void on_withTextListWidget_currentItemChanged(QListWidgetItem * item);
+ void on_withoutTextListWidget_itemClicked(QListWidgetItem * item);
void on_withoutTextListWidget_currentItemChanged(QListWidgetItem * item);
void on_fullImageButton_toggled(bool b);
@@ -65,6 +68,8 @@ namespace mln
void remove_image(bool);
void show_hidden_images(bool b);
+ void update_tab_title();
+
signals:
void process_finished();
diff --git a/milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui b/milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui
index 0d3d925..4162d98 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui
+++ b/milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui
@@ -212,18 +212,18 @@
</widget>
<widget class="QDockWidget" name="dockWidget" >
<property name="sizePolicy" >
- <sizepolicy vsizetype="Maximum" hsizetype="Maximum" >
+ <sizepolicy vsizetype="Maximum" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="maximumSize" >
- <size>
- <width>550</width>
- <height>524287</height>
- </size>
- </property>
<widget class="QWidget" name="dockWidgetContents" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<layout class="QGridLayout" name="gridLayout_2" >
<item row="0" column="0" >
<layout class="QVBoxLayout" name="verticalLayout_7" >
@@ -256,7 +256,7 @@
<item>
<widget class="QGraphicsView" name="graphicsView" >
<property name="sizePolicy" >
- <sizepolicy vsizetype="Expanding" hsizetype="Maximum" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -269,7 +269,7 @@
</property>
<property name="maximumSize" >
<size>
- <width>512</width>
+ <width>16777215</width>
<height>512</height>
</size>
</property>
@@ -496,7 +496,7 @@
<x>0</x>
<y>0</y>
<width>708</width>
- <height>31</height>
+ <height>24</height>
</rect>
</property>
<widget class="QMenu" name="menuFile" >
--
1.5.6.5
1
0

03 Jun '10
* lazzara/afp/photos/gui/src/main_window.cc,
* lazzara/afp/photos/gui/src/main_window.hh: Add shortcuts to
navigate quickly.
---
milena/sandbox/ChangeLog | 8 ++
.../lazzara/afp/photos/gui/src/main_window.cc | 71 +++++++++++++++-----
.../lazzara/afp/photos/gui/src/main_window.hh | 9 ++-
3 files changed, 70 insertions(+), 18 deletions(-)
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 3fec0e3..ba20fec 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Improve the usability of AFP's GUI.
+
+ * lazzara/afp/photos/gui/src/main_window.cc,
+ * lazzara/afp/photos/gui/src/main_window.hh: Add shortcuts to
+ navigate quickly.
+
2010-03-29 Guillaume Lazzara <z(a)lrde.epita.fr>
Add support for more image types.
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
index 5f4cc20..c421b81 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
@@ -81,6 +81,15 @@ namespace mln
this, SLOT(remove_image(bool)));
toolbar_->addAction(removeImage);
+ showHiddenImages_ = new QAction(QIcon(":/icons/photos.png"),
+ tr("Show hidden photos."),
+ toolbar_);
+ showHiddenImages_->setCheckable(true);
+ connect(showHiddenImages_, SIGNAL(toggled(bool)),
+ this, SLOT(show_hidden_images(bool)));
+ toolbar_->addAction(showHiddenImages_);
+
+
addToolBar(toolbar_);
@@ -168,13 +177,6 @@ namespace mln
++current_file_;
progressBar_.setValue(current_file_);
- tabWidget->setTabText(0,
- QString(tr("With text (%1)"))
- .arg(withTextListWidget->count()));
- tabWidget->setTabText(1,
- QString(tr("Without text (%1)"))
- .arg(withoutTextListWidget->count()));
-
if (current_file_ < file_list_.size())
start_process();
else
@@ -264,18 +266,24 @@ namespace mln
item->setSizeHint(QSize(170, 200));
withTextListWidget->addItem(item);
- // Fixme: update tab title with number of photos.
if (withTextListWidget->count() == 1)
{
withTextListWidget->setCurrentRow(0, QItemSelectionModel::SelectCurrent);
- on_withTextListWidget_itemClicked(withTextListWidget->item(0));
+ on_withTextListWidget_currentItemChanged(withTextListWidget->item(0));
}
}
else
- // Fixme: update tab title with number of photos.
withoutTextListWidget->addItem(item);
}
+ // Update tab titles.
+ tabWidget->setTabText(0,
+ QString(tr("With text (%1)"))
+ .arg(withTextListWidget->count()));
+ tabWidget->setTabText(1,
+ QString(tr("Without text (%1)"))
+ .arg(withoutTextListWidget->count()));
+
next_process();
}
@@ -299,7 +307,7 @@ namespace mln
void
- main_window::on_withTextListWidget_itemClicked(QListWidgetItem * item)
+ main_window::on_withTextListWidget_currentItemChanged(QListWidgetItem * item)
{
if (fullImageButton->isChecked())
on_fullImageButton_toggled(true);
@@ -317,7 +325,7 @@ namespace mln
}
void
- main_window::on_withoutTextListWidget_itemClicked(QListWidgetItem * item)
+ main_window::on_withoutTextListWidget_currentItemChanged(QListWidgetItem * item)
{
display_image(file_list_.at(item->data(Qt::UserRole).toInt()).absoluteFilePath());
}
@@ -380,7 +388,7 @@ namespace mln
if (withoutTextListWidget->count())
{
withoutTextListWidget->setCurrentRow(0, QItemSelectionModel::Select);
- on_withoutTextListWidget_itemClicked(withoutTextListWidget->item(0));
+ on_withoutTextListWidget_currentItemChanged(withoutTextListWidget->item(0));
}
}
}
@@ -401,10 +409,41 @@ namespace mln
{
QList<QListWidgetItem *> items = withTextListWidget->selectedItems();
foreach(QListWidgetItem *item, items)
- delete withTextListWidget->takeItem(withTextListWidget->row(item));
+ {
+ hidden_.insert(item);
+ if (! showHiddenImages_->isChecked())
+ item->setHidden(true);
+ }
- if (withTextListWidget->count())
- withTextListWidget->setCurrentRow(0, QItemSelectionModel::Select);
+ update_withtext_count();
+// if (withTextListWidget->count())
+// withTextListWidget->setCurrentRow(0, QItemSelectionModel::Select);
+ }
+
+
+ void
+ main_window::show_hidden_images(bool b)
+ {
+ foreach(QListWidgetItem *item, hidden_)
+ item->setHidden(! b);
+
+ update_withtext_count();
+// if (withTextListWidget->count())
+// withTextListWidget->setCurrentRow(0, QItemSelectionModel::Select);
+ }
+
+
+ void
+ main_window::update_withtext_count()
+ {
+ unsigned count;
+ if (! showHiddenImages_->isChecked())
+ count = withTextListWidget->count() - hidden_.size();
+ else
+ count = withTextListWidget->count();
+ tabWidget->setTabText(0,
+ QString(tr("With text (%1)"))
+ .arg(count));
}
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
index eb6f008..5b42d41 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
@@ -48,8 +48,8 @@ namespace mln
void process__error_slot(QProcess::ProcessError);
void process__finished_slot(int exitCode,
QProcess::ExitStatus exitStatus);
- void on_withTextListWidget_itemClicked(QListWidgetItem * item);
- void on_withoutTextListWidget_itemClicked(QListWidgetItem * item);
+ void on_withTextListWidget_currentItemChanged(QListWidgetItem * item);
+ void on_withoutTextListWidget_currentItemChanged(QListWidgetItem * item);
void on_fullImageButton_toggled(bool b);
void on_textBoxesButton_toggled(bool);
@@ -63,6 +63,7 @@ namespace mln
void cancel_clicked(bool);
void remove_image(bool);
+ void show_hidden_images(bool b);
signals:
void process_finished();
@@ -82,12 +83,15 @@ namespace mln
void connect_process();
+ void update_withtext_count();
+
private: // Attributes
QString output_dir_;
QDir dir_;
QString text_in_photo_ppm_;
QProcess process_;
QString options_;
+ QSet<QListWidgetItem *> hidden_;
QFileInfoList file_list_;
int current_file_;
@@ -99,6 +103,7 @@ namespace mln
// ToolBar
QToolBar *toolbar_;
+ QAction *showHiddenImages_;
};
--
1.5.6.5
1
0

03 Jun '10
* lazzara/afp/photos/gui/src/main_window.cc,
* lazzara/afp/photos/gui/src/main_window.hh: Add support for more
image format and handle directories with no image.
---
milena/sandbox/ChangeLog | 8 +++++
.../lazzara/afp/photos/gui/src/main_window.cc | 30 +++++++++++++++----
.../lazzara/afp/photos/gui/src/main_window.hh | 1 +
3 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 989709b..3fec0e3 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add support for more image types.
+
+ * lazzara/afp/photos/gui/src/main_window.cc,
+ * lazzara/afp/photos/gui/src/main_window.hh: Add support for more
+ image format and handle directories with no image.
+
2010-03-19 Guillaume Lazzara <z(a)lrde.epita.fr>
Improve options menu and progress dialog.
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
index 7a94cb0..5f4cc20 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
@@ -46,7 +46,12 @@ namespace mln
// Setup directory listing
QStringList filters;
- filters << "*.ppm";
+ filters << "*.ppm"
+ << "*.pgm"
+ << "*.pbm"
+ << "*.jpg"
+ << "*.png"
+ << "*.tiff";
dir_.setNameFilters(filters);
dir_.setFilter(QDir::Files);
dir_.setSorting(QDir::Name);
@@ -113,7 +118,7 @@ namespace mln
}
main_window::~main_window()
- {
+ {
if (process_.state() == QProcess::Running)
{
process_.disconnect();
@@ -147,7 +152,14 @@ namespace mln
progressBar_.setValue(0);
options_ = options;
- start_process();
+
+ if (current_file_ < file_list_.size())
+ start_process();
+ else
+ {
+ QMessageBox::critical(this, "No image found!", QString("This application could not find any supported images in the provided directory. Supported file types are: %1").arg(dir_.nameFilters().join(" ")));
+ stop_process();
+ }
}
void
@@ -166,10 +178,7 @@ namespace mln
if (current_file_ < file_list_.size())
start_process();
else
- {
- progressToolBar_->hide();
- emit process_finished();
- }
+ stop_process();
}
@@ -211,6 +220,13 @@ namespace mln
}
void
+ main_window::stop_process()
+ {
+ progressToolBar_->hide();
+ emit process_finished();
+ }
+
+ void
main_window::process__error_slot(QProcess::ProcessError)
{
qDebug() << "error";
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
index 27b42e3..eb6f008 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
@@ -77,6 +77,7 @@ namespace mln
void display_image(const QString& filename);
void start_process();
+ void stop_process();
void next_process();
void connect_process();
--
1.5.6.5
1
0

last-svn-commit-110-g752d8ca Improve options menu and progress dialog.
by Guillaume Lazzara 03 Jun '10
by Guillaume Lazzara 03 Jun '10
03 Jun '10
* lazzara/afp/photos/gui/src/launch_dialog.cc,
* lazzara/afp/photos/gui/src/launch_dialog.hh,
* lazzara/afp/photos/gui/src/main_window.cc,
* lazzara/afp/photos/gui/src/main_window.hh,
* lazzara/afp/photos/gui/ui/launch_dialog.ui: Improve options menu
and progress dialog.
---
milena/sandbox/ChangeLog | 11 ++++
.../lazzara/afp/photos/gui/src/launch_dialog.cc | 17 ++++++-
.../lazzara/afp/photos/gui/src/launch_dialog.hh | 4 +-
.../lazzara/afp/photos/gui/src/main_window.cc | 56 ++++++++++++--------
.../lazzara/afp/photos/gui/src/main_window.hh | 8 ++-
.../lazzara/afp/photos/gui/ui/launch_dialog.ui | 33 +++++++++---
6 files changed, 93 insertions(+), 36 deletions(-)
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 0d7aefd..989709b 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,3 +1,14 @@
+2010-03-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Improve options menu and progress dialog.
+
+ * lazzara/afp/photos/gui/src/launch_dialog.cc,
+ * lazzara/afp/photos/gui/src/launch_dialog.hh,
+ * lazzara/afp/photos/gui/src/main_window.cc,
+ * lazzara/afp/photos/gui/src/main_window.hh,
+ * lazzara/afp/photos/gui/ui/launch_dialog.ui: Improve options menu
+ and progress dialog.
+
2010-02-16 Guillaume Lazzara <z(a)lrde.epita.fr>
Add a GUI for AFP's use case.
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc b/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc
index b0e0fb8..9cd394a 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc
@@ -62,7 +62,7 @@ namespace mln
void
launch_dialog::on_dialogBtnBox_accepted()
{
- emit ok_clicked(pathToPics->text(), checkBox->isChecked());
+ emit ok_clicked(pathToPics->text(), get_options());
}
@@ -72,6 +72,21 @@ namespace mln
dialogBtnBox->button(QDialogButtonBox::Ok)->setEnabled(!str.isEmpty());
}
+
+ QString launch_dialog::get_options() const
+ {
+ if (binarizationMode->currentIndex() == 0)
+ return "0 0";
+ if (binarizationMode->currentIndex() == 1)
+ return "1 0";
+ if (binarizationMode->currentIndex() == 2)
+ return "0 1";
+ if (binarizationMode->currentIndex() == 3)
+ return "1 1";
+
+ return "";
+ }
+
} // end of namespace scribo::demo
} // end of namespace scribo
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh b/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh
index dd4ed31..d3aca98 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh
@@ -49,8 +49,10 @@ namespace mln
void on_pathToPics_textChanged(const QString& str);
signals:
- void ok_clicked(const QString& path, bool fgbg);
+ void ok_clicked(const QString& path, const QString& options);
+ private: // members
+ QString get_options() const;
};
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
index ea63d46..7a94cb0 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
@@ -63,19 +63,6 @@ namespace mln
graphicsView->setScene(new QGraphicsScene());
- // Setup StatusBar
- QStatusBar *status = new QStatusBar();
- setStatusBar(status);
- status->addWidget(&progressLabel_);
- status->addWidget(&progressBar_);
-
- QPushButton *cancelBtn = new QPushButton(tr("Cancel"));
- connect(cancelBtn, SIGNAL(clicked(bool)),
- this, SLOT(cancel_clicked(bool)));
- status->addWidget(cancelBtn);
- statusBar()->hide();
-
-
// Customize item view delegate for picture with text.
withTextListWidget->setItemDelegate(new custom_delegate());
@@ -88,9 +75,26 @@ namespace mln
connect(removeImage, SIGNAL(triggered(bool)),
this, SLOT(remove_image(bool)));
toolbar_->addAction(removeImage);
+
addToolBar(toolbar_);
+ // Setup StatusBar
+ progressToolBar_ = new QToolBar(tr("ProgressBar"));
+
+ progressToolBar_->addWidget(&progressLabel_);
+ progressToolBar_->addWidget(&progressBar_);
+
+ QPushButton *cancelBtn = new QPushButton(tr("&Cancel"));
+ connect(cancelBtn, SIGNAL(clicked(bool)),
+ this, SLOT(cancel_clicked(bool)));
+ progressToolBar_->addWidget(cancelBtn);
+
+ addToolBar(progressToolBar_);
+ progressToolBar_->hide();
+
+
+
// Hide visualization buttons
textOnlyButton->hide();
fullImageButton->hide();
@@ -121,13 +125,14 @@ namespace mln
main_window::on_actionScan_directory_triggered()
{
launch_dialog *dialog = new launch_dialog(this);
- connect(dialog, SIGNAL(ok_clicked(const QString&, bool)),
- this, SLOT(init_and_start_process(const QString&, bool)));
+ connect(dialog, SIGNAL(ok_clicked(const QString&, const QString&)),
+ this, SLOT(init_and_start_process(const QString&, const QString&)));
dialog->show();
}
void
- main_window::init_and_start_process(const QString& dirname, bool bgfg)
+ main_window::init_and_start_process(const QString& dirname,
+ const QString& options)
{
dir_.setPath(dirname);
@@ -136,12 +141,12 @@ namespace mln
withTextListWidget->clear();
withoutTextListWidget->clear();
- statusBar()->show();
+ progressToolBar_->show();
progressLabel_.setText(tr("Processing images..."));
progressBar_.setRange(0, file_list_.size());
progressBar_.setValue(0);
- bgfg_ = bgfg;
+ options_ = options;
start_process();
}
@@ -162,7 +167,7 @@ namespace mln
start_process();
else
{
- statusBar()->hide();
+ progressToolBar_->hide();
emit process_finished();
}
}
@@ -192,9 +197,14 @@ namespace mln
{
QStringList args;
args << file_list_.at(current_file_).absoluteFilePath() // input file.
- << textMask_file(file_list_.at(current_file_).baseName()) // output file.
- << QString("%1").arg(bgfg_) // Enable/Disable remove background.
- << "1" << "1" << "1" << "1" // Enable all steps.
+ << textMask_file(file_list_.at(current_file_).baseName()); // output file.
+
+ // Enable/Disable remove background + Enable/Disable sauvola_ms.
+ QStringList options = options_.split(' ');
+ foreach(QString option, options)
+ args << option;
+
+ args << "1" << "1" << "1" // Enable all steps.
<< "/tmp/" + file_list_.at(current_file_).baseName();
process_.start(text_in_photo_ppm_, args);
@@ -367,7 +377,7 @@ namespace mln
process_.waitForFinished();
progressBar_.setValue(progressBar_.maximum());
connect_process();
- statusBar()->hide();
+ progressToolBar_->hide();
}
void
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
index 55ea254..27b42e3 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
@@ -58,7 +58,8 @@ namespace mln
void on_tabWidget_currentChanged(int index);
void on_actionScan_directory_triggered();
- void init_and_start_process(const QString& dirname, bool bgfg);
+ void init_and_start_process(const QString& dirname,
+ const QString& options);
void cancel_clicked(bool);
void remove_image(bool);
@@ -85,12 +86,13 @@ namespace mln
QDir dir_;
QString text_in_photo_ppm_;
QProcess process_;
- bool bgfg_;
+ QString options_;
QFileInfoList file_list_;
int current_file_;
- // Status bar
+ // Progress tool bar
+ QToolBar *progressToolBar_;
QLabel progressLabel_;
QProgressBar progressBar_;
diff --git a/milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui b/milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui
index cc59126..a7aa216 100644
--- a/milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui
+++ b/milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui
@@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>285</width>
- <height>165</height>
+ <width>371</width>
+ <height>160</height>
</rect>
</property>
<property name="windowTitle" >
@@ -36,13 +36,30 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
- <widget class="QCheckBox" name="checkBox" >
- <property name="text" >
- <string>Enable Foreground extraction (slower)</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
+ <widget class="QComboBox" name="binarizationMode" >
+ <property name="currentIndex" >
+ <number>3</number>
</property>
+ <item>
+ <property name="text" >
+ <string>Binarization from intensity</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Binarization from foreground (slower)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Multiscale Binarization from intensity </string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Multiscale Binarization from foreground (slower)</string>
+ </property>
+ </item>
</widget>
</item>
</layout>
--
1.5.6.5
1
0

03 Jun '10
* lazzara/afp/photos/gui/gui.pro,
* lazzara/afp/photos/gui/gui.qrc,
* lazzara/afp/photos/gui/icons/next.png,
* lazzara/afp/photos/gui/icons/ok.png,
* lazzara/afp/photos/gui/icons/photos.png,
* lazzara/afp/photos/gui/icons/prev.png,
* lazzara/afp/photos/gui/icons/remove.png,
* lazzara/afp/photos/gui/src/custom_delegate.cc,
* lazzara/afp/photos/gui/src/custom_delegate.hh,
* lazzara/afp/photos/gui/src/launch_dialog.cc,
* lazzara/afp/photos/gui/src/launch_dialog.hh,
* lazzara/afp/photos/gui/src/main.cc,
* lazzara/afp/photos/gui/src/main_window.cc,
* lazzara/afp/photos/gui/src/main_window.hh,
* lazzara/afp/photos/gui/ui/launch_dialog.ui,
* lazzara/afp/photos/gui/ui/main_window.ui: New files. GUI meant
to display the results of text finding in pictures.
---
milena/sandbox/ChangeLog | 22 +
milena/sandbox/lazzara/afp/photos/gui/gui.pro | 17 +
milena/sandbox/lazzara/afp/photos/gui/gui.qrc | 9 +
.../sandbox/lazzara/afp/photos/gui/icons/next.png | Bin 0 -> 3337 bytes
milena/sandbox/lazzara/afp/photos/gui/icons/ok.png | Bin 0 -> 3953 bytes
.../lazzara/afp/photos/gui/icons/photos.png | Bin 0 -> 3750 bytes
.../sandbox/lazzara/afp/photos/gui/icons/prev.png | Bin 0 -> 3334 bytes
.../lazzara/afp/photos/gui/icons/remove.png | Bin 3704 -> 3704 bytes
.../lazzara/afp/photos/gui/src/custom_delegate.cc | 105 ++++
.../lazzara/afp/photos/gui/src/custom_delegate.hh | 81 +++
.../lazzara/afp/photos/gui/src/launch_dialog.cc | 79 +++
.../lazzara/afp/photos/gui/src/launch_dialog.hh | 61 ++
milena/sandbox/lazzara/afp/photos/gui/src/main.cc | 46 ++
.../lazzara/afp/photos/gui/src/main_window.cc | 435 +++++++++++++
.../lazzara/afp/photos/gui/src/main_window.hh | 106 ++++
.../lazzara/afp/photos/gui/ui/launch_dialog.ui | 100 +++
.../lazzara/afp/photos/gui/ui/main_window.ui | 656 ++++++++++++++++++++
17 files changed, 1717 insertions(+), 0 deletions(-)
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/gui.pro
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/gui.qrc
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/icons/next.png
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/icons/ok.png
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/icons/photos.png
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/icons/prev.png
copy scribo/demo/shared/icons/Symbols-Delete-icon.png => milena/sandbox/lazzara/afp/photos/gui/icons/remove.png (100%)
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/src/main.cc
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui
create mode 100644 milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 98394ed..0d7aefd 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,3 +1,25 @@
+2010-02-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add a GUI for AFP's use case.
+
+ * lazzara/afp/photos/gui/gui.pro,
+ * lazzara/afp/photos/gui/gui.qrc,
+ * lazzara/afp/photos/gui/icons/next.png,
+ * lazzara/afp/photos/gui/icons/ok.png,
+ * lazzara/afp/photos/gui/icons/photos.png,
+ * lazzara/afp/photos/gui/icons/prev.png,
+ * lazzara/afp/photos/gui/icons/remove.png,
+ * lazzara/afp/photos/gui/src/custom_delegate.cc,
+ * lazzara/afp/photos/gui/src/custom_delegate.hh,
+ * lazzara/afp/photos/gui/src/launch_dialog.cc,
+ * lazzara/afp/photos/gui/src/launch_dialog.hh,
+ * lazzara/afp/photos/gui/src/main.cc,
+ * lazzara/afp/photos/gui/src/main_window.cc,
+ * lazzara/afp/photos/gui/src/main_window.hh,
+ * lazzara/afp/photos/gui/ui/launch_dialog.ui,
+ * lazzara/afp/photos/gui/ui/main_window.ui: New files. GUI meant
+ to display the results of text finding in pictures.
+
2010-03-22 Guillaume Lazzara <z(a)lrde.epita.fr>
Add new benchs.
diff --git a/milena/sandbox/lazzara/afp/photos/gui/gui.pro b/milena/sandbox/lazzara/afp/photos/gui/gui.pro
new file mode 100644
index 0000000..41b8006
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/gui.pro
@@ -0,0 +1,17 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Wed Nov 25 13:42:17 2009
+######################################################################
+
+TEMPLATE = app
+TARGET =
+DEPENDPATH += . src ui
+INCLUDEPATH += . src
+
+CONFIG += release
+
+# Input
+HEADERS += src/main_window.hh src/custom_delegate.hh src/launch_dialog.hh
+FORMS += ui/main_window.ui ui/launch_dialog.ui
+SOURCES += src/main.cc src/main_window.cc src/custom_delegate.cc src/launch_dialog.cc
+
+RESOURCES = gui.qrc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/gui.qrc b/milena/sandbox/lazzara/afp/photos/gui/gui.qrc
new file mode 100644
index 0000000..e5007a8
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/gui.qrc
@@ -0,0 +1,9 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>icons/next.png</file>
+ <file>icons/ok.png</file>
+ <file>icons/photos.png</file>
+ <file>icons/prev.png</file>
+ <file>icons/remove.png</file>
+ </qresource>
+</RCC>
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/next.png b/milena/sandbox/lazzara/afp/photos/gui/icons/next.png
new file mode 100644
index 0000000000000000000000000000000000000000..ef6d66d69fdcdca147974de4a15ebdf319fa7713
GIT binary patch
literal 3337
zcmV+k4fgVhP)<h;3K|Lk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f{0sE=J
z_dOxgm$GUCA&+neSV~SKX;Zb(XCy(}PfwcBLe|I6&7>eLRF4SJ5r$+BL2hh0Xk@ee
z5#m4gDC`Z1pQ0{g?uY$y<?1G(MkBsu-yh1K+pry6_Un|>i2vN?`=;w?Uq1eS01&+U
T0eBG~00000NkvXXu0mjf!@6M$
literal 0
HcmV?d00001
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/ok.png b/milena/sandbox/lazzara/afp/photos/gui/icons/ok.png
new file mode 100644
index 0000000000000000000000000000000000000000..217030a740da05d23648d40358d7d4e0773a6520
GIT binary patch
literal 3953
zcmV-%503DOP)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm000j-Nkl<Zc-qxk
z3wTu3wO;!?=AFr8ChrG{nD7kY5rSGOuk@l<tko-Um9N_CZAH9VX?v|!uV1gI?Ps+`
z`7GSet5U1@C|*GnM34qW1QiOEG!O+%0(n0snM^XzbI!hN?{ns4CJ6|X+OLQ2<m@@;
z%--u?>tFv`=L`h?!8dZDCh{&4Jye4^RHc=;PsDK^&h7>ZgLrHs0vrPYYKcG&ilWfe
zvrSR{?f|@3%LFLBLXBuEM4M1;&$BpXj|hSj=M^Z`G!@jCO7J>Wf+{Hel&B$4X^8kG
zQLME(E&C*kxL1^fn#Pv{@vjv?<~5e;_<-`5tHd!QqdW~PUJ+D<8w_e(!CeKL%>v#m
z5BRb&AUz`u91c5JBpDDignFaU(-?qLwH?rKxYdv6HrdjwPd2?0sQa4&$iCj@MZ<q>
z&$iv1KR;WvdS%KDW}c2KR8utY_|iyTQ8vx+rh_bsL=q(`2_lFBjs<}Vf`DUz5F$`C
zfG9DQe*SS2?0@Y@e6TOP-kD*4;L8_!doDPDoW=HO(LikDn1uzUS(RSU6lSza6%Ifl
z4yTRg6!^elw-K2cElPk?A+jLiSOf$?5Cj!D7y;7(0T3V<5UOF)C^+ArwjHDUUj4Mu
z>9a3udMWVH1p|<?#PLsRRDEso_a~$~a%~1(bgEEQ1GmQxE|-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h6m_Z-}35DDgDMCQo_Fit1|7tP1BUYys3rpP$f
za2zp=_T#u2H1!nt;~j83-ih8;aR)endl$d^9JjyrzZx*|<l#P*fe{=q32R1)=z>g?
zU^{P-m=MJwu0^09Tj6#!2#xr;9?u`ao&BiI+Jp1@mHt8iNNmj49s^7v=t=K3&NHuu
zaQEZhX6(${?3Whxd=~p#07%|g-zpi#C+1g@c6y%ker*80*6sfRkzv1@_Vt>%00000
LNkvXXu0mjfyi#d`
literal 0
HcmV?d00001
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/photos.png b/milena/sandbox/lazzara/afp/photos/gui/icons/photos.png
new file mode 100644
index 0000000000000000000000000000000000000000..65fe33d6e0cdb06bd35b008f4535b2bd5e48eee1
GIT binary patch
literal 3750
zcmV;X4q5SuP)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm000hcNkl<Zc-rk*
z3y>Annf|)_-rM&zGt7fA&LAoyYRJZ*60LnyLQI9=Ry0d|ZDN(OwWEUK3l_mmNOm<S
zS}TaW0%VsZiAn+}AW=YqFzWEsL59c3I50fs$;`bo_x<eN@0{+-y-)+}R&CXkRUSQb
z-|oM=|L=c(=Zu0c`A`O1fv*4zwgO)PxclzA|9<M!slQMZ#Sj-v(*(~YGSj+XOIlb>
z)8MIk_P&(2O>tJV&^#vO`wa1%_>bo%Y(X<GBj0aI;j_;RIaSrPS+i!nyk*Olw+969
z=%bHLTC`}<lEJp*#RiT1*xI#g7Y_(v(xgeXOO`BIKG;fLY)qIi;gNOg)-Agv0A<qa
zK$4N9H~`Idq^1H6PKFKrX-&nxCZ;OnI2{iAw|GY5Ij1IHV1<XcC*%~(ewVnZTJIO%
z(o9>PLj*IwW8OdV{|3PGFKduUnbt?7qNb&c1Y>_pD5Kdxa=_#@B@aj|0HfH7YxYq+
zAAn*ht|6ZfoKDK8?iz7v0Fx(Au3fx%u?1k}TS#R1v`PiU(J(EA)B?qG$FrW%tPjiI
zilv;h000WSmjfW)DZHEmo>Ts8<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8qoV+1ZswlL?f&N!&du``
zP1_2l3uda|da3}d7{>o+b}9qR!g~W*|9n8^dH4QTAN^8~uK*18_|gOTAJ76<@>;T1
Qj{pDw07*qoM6N<$f^cFl{Qv*}
literal 0
HcmV?d00001
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/prev.png b/milena/sandbox/lazzara/afp/photos/gui/icons/prev.png
new file mode 100644
index 0000000000000000000000000000000000000000..5f05d74f8ce387d8a289981ef3d8a712b08aa8aa
GIT binary patch
literal 3334
zcmV+h4f*nkP)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm000clNkl<Zc-p;M
z33O9c8vgQLwwI($Th^AvR?AigMHE>TWds!W9rcWq8J9C28TSQ7oij6z3yb^c90Zra
zgM#2vL{J$QlucluP)eaKDQ(j>ZIiUkp1fuLn{>%*ldhxpobTl2<-U8r@818v|9|g`
z1_Lh~A&+n|;e5gb!f3(}g1)s*n9xY5B$N;i5_S@f5u|~1t{K3y6A6n5Hxja0OV%M8
zjL6kscs4L-D3F#eLqqqQ-5NOSHK;ue*h>{O*DFwzXd6t>X2Sb~!e2|kC4^;!IlLZx
z_62&JeW?x;X7Cu1tsuoD!D5tP79^w)c$yz?fQL885$My;!*0`{c#n)@-$!t2Zx~`2
zGPU<T;W@&8eklPtgjWey3h5k|ceNQ4uP|cJFa>6#43i+oh#R{X;G=6FefmQjU2|~J
z%oJ`5q3ClT{7#w8%a?=)2<87T0j$owgcZC|V;Os$6%!ViVM!s<202RDYL+l0J%UvF
zH0b3hX~slSG>~Klx|TGEFhn>6m>7Qy{#G#_FNfl-ew2LL4AHOn=<&x1Zz0xHzXb?{
zw+VNo<q0@@(O{$v*F=e@nna8l89+{E2-XylY+3_Rjw390eDAogz84H?(A>hq>DESP
zh6!nMC^-6_6Rx8H*8fL@KM?%=5nv^3p&A!uEf|E+^Q|x$6<941OwaS+oHKpU>6A{y
zkdUa9^g32QERvJEw5X}mM`wl2P{mg*sQSVQ@{V1^;~IjiF9K2t+re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A_*^rwTZ4$sp*{wW{Mjv9)85q=j43!z1fx
zdElcnBeynBV+o$TTuaM~R+Pa<h<F5vUvRi1P(HJ<wVs8~b%?zoO?tfD+t;j=oZ|(Z
znKO-9n1)eTSfTKoDnIZ1{y^+x4swFmQ7ZD}1Jdq#DBsnv$j5dvj}X>ifUjBO%NW9I
zg!#t7yk^vuX&5rw3eL=TA>ZB0zAofF5+eH>A^$|d)e~XI5e0;Y2o=2{)t^Hfwhli<
zn8oQeT-v#2SSMRx9&ZMhu5V8UlagmIyIm1PN<D}aHA6l@rY*7sH2N0<_E&=+`a)(P
zr%saz`Go7iQgUiZn?_4#rUBYPdYTz66n*TynG_^P^@tFiVMvY;l$Q1vjck-RA@*mF
zqW+K=_^}x+D2V-Y<>FRR;}JWu9}M;1Z73Q=|DAFivA^5=(0VQRu|HM$9~wH-`&N&A
Q4FCWD07*qoM6N<$g0TKcw*UYD
literal 0
HcmV?d00001
diff --git a/scribo/demo/shared/icons/Symbols-Delete-icon.png b/milena/sandbox/lazzara/afp/photos/gui/icons/remove.png
similarity index 100%
copy from scribo/demo/shared/icons/Symbols-Delete-icon.png
copy to milena/sandbox/lazzara/afp/photos/gui/icons/remove.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc b/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc
new file mode 100644
index 0000000..cfbb7c3
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc
@@ -0,0 +1,105 @@
+// Copyright (C) 2009 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.
+
+#include <src/custom_delegate.hh>
+
+#include <QtCore/QtCore>
+
+namespace mln
+{
+
+ namespace demo
+ {
+
+ custom_delegate::custom_delegate(QObject * parent)
+ : QItemDelegate(parent),
+ bg_(Qt::black, Qt::SolidPattern),
+ selected_bg_(QColor(255, 100, 0), Qt::Dense5Pattern)
+ {
+ display_rect_.setSize(QSize(149, 30));
+ decoration_rect_.setSize(QSize(150, 150));
+ }
+
+
+ custom_delegate::~custom_delegate()
+ {
+ }
+
+ void
+ custom_delegate::drawDecoration(QPainter *painter,
+ const QStyleOptionViewItem& option,
+ const QRect& rect,
+ const QPixmap& pixmap) const
+ {
+ decoration_rect_.moveTo(option.rect.x() + 10, option.rect.y() + 10);
+ painter->fillRect(decoration_rect_, bg_);
+ super_::drawDecoration(painter, option, decoration_rect_, pixmap);
+ }
+
+
+ void
+ custom_delegate::drawBackground(QPainter *painter,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index) const
+ {
+ super_::drawBackground(painter, option, index);
+ }
+
+
+ void
+ custom_delegate::drawCheck(QPainter *painter,
+ const QStyleOptionViewItem& option,
+ const QRect& rect,
+ Qt::CheckState state) const
+ {
+ super_::drawCheck(painter, option, rect, state);
+ }
+
+
+ void
+ custom_delegate::drawDisplay(QPainter* painter,
+ const QStyleOptionViewItem& option,
+ const QRect& rect,
+ const QString& text) const
+ {
+ display_rect_.moveTo(option.rect.x() + 10,
+ option.rect.y() + 155);
+ super_::drawDisplay(painter, option, display_rect_, text);
+ painter->drawRect(display_rect_);
+ }
+
+
+ void
+ custom_delegate::drawFocus(QPainter* painter,
+ const QStyleOptionViewItem& option,
+ const QRect& rect ) const
+ {
+ super_::drawFocus(painter, option, display_rect_);
+ }
+
+
+ } // end of namespace mln::demo
+
+} // end of namespace mln
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh b/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh
new file mode 100644
index 0000000..06fb69d
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh
@@ -0,0 +1,81 @@
+// Copyright (C) 2009 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.
+
+# include <QtGui/QtGui>
+
+namespace mln
+{
+
+ namespace demo
+ {
+
+ class custom_delegate : public QItemDelegate
+ {
+
+ typedef QItemDelegate super_;
+
+ public:
+
+ custom_delegate(QObject * parent = 0);
+ ~custom_delegate();
+
+ void
+ drawDecoration(QPainter *painter,
+ const QStyleOptionViewItem& option,
+ const QRect& rect,
+ const QPixmap& pixmap) const;
+
+ void drawBackground(QPainter *painter,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index) const;
+
+ void drawCheck(QPainter *painter,
+ const QStyleOptionViewItem& option,
+ const QRect& rect,
+ Qt::CheckState state) const;
+
+ void
+ drawDisplay(QPainter* painter,
+ const QStyleOptionViewItem& option,
+ const QRect& rect,
+ const QString& text) const;
+
+ void
+ drawFocus(QPainter* painter,
+ const QStyleOptionViewItem& option,
+ const QRect& rect ) const;
+
+ private:
+ mutable QRect display_rect_;
+ mutable QRect decoration_rect_;
+ QBrush bg_;
+ QBrush selected_bg_;
+
+ };
+
+
+ } // end of namespace mln::demo
+
+} // end of namespace mln
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc b/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc
new file mode 100644
index 0000000..b0e0fb8
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2009 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.
+
+
+#include <QtCore>
+#include <QtGui>
+#include <src/launch_dialog.hh>
+#include <src/custom_delegate.hh>
+
+namespace mln
+{
+
+ namespace demo
+ {
+
+ launch_dialog::launch_dialog(QWidget *parent)
+ : QDialog(parent)
+ {
+ setupUi(this);
+ }
+
+ launch_dialog::~launch_dialog()
+ {
+
+ }
+
+
+ void
+ launch_dialog::on_browseBtn_clicked(bool)
+ {
+ QString dirname = QFileDialog::getExistingDirectory(this, "");
+
+ if (!dirname.isEmpty())
+ {
+ pathToPics->setText(dirname);
+ }
+ }
+
+
+ void
+ launch_dialog::on_dialogBtnBox_accepted()
+ {
+ emit ok_clicked(pathToPics->text(), checkBox->isChecked());
+ }
+
+
+ void
+ launch_dialog::on_pathToPics_textChanged(const QString& str)
+ {
+ dialogBtnBox->button(QDialogButtonBox::Ok)->setEnabled(!str.isEmpty());
+ }
+
+ } // end of namespace scribo::demo
+
+} // end of namespace scribo
+
+
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh b/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh
new file mode 100644
index 0000000..dd4ed31
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh
@@ -0,0 +1,61 @@
+// Copyright (C) 2009 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.
+
+#ifndef MLN_DEMO_SRC_LAUNCH_DIALOG_HH
+
+# include <QtGui>
+# include <ui_launch_dialog.h>
+
+namespace mln
+{
+
+ namespace demo
+ {
+
+
+ class launch_dialog : public QDialog, private Ui::LaunchDialog
+ {
+ Q_OBJECT
+
+ public:
+ launch_dialog(QWidget *parent = 0);
+ ~launch_dialog();
+
+ private slots:
+ void on_dialogBtnBox_accepted();
+ void on_browseBtn_clicked(bool);
+ void on_pathToPics_textChanged(const QString& str);
+
+ signals:
+ void ok_clicked(const QString& path, bool fgbg);
+
+ };
+
+
+ } // end of namespace mln::demo
+
+} // end of namespace mln
+
+#endif // ! MLN_DEMO_SRC_LAUNCH_DIALOG_HH
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main.cc b/milena/sandbox/lazzara/afp/photos/gui/src/main.cc
new file mode 100644
index 0000000..5349bcb
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main.cc
@@ -0,0 +1,46 @@
+// Copyright (C) 2009 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.
+
+#include <QApplication>
+#include <QtGui>
+
+#include <src/main_window.hh>
+
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ if (argc < 2)
+ {
+ qDebug() << "Usage: " << argv[0] << " <path/text_in_photo_ppm>";
+ return 1;
+ }
+
+ mln::demo::main_window win(argv[1]);
+
+ win.show();
+ return app.exec();
+}
+
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
new file mode 100644
index 0000000..ea63d46
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
@@ -0,0 +1,435 @@
+// Copyright (C) 2009 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.
+
+
+#include <QtCore>
+#include <QtGui>
+#include <src/main_window.hh>
+#include <src/launch_dialog.hh>
+#include <src/custom_delegate.hh>
+
+namespace mln
+{
+
+ namespace demo
+ {
+
+ main_window::main_window(const QString& text_in_photo_ppm, QWidget *parent)
+ : QMainWindow(parent), text_in_photo_ppm_(text_in_photo_ppm)
+ {
+ setupUi(this);
+
+ // Temporary output directory
+ output_dir_ = "/tmp/";
+
+ // Setup directory listing
+ QStringList filters;
+ filters << "*.ppm";
+ dir_.setNameFilters(filters);
+ dir_.setFilter(QDir::Files);
+ dir_.setSorting(QDir::Name);
+
+ // Setup Signal/Slots connections
+ connect(&process_, SIGNAL(error(QProcess::ProcessError)),
+ this, SLOT(process__error_slot(QProcess::ProcessError)));
+ connect(&process_,
+ SIGNAL(finished(int, QProcess::ExitStatus)),
+ this,
+ SLOT(process__finished_slot(int, QProcess::ExitStatus)));
+
+ // Setup graphicsView
+ graphicsView->setScene(new QGraphicsScene());
+
+
+ // Setup StatusBar
+ QStatusBar *status = new QStatusBar();
+ setStatusBar(status);
+ status->addWidget(&progressLabel_);
+ status->addWidget(&progressBar_);
+
+ QPushButton *cancelBtn = new QPushButton(tr("Cancel"));
+ connect(cancelBtn, SIGNAL(clicked(bool)),
+ this, SLOT(cancel_clicked(bool)));
+ status->addWidget(cancelBtn);
+ statusBar()->hide();
+
+
+ // Customize item view delegate for picture with text.
+ withTextListWidget->setItemDelegate(new custom_delegate());
+
+ // Setup Toolbar.
+ toolbar_ = new QToolBar(tr("Action"));
+ toolbar_->setToolButtonStyle(Qt::ToolButtonIconOnly);
+ QAction *removeImage = new QAction(QIcon(":/icons/remove.png"),
+ tr("Tag as image without text"),
+ toolbar_);
+ connect(removeImage, SIGNAL(triggered(bool)),
+ this, SLOT(remove_image(bool)));
+ toolbar_->addAction(removeImage);
+ addToolBar(toolbar_);
+
+
+ // Hide visualization buttons
+ textOnlyButton->hide();
+ fullImageButton->hide();
+ textBoxesButton->hide();
+ textMaskButton->hide();
+
+ // Set default visualization.
+ textBoxesButton->setChecked(true);
+ actionText_Boxes->setChecked(true);
+ QActionGroup * actionGroup = new QActionGroup(this);
+ actionGroup->addAction(actionText_Boxes);
+ actionGroup->addAction(actionFull_Image);
+ actionGroup->addAction(action_Text_Only);
+ actionGroup->addAction(actionText_Mask);
+ actionGroup->setExclusive(true);
+ }
+
+ main_window::~main_window()
+ {
+ if (process_.state() == QProcess::Running)
+ {
+ process_.disconnect();
+ process_.close();
+ }
+ }
+
+ void
+ main_window::on_actionScan_directory_triggered()
+ {
+ launch_dialog *dialog = new launch_dialog(this);
+ connect(dialog, SIGNAL(ok_clicked(const QString&, bool)),
+ this, SLOT(init_and_start_process(const QString&, bool)));
+ dialog->show();
+ }
+
+ void
+ main_window::init_and_start_process(const QString& dirname, bool bgfg)
+ {
+ dir_.setPath(dirname);
+
+ file_list_ = dir_.entryInfoList();
+ current_file_ = 0;
+ withTextListWidget->clear();
+ withoutTextListWidget->clear();
+
+ statusBar()->show();
+ progressLabel_.setText(tr("Processing images..."));
+ progressBar_.setRange(0, file_list_.size());
+ progressBar_.setValue(0);
+
+ bgfg_ = bgfg;
+ start_process();
+ }
+
+ void
+ main_window::next_process()
+ {
+ ++current_file_;
+ progressBar_.setValue(current_file_);
+
+ tabWidget->setTabText(0,
+ QString(tr("With text (%1)"))
+ .arg(withTextListWidget->count()));
+ tabWidget->setTabText(1,
+ QString(tr("Without text (%1)"))
+ .arg(withoutTextListWidget->count()));
+
+ if (current_file_ < file_list_.size())
+ start_process();
+ else
+ {
+ statusBar()->hide();
+ emit process_finished();
+ }
+ }
+
+
+ QString
+ main_window::output_file(const QString& basename)
+ {
+ return output_dir_ + basename + "_out_text.ppm";
+ }
+
+ QString
+ main_window::textBoxes_file(const QString& basename)
+ {
+ return output_dir_ + basename + "_input_with_bboxes.ppm";
+ }
+
+ QString
+ main_window::textMask_file(const QString& basename)
+ {
+ return output_dir_ + basename + "_out.ppm";
+ }
+
+
+ void
+ main_window::start_process()
+ {
+ QStringList args;
+ args << file_list_.at(current_file_).absoluteFilePath() // input file.
+ << textMask_file(file_list_.at(current_file_).baseName()) // output file.
+ << QString("%1").arg(bgfg_) // Enable/Disable remove background.
+ << "1" << "1" << "1" << "1" // Enable all steps.
+ << "/tmp/" + file_list_.at(current_file_).baseName();
+
+ process_.start(text_in_photo_ppm_, args);
+ }
+
+ void
+ main_window::process__error_slot(QProcess::ProcessError)
+ {
+ qDebug() << "error";
+ }
+
+ void
+ main_window::process__finished_slot(int exitCode,
+ QProcess::ExitStatus exitStatus)
+ {
+ QString filename = file_list_.at(current_file_).fileName();
+
+ if (exitStatus == QProcess::CrashExit)
+ {
+ qDebug() << "Process crashed with file "
+ << file_list_.at(current_file_).fileName();
+ }
+ else
+ {
+ QFileInfo f(filename);
+ QFileInfo text_image();
+ QPixmap pixmap(output_file(f.baseName()));
+
+ QListWidgetItem *item;
+ if (! pixmap.isNull())
+ item = new QListWidgetItem(QIcon(pixmap.scaled(150, 150, Qt::KeepAspectRatio)), filename + QString(" (%1)").arg(exitCode));
+ else
+ item = new QListWidgetItem(filename + QString(" (%1)").arg(exitCode));
+
+ item->setData(Qt::UserRole, QVariant(current_file_));
+
+ if (exitCode)
+ {
+ item->setCheckState(Qt::Unchecked);
+ item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+
+ item->setSizeHint(QSize(170, 200));
+ withTextListWidget->addItem(item);
+ // Fixme: update tab title with number of photos.
+ if (withTextListWidget->count() == 1)
+ {
+ withTextListWidget->setCurrentRow(0, QItemSelectionModel::SelectCurrent);
+ on_withTextListWidget_itemClicked(withTextListWidget->item(0));
+ }
+ }
+ else
+ // Fixme: update tab title with number of photos.
+ withoutTextListWidget->addItem(item);
+ }
+
+ next_process();
+ }
+
+
+ void
+ main_window::display_image(const QString& filename)
+ {
+ graphicsView->scene()->clear();
+
+ QPixmap pixmap(filename);
+ QGraphicsPixmapItem *item = graphicsView->scene()->addPixmap(pixmap);
+
+ graphicsView->setSceneRect(item->boundingRect());
+
+ if (item->boundingRect().contains(graphicsView->viewport()->geometry()))
+ graphicsView->fitInView(item->boundingRect(), Qt::KeepAspectRatio);
+ else
+ graphicsView->fitInView(graphicsView->viewport()->geometry(),
+ Qt::KeepAspectRatio);
+ }
+
+
+ void
+ main_window::on_withTextListWidget_itemClicked(QListWidgetItem * item)
+ {
+ if (fullImageButton->isChecked())
+ on_fullImageButton_toggled(true);
+ else if (textOnlyButton->isChecked())
+ on_textOnlyButton_toggled(true);
+ else if (textBoxesButton->isChecked())
+ on_textBoxesButton_toggled(true);
+ else if (textMaskButton->isChecked())
+ on_textMaskButton_toggled(true);
+ else
+ {
+ QFileInfo f(item->text());
+ display_image(output_file(f.baseName()));
+ }
+ }
+
+ void
+ main_window::on_withoutTextListWidget_itemClicked(QListWidgetItem * item)
+ {
+ display_image(file_list_.at(item->data(Qt::UserRole).toInt()).absoluteFilePath());
+ }
+
+ void
+ main_window::on_fullImageButton_toggled(bool)
+ {
+ if (withTextListWidget->count())
+ {
+ QString filename = file_list_.at(withTextListWidget->currentItem()->data(Qt::UserRole).toInt()).absoluteFilePath();
+ display_image(filename);
+ }
+ }
+
+ void
+ main_window::on_textBoxesButton_toggled(bool)
+ {
+ if (withTextListWidget->count())
+ {
+ QFileInfo f(withTextListWidget->currentItem()->text());
+ display_image(textBoxes_file(f.baseName()));
+ }
+ }
+
+ void
+ main_window::on_textMaskButton_toggled(bool)
+ {
+ if (withTextListWidget->count())
+ {
+ QFileInfo f(withTextListWidget->currentItem()->text());
+ display_image(textMask_file(f.baseName()));
+ }
+ }
+
+ void
+ main_window::on_textOnlyButton_toggled(bool)
+ {
+ if (withTextListWidget->count())
+ {
+ QFileInfo f(withTextListWidget->currentItem()->text());
+ display_image(output_file(f.baseName()));
+ }
+ }
+
+
+
+ void
+ main_window::on_tabWidget_currentChanged(int index)
+ {
+ bool b = (index == 0);
+ fullImageButton->setEnabled(b);
+ textOnlyButton->setEnabled(b);
+ textBoxesButton->setEnabled(b);
+ textMaskButton->setEnabled(b);
+ toolbar_->setEnabled(b);
+
+ if (index == 1)
+ {
+ graphicsView->scene()->clear();
+ if (withoutTextListWidget->count())
+ {
+ withoutTextListWidget->setCurrentRow(0, QItemSelectionModel::Select);
+ on_withoutTextListWidget_itemClicked(withoutTextListWidget->item(0));
+ }
+ }
+ }
+
+ void
+ main_window::cancel_clicked(bool)
+ {
+ process_.disconnect();
+ process_.kill();
+ process_.waitForFinished();
+ progressBar_.setValue(progressBar_.maximum());
+ connect_process();
+ statusBar()->hide();
+ }
+
+ void
+ main_window::remove_image(bool)
+ {
+ QList<QListWidgetItem *> items = withTextListWidget->selectedItems();
+ foreach(QListWidgetItem *item, items)
+ delete withTextListWidget->takeItem(withTextListWidget->row(item));
+
+ if (withTextListWidget->count())
+ withTextListWidget->setCurrentRow(0, QItemSelectionModel::Select);
+ }
+
+
+ void main_window::connect_process()
+ {
+ connect(&process_, SIGNAL(error(QProcess::ProcessError)),
+ this, SLOT(process__error_slot(QProcess::ProcessError)));
+ connect(&process_,
+ SIGNAL(finished(int, QProcess::ExitStatus)),
+ this,
+ SLOT(process__finished_slot(int, QProcess::ExitStatus)));
+ }
+
+
+ void
+ main_window::keyPressEvent(QKeyEvent * event)
+ {
+ if (tabWidget->currentIndex() == 0)
+ {
+ switch(event->key())
+ {
+ case Qt::Key_F1:
+ on_textOnlyButton_toggled(true);
+ break;
+ case Qt::Key_F2:
+ on_fullImageButton_toggled(true);
+ break;
+ case Qt::Key_F3:
+ on_textBoxesButton_toggled(true);
+ break;
+ case Qt::Key_F4:
+ on_textMaskButton_toggled(true);
+ break;
+ }
+ }
+ else
+ event->ignore();
+ }
+
+ void
+ main_window::resizeEvent(QResizeEvent* event)
+ {
+ if (graphicsView->scene()->items().size())
+ graphicsView->fitInView(graphicsView->scene()->items().at(0)->boundingRect(),
+ Qt::KeepAspectRatio);
+
+ event->ignore();
+ }
+
+ } // end of namespace scribo::demo
+
+} // end of namespace scribo
+
+
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
new file mode 100644
index 0000000..55ea254
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
@@ -0,0 +1,106 @@
+// Copyright (C) 2009 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.
+
+#ifndef MLN_DEMO_SRC_MAIN_WINDOW_HH
+
+# include <QtGui>
+# include <ui_main_window.h>
+
+namespace mln
+{
+
+ namespace demo
+ {
+
+
+ class main_window : public QMainWindow, private Ui::MainWindow
+ {
+ Q_OBJECT
+
+ public:
+ main_window(const QString& text_in_photo_ppm, QWidget *parent = 0);
+ ~main_window();
+
+
+ private slots:
+ void process__error_slot(QProcess::ProcessError);
+ void process__finished_slot(int exitCode,
+ QProcess::ExitStatus exitStatus);
+ void on_withTextListWidget_itemClicked(QListWidgetItem * item);
+ void on_withoutTextListWidget_itemClicked(QListWidgetItem * item);
+
+ void on_fullImageButton_toggled(bool b);
+ void on_textBoxesButton_toggled(bool);
+ void on_textMaskButton_toggled(bool);
+ void on_textOnlyButton_toggled(bool);
+
+ void on_tabWidget_currentChanged(int index);
+ void on_actionScan_directory_triggered();
+ void init_and_start_process(const QString& dirname, bool bgfg);
+ void cancel_clicked(bool);
+
+ void remove_image(bool);
+
+ signals:
+ void process_finished();
+
+ private: // Members
+ void keyPressEvent(QKeyEvent* event);
+ void resizeEvent(QResizeEvent* event);
+
+ QString output_file(const QString& basename);
+ QString textBoxes_file(const QString& basename);
+ QString textMask_file(const QString& basename);
+
+ void display_image(const QString& filename);
+ void start_process();
+ void next_process();
+
+ void connect_process();
+
+ private: // Attributes
+ QString output_dir_;
+ QDir dir_;
+ QString text_in_photo_ppm_;
+ QProcess process_;
+ bool bgfg_;
+
+ QFileInfoList file_list_;
+ int current_file_;
+
+ // Status bar
+ QLabel progressLabel_;
+ QProgressBar progressBar_;
+
+ // ToolBar
+ QToolBar *toolbar_;
+ };
+
+
+ } // end of namespace mln::demo
+
+} // end of namespace mln
+
+#endif // ! MLN_DEMO_SRC_MAIN_WINDOW_HH
diff --git a/milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui b/milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui
new file mode 100644
index 0000000..cc59126
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui
@@ -0,0 +1,100 @@
+<ui version="4.0" >
+ <class>LaunchDialog</class>
+ <widget class="QDialog" name="LaunchDialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>285</width>
+ <height>165</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QLineEdit" name="pathToPics" />
+ </item>
+ <item>
+ <widget class="QPushButton" name="browseBtn" >
+ <property name="text" >
+ <string>&Browse</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Options</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="text" >
+ <string>Enable Foreground extraction (slower)</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="dialogBtnBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>dialogBtnBox</sender>
+ <signal>accepted()</signal>
+ <receiver>LaunchDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>dialogBtnBox</sender>
+ <signal>rejected()</signal>
+ <receiver>LaunchDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui b/milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui
new file mode 100644
index 0000000..0d3d925
--- /dev/null
+++ b/milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui
@@ -0,0 +1,656 @@
+<ui version="4.0" >
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>708</width>
+ <height>834</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>MainWindow</string>
+ </property>
+ <property name="dockNestingEnabled" >
+ <bool>true</bool>
+ </property>
+ <property name="dockOptions" >
+ <set>QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks</set>
+ </property>
+ <widget class="QWidget" name="centralwidget" >
+ <layout class="QVBoxLayout" name="verticalLayout_4" >
+ <item>
+ <widget class="QSplitter" name="splitter" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="autoFillBackground" >
+ <bool>false</bool>
+ </property>
+ <property name="tabShape" >
+ <enum>QTabWidget::Rounded</enum>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>With text</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" name="verticalLayout_5" >
+ <item>
+ <widget class="QListWidget" name="withTextListWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editTriggers" >
+ <set>QAbstractItemView::NoEditTriggers</set>
+ </property>
+ <property name="tabKeyNavigation" >
+ <bool>true</bool>
+ </property>
+ <property name="showDropIndicator" stdset="0" >
+ <bool>false</bool>
+ </property>
+ <property name="selectionMode" >
+ <enum>QAbstractItemView::ExtendedSelection</enum>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>150</width>
+ <height>150</height>
+ </size>
+ </property>
+ <property name="movement" >
+ <enum>QListView::Static</enum>
+ </property>
+ <property name="flow" >
+ <enum>QListView::LeftToRight</enum>
+ </property>
+ <property name="isWrapping" stdset="0" >
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode" >
+ <enum>QListView::Adjust</enum>
+ </property>
+ <property name="layoutMode" >
+ <enum>QListView::Batched</enum>
+ </property>
+ <property name="spacing" >
+ <number>10</number>
+ </property>
+ <property name="gridSize" >
+ <size>
+ <width>170</width>
+ <height>200</height>
+ </size>
+ </property>
+ <property name="viewMode" >
+ <enum>QListView::IconMode</enum>
+ </property>
+ <property name="uniformItemSizes" >
+ <bool>true</bool>
+ </property>
+ <property name="batchSize" >
+ <number>100</number>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionRectVisible" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="prevBtn" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="../gui.qrc" >
+ <normaloff>:/icons/prev.png</normaloff>:/icons/prev.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBox" >
+ <item>
+ <property name="text" >
+ <string>Page 1</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="nextBtn" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="icon" >
+ <iconset resource="../gui.qrc" >
+ <normaloff>:/icons/next.png</normaloff>:/icons/next.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Without text</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_6" >
+ <item>
+ <widget class="QListWidget" name="withoutTextListWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="layoutMode" >
+ <enum>QListView::Batched</enum>
+ </property>
+ <property name="batchSize" >
+ <number>5</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QDockWidget" name="dockWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Maximum" hsizetype="Maximum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>550</width>
+ <height>524287</height>
+ </size>
+ </property>
+ <widget class="QWidget" name="dockWidgetContents" >
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" name="verticalLayout_7" >
+ <item>
+ <spacer name="verticalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_4" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QGraphicsView" name="graphicsView" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Maximum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>350</width>
+ <height>512</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>512</width>
+ <height>512</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <property name="sizeConstraint" >
+ <enum>QLayout::SetNoConstraint</enum>
+ </property>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Maximum" hsizetype="Maximum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Annnotations</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="textEdit" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Maximum" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>200</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QPushButton" name="textOnlyButton" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>View text only</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="autoExclusive" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="fullImageButton" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>View full image</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="autoExclusive" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="textBoxesButton" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>View text boxes</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="autoExclusive" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="textMaskButton" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>View text mask</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="autoExclusive" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <spacer name="horizontalSpacer_3" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_2" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Validate</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../gui.qrc" >
+ <normaloff>:/icons/ok.png</normaloff>:/icons/ok.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <spacer name="verticalSpacer_5" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>708</width>
+ <height>31</height>
+ </rect>
+ </property>
+ <widget class="QMenu" name="menuFile" >
+ <property name="title" >
+ <string>&File</string>
+ </property>
+ <addaction name="actionScan_directory" />
+ <addaction name="separator" />
+ <addaction name="action_Quit" />
+ </widget>
+ <widget class="QMenu" name="menu_View" >
+ <property name="title" >
+ <string>&View</string>
+ </property>
+ <addaction name="actionFull_Image" />
+ <addaction name="actionText_Boxes" />
+ <addaction name="separator" />
+ <addaction name="action_Text_Only" />
+ <addaction name="actionText_Mask" />
+ </widget>
+ <addaction name="menuFile" />
+ <addaction name="menu_View" />
+ </widget>
+ <widget class="QStatusBar" name="statusbar" />
+ <action name="actionScan_directory" >
+ <property name="icon" >
+ <iconset resource="../gui.qrc" >
+ <normaloff>:/icons/photos.png</normaloff>:/icons/photos.png</iconset>
+ </property>
+ <property name="text" >
+ <string>&Scan directory...</string>
+ </property>
+ </action>
+ <action name="action_Text_Only" >
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="text" >
+ <string>&Text only</string>
+ </property>
+ </action>
+ <action name="actionFull_Image" >
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="text" >
+ <string>Full image</string>
+ </property>
+ </action>
+ <action name="actionText_Boxes" >
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="text" >
+ <string>Text boxes</string>
+ </property>
+ </action>
+ <action name="actionText_Mask" >
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="text" >
+ <string>Text mask</string>
+ </property>
+ </action>
+ <action name="action_Quit" >
+ <property name="text" >
+ <string>&Quit</string>
+ </property>
+ </action>
+ </widget>
+ <resources>
+ <include location="../gui.qrc" />
+ </resources>
+ <connections>
+ <connection>
+ <sender>action_Quit</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>close()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>353</x>
+ <y>335</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionFull_Image</sender>
+ <signal>activated()</signal>
+ <receiver>fullImageButton</receiver>
+ <slot>toggle()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>634</x>
+ <y>492</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>action_Text_Only</sender>
+ <signal>activated()</signal>
+ <receiver>textOnlyButton</receiver>
+ <slot>toggle()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>634</x>
+ <y>457</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionText_Boxes</sender>
+ <signal>activated()</signal>
+ <receiver>textBoxesButton</receiver>
+ <slot>toggle()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>634</x>
+ <y>527</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>actionText_Mask</sender>
+ <signal>activated()</signal>
+ <receiver>textMaskButton</receiver>
+ <slot>toggle()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>-1</x>
+ <y>-1</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>634</x>
+ <y>562</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
--
1.5.6.5
1
0

03 Jun '10
* demo/wizard/src/crop_widget.cc,
* demo/wizard/src/main.cc,
* demo/wizard/src/main_window.cc,
* demo/wizard/src/main_window.hh,
* demo/wizard/src/preprocessing_widget.cc,
* demo/wizard/src/process_page.cc,
* demo/wizard/src/result_page.cc,
* demo/wizard/src/result_page.hh,
* demo/wizard/src/result_widget.cc,
* demo/wizard/src/result_widget.hh,
* demo/wizard/src/runner.cc,
* demo/wizard/ui/preprocessing_widget.ui,
* demo/wizard/wizard.pro: Add support for text recognition and
display results.
---
scribo/ChangeLog | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 3e28f42..a36b5e1 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,24 @@
2010-03-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Improve dematerialization wizard.
+
+ * demo/wizard/src/crop_widget.cc,
+ * demo/wizard/src/main.cc,
+ * demo/wizard/src/main_window.cc,
+ * demo/wizard/src/main_window.hh,
+ * demo/wizard/src/preprocessing_widget.cc,
+ * demo/wizard/src/process_page.cc,
+ * demo/wizard/src/result_page.cc,
+ * demo/wizard/src/result_page.hh,
+ * demo/wizard/src/result_widget.cc,
+ * demo/wizard/src/result_widget.hh,
+ * demo/wizard/src/runner.cc,
+ * demo/wizard/ui/preprocessing_widget.ui,
+ * demo/wizard/wizard.pro: Add support for text recognition and
+ display results.
+
+2010-03-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add a new demo in Scribo.
* demo/demat/demat.pro,
--
1.5.6.5
1
0
* demo/demat/demat.pro,
* demo/demat/demat.qrc,
* demo/demat/src/doc_type.hh,
* demo/demat/src/main.cc,
* demo/demat/src/main_window.cc,
* demo/demat/src/main_window.hh,
* demo/demat/src/mln_widgets.cc,
* demo/demat/src/preprocessing_task.hh,
* demo/demat/src/process_args.hh,
* demo/demat/src/runner.cc,
* demo/demat/src/runner.hh,
* demo/demat/ui/main_window.ui: New.
* demo/shared/src/crop_item.cc,
* demo/shared/src/crop_item.hh,
* demo/shared/src/image_viewer.cc,
* demo/shared/src/image_viewer.hh,
* demo/shared/ui/image_viewer.ui: Update according the needs of
this new demo.
---
scribo/ChangeLog | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 5dc9919..3e28f42 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,27 @@
+2010-03-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add a new demo in Scribo.
+
+ * demo/demat/demat.pro,
+ * demo/demat/demat.qrc,
+ * demo/demat/src/doc_type.hh,
+ * demo/demat/src/main.cc,
+ * demo/demat/src/main_window.cc,
+ * demo/demat/src/main_window.hh,
+ * demo/demat/src/mln_widgets.cc,
+ * demo/demat/src/preprocessing_task.hh,
+ * demo/demat/src/process_args.hh,
+ * demo/demat/src/runner.cc,
+ * demo/demat/src/runner.hh,
+ * demo/demat/ui/main_window.ui: New.
+
+ * demo/shared/src/crop_item.cc,
+ * demo/shared/src/crop_item.hh,
+ * demo/shared/src/image_viewer.cc,
+ * demo/shared/src/image_viewer.hh,
+ * demo/shared/ui/image_viewer.ui: Update according the needs of
+ this new demo.
+
2010-04-13 Guillaume Lazzara <z(a)lrde.epita.fr>
* io/xml/save_text_lines.hh: Fix XML output.
--
1.5.6.5
1
0