LRE
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
Download
Olena-patches
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
olena-patches@lrde.epita.fr
9625 discussions
Start a n
N
ew thread
last-svn-commit-797-g0135714 Rename document serializer base class.
by Guillaume Lazzara
* scribo/core/internal/doc_xml_serializer.hh: Rename as... * scribo/core/internal/doc_serializer.hh: ... this. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. --- scribo/ChangeLog | 11 +++++++++ .../{doc_xml_serializer.hh => doc_serializer.hh} | 24 ++++++++++---------- .../io/xml/internal/extended_page_xml_visitor.hh | 3 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 4 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 4 +- 5 files changed, 29 insertions(+), 17 deletions(-) rename scribo/scribo/core/internal/{doc_xml_serializer.hh => doc_serializer.hh} (80%) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 33b036a..1de58fe 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,16 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename document serializer base class. + + * scribo/core/internal/doc_xml_serializer.hh: Rename as... + * scribo/core/internal/doc_serializer.hh: ... this. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. * scribo/core/document.hh: Make a distinction between horizontal diff --git a/scribo/scribo/core/internal/doc_xml_serializer.hh b/scribo/scribo/core/internal/doc_serializer.hh similarity index 80% rename from scribo/scribo/core/internal/doc_xml_serializer.hh rename to scribo/scribo/core/internal/doc_serializer.hh index b64c9d4..2655100 100644 --- a/scribo/scribo/core/internal/doc_xml_serializer.hh +++ b/scribo/scribo/core/internal/doc_serializer.hh @@ -23,8 +23,8 @@ // 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_DOC_XML_SERIALIZER_HH -# define SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#ifndef SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH +# define SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH /// \file /// @@ -46,7 +46,7 @@ namespace scribo /// \brief Link functor concept. template <typename E> - class doc_xml_serializer : public SerializeVisitor<E> + class doc_serializer : public SerializeVisitor<E> { public: // Visit overloads @@ -80,55 +80,55 @@ namespace scribo template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const document<L>& doc) const + doc_serializer<E>::visit(const document<L>& doc) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_links<L>& llinks) const + doc_serializer<E>::visit(const line_links<L>& llinks) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_groups<L>& groups) const + doc_serializer<E>::visit(const object_groups<L>& groups) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_links<L>& links) const + doc_serializer<E>::visit(const object_links<L>& links) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const component_set<L>& comp_set) const + doc_serializer<E>::visit(const component_set<L>& comp_set) const { } template <typename E> void - doc_xml_serializer<E>::visit(const component_info& info) const + doc_serializer<E>::visit(const component_info& info) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const paragraph_set<L>& parset) const + doc_serializer<E>::visit(const paragraph_set<L>& parset) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_info<L>& line) const + doc_serializer<E>::visit(const line_info<L>& line) const { } @@ -137,4 +137,4 @@ namespace scribo } // end of namespace scribo -#endif // SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#endif // SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index 51e7ad3..e8c7689 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -32,6 +32,7 @@ # include <fstream> # include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -57,7 +58,7 @@ namespace scribo { - class extended_page_xml_visitor : public doc_xml_serializer<extended_page_xml_visitor> + class extended_page_xml_visitor : public doc_serializer<extended_page_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index d466b34..28f43e9 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -34,7 +34,7 @@ # include <QByteArray> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -63,7 +63,7 @@ namespace scribo { - class full_xml_visitor : public doc_xml_serializer<full_xml_visitor> + class full_xml_visitor : public doc_serializer<full_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 9dec1e7..19665d6 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -32,7 +32,7 @@ # include <fstream> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/convert/to_base64.hh> # include <scribo/io/xml/internal/print_box_coords.hh> @@ -63,7 +63,7 @@ namespace scribo
http://schema.primaresearch.org/PAGE/gts/pagecontent/2009-03-16/pagecontent…
*/ - class page_xml_visitor : public doc_xml_serializer<page_xml_visitor> + class page_xml_visitor : public doc_serializer<page_xml_visitor> { public: // Constructor -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
last-svn-commit-798-gbafdc50 Rename document serializer base class.
by Guillaume Lazzara
* scribo/core/internal/doc_xml_serializer.hh: Rename as... * scribo/core/internal/doc_serializer.hh: ... this. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. --- scribo/ChangeLog | 11 +++++++++ .../{doc_xml_serializer.hh => doc_serializer.hh} | 24 ++++++++++---------- .../io/xml/internal/extended_page_xml_visitor.hh | 3 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 4 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 4 +- 5 files changed, 29 insertions(+), 17 deletions(-) rename scribo/scribo/core/internal/{doc_xml_serializer.hh => doc_serializer.hh} (80%) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 213fa0a..f0bff06 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,16 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename document serializer base class. + + * scribo/core/internal/doc_xml_serializer.hh: Rename as... + * scribo/core/internal/doc_serializer.hh: ... this. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh: Update inheritance. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. * scribo/core/document.hh: Make a distinction between horizontal diff --git a/scribo/scribo/core/internal/doc_xml_serializer.hh b/scribo/scribo/core/internal/doc_serializer.hh similarity index 80% rename from scribo/scribo/core/internal/doc_xml_serializer.hh rename to scribo/scribo/core/internal/doc_serializer.hh index b64c9d4..2655100 100644 --- a/scribo/scribo/core/internal/doc_xml_serializer.hh +++ b/scribo/scribo/core/internal/doc_serializer.hh @@ -23,8 +23,8 @@ // 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_DOC_XML_SERIALIZER_HH -# define SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#ifndef SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH +# define SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH /// \file /// @@ -46,7 +46,7 @@ namespace scribo /// \brief Link functor concept. template <typename E> - class doc_xml_serializer : public SerializeVisitor<E> + class doc_serializer : public SerializeVisitor<E> { public: // Visit overloads @@ -80,55 +80,55 @@ namespace scribo template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const document<L>& doc) const + doc_serializer<E>::visit(const document<L>& doc) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_links<L>& llinks) const + doc_serializer<E>::visit(const line_links<L>& llinks) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_groups<L>& groups) const + doc_serializer<E>::visit(const object_groups<L>& groups) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const object_links<L>& links) const + doc_serializer<E>::visit(const object_links<L>& links) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const component_set<L>& comp_set) const + doc_serializer<E>::visit(const component_set<L>& comp_set) const { } template <typename E> void - doc_xml_serializer<E>::visit(const component_info& info) const + doc_serializer<E>::visit(const component_info& info) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const paragraph_set<L>& parset) const + doc_serializer<E>::visit(const paragraph_set<L>& parset) const { } template <typename E> template <typename L> void - doc_xml_serializer<E>::visit(const line_info<L>& line) const + doc_serializer<E>::visit(const line_info<L>& line) const { } @@ -137,4 +137,4 @@ namespace scribo } // end of namespace scribo -#endif // SCRIBO_CORE_INTERNAL_DOC_XML_SERIALIZER_HH +#endif // SCRIBO_CORE_INTERNAL_DOC_SERIALIZER_HH diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index 51e7ad3..e8c7689 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -32,6 +32,7 @@ # include <fstream> # include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -57,7 +58,7 @@ namespace scribo { - class extended_page_xml_visitor : public doc_xml_serializer<extended_page_xml_visitor> + class extended_page_xml_visitor : public doc_serializer<extended_page_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index d466b34..28f43e9 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -34,7 +34,7 @@ # include <QByteArray> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/core/document.hh> # include <scribo/core/component_set.hh> # include <scribo/core/paragraph_set.hh> @@ -63,7 +63,7 @@ namespace scribo { - class full_xml_visitor : public doc_xml_serializer<full_xml_visitor> + class full_xml_visitor : public doc_serializer<full_xml_visitor> { public: // Constructor diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 9dec1e7..19665d6 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -32,7 +32,7 @@ # include <fstream> -# include <scribo/core/internal/doc_xml_serializer.hh> +# include <scribo/core/internal/doc_serializer.hh> # include <scribo/convert/to_base64.hh> # include <scribo/io/xml/internal/print_box_coords.hh> @@ -63,7 +63,7 @@ namespace scribo
http://schema.primaresearch.org/PAGE/gts/pagecontent/2009-03-16/pagecontent…
*/ - class page_xml_visitor : public doc_xml_serializer<page_xml_visitor> + class page_xml_visitor : public doc_serializer<page_xml_visitor> { public: // Constructor -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
last-svn-commit-796-g9721b83 Store more information in scribo::document.
by Guillaume Lazzara
* scribo/core/document.hh: Make a distinction between horizontal and vertical lines. Store the binary image. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh, * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of that new methods and information. --- scribo/ChangeLog | 13 ++ scribo/scribo/core/document.hh | 137 ++++++++++++++----- .../io/xml/internal/extended_page_xml_visitor.hh | 6 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 14 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 6 +- .../toolchain/internal/content_in_doc_functor.hh | 20 +++- 6 files changed, 145 insertions(+), 51 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 1928592..33b036a 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,18 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. + + * scribo/core/document.hh: Make a distinction between horizontal + and vertical lines. Store the binary image. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh, + * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of + that new methods and information. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename line_info::components() to line_info::component_ids. * scribo/core/line_info.hh: Here. diff --git a/scribo/scribo/core/document.hh b/scribo/scribo/core/document.hh index 689d0e3..f38b20b 100644 --- a/scribo/scribo/core/document.hh +++ b/scribo/scribo/core/document.hh @@ -85,23 +85,34 @@ namespace scribo const component_set<L>& elements() const; void set_elements(const component_set<L>& elements); - const mln::image2d<value::rgb8>& image() const; - void set_image(const mln::image2d<value::rgb8>& image); - bool has_whitespace_seps() const; const mln::image2d<bool>& whitespace_seps() const; const component_set<L>& whitespace_seps_comps() const; void set_whitespace_separators(const image2d<bool>& whitespace_seps); - bool has_line_seps() const; - const mln::image2d<bool>& line_seps() const; - const component_set<L>& line_seps_comps() const; - void set_line_separators(const image2d<bool>& line_seps); + // Horizontal separators + bool has_hline_seps() const; + const mln::image2d<bool>& hline_seps() const; + const component_set<L>& hline_seps_comps() const; + void set_hline_separators(const image2d<bool>& line_seps); + + // Vertical separators + bool has_vline_seps() const; + const mln::image2d<bool>& vline_seps() const; + const component_set<L>& vline_seps_comps() const; + void set_vline_separators(const image2d<bool>& line_seps); + + const mln::image2d<value::rgb8>& image() const; + void set_image(const mln::image2d<value::rgb8>& image); + + const mln::image2d<bool>& binary_image() const; + void set_binary_image(const mln::image2d<bool>& binary_image); private: std::string filename_; mln::image2d<mln::value::rgb8> image_; + mln::image2d<bool> binary_image_; paragraph_set<L> parset_; component_set<L> elements_; @@ -109,8 +120,11 @@ namespace scribo mln::image2d<bool> whitespace_seps_; component_set<L> whitespace_seps_comps_; - mln::image2d<bool> line_seps_; - component_set<L> line_seps_comps_; + mln::image2d<bool> hline_seps_; + component_set<L> hline_seps_comps_; + + mln::image2d<bool> vline_seps_; + component_set<L> vline_seps_comps_; }; @@ -251,97 +265,148 @@ namespace scribo elements_ = elements; } + template <typename L> + bool + document<L>::has_whitespace_seps() const + { + return whitespace_seps_.is_valid(); + } + template <typename L> - const mln::image2d<value::rgb8>& - document<L>::image() const + const mln::image2d<bool>& + document<L>::whitespace_seps() const { - return image_; + return whitespace_seps_; + } + + + template <typename L> + const component_set<L>& + document<L>::whitespace_seps_comps() const + { + return whitespace_seps_comps_; } template <typename L> void - document<L>::set_image(const mln::image2d<value::rgb8>& image) + document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) { - image_ = image; + whitespace_seps_ = whitespace_seps; + + mln_value(L) ncomps; + whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, + mln::c8(), ncomps, + component::WhitespaceSeparator); } template <typename L> bool - document<L>::has_whitespace_seps() const + document<L>::has_hline_seps() const { - return whitespace_seps_.is_valid(); + return hline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::whitespace_seps() const + document<L>::hline_seps() const { - return whitespace_seps_; + return hline_seps_; } template <typename L> const component_set<L>& - document<L>::whitespace_seps_comps() const + document<L>::hline_seps_comps() const { - return whitespace_seps_comps_; + return hline_seps_comps_; } template <typename L> void - document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) + document<L>::set_hline_separators(const image2d<bool>& hline_seps) { - whitespace_seps_ = whitespace_seps; + hline_seps_ = hline_seps; mln_value(L) ncomps; - whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, - mln::c8(), ncomps, - component::WhitespaceSeparator); + hline_seps_comps_ = primitive::extract::components(hline_seps, + mln::c8(), ncomps, + component::LineSeparator); } template <typename L> bool - document<L>::has_line_seps() const + document<L>::has_vline_seps() const { - return line_seps_.is_valid(); + return vline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::line_seps() const + document<L>::vline_seps() const { - return line_seps_; + return vline_seps_; } template <typename L> const component_set<L>& - document<L>::line_seps_comps() const + document<L>::vline_seps_comps() const { - return line_seps_comps_; + return vline_seps_comps_; } template <typename L> void - document<L>::set_line_separators(const image2d<bool>& line_seps) + document<L>::set_vline_separators(const image2d<bool>& vline_seps) { - line_seps_ = line_seps; + vline_seps_ = vline_seps; mln_value(L) ncomps; - line_seps_comps_ = primitive::extract::components(line_seps, - mln::c8(), ncomps, - component::LineSeparator); + vline_seps_comps_ = primitive::extract::components(vline_seps, + mln::c8(), ncomps, + component::LineSeparator); + } + + + template <typename L> + const mln::image2d<value::rgb8>& + document<L>::image() const + { + return image_; } + template <typename L> + void + document<L>::set_image(const mln::image2d<value::rgb8>& image) + { + image_ = image; + } + + + template <typename L> + const mln::image2d<bool>& + document<L>::binary_image() const + { + return binary_image_; + } + + + template <typename L> + void + document<L>::set_binary_image(const mln::image2d<bool>& binary_image) + { + binary_image_ = binary_image; + } + # endif // ! MLN_INCLUDE_ONLY diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index f573d88..51e7ad3 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -114,8 +114,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); // Whitespace seraparators if (doc.has_whitespace_seps()) diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 701c1b7..d466b34 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -164,14 +164,12 @@ namespace scribo // line seraparators - if (doc.has_line_seps()) - { - const component_set<L>& - line_seps_comps = doc.line_seps_comps(); - - for_all_comps(c, line_seps_comps) - line_seps_comps(c).accept(*this); - } + if (doc.has_hline_seps()) + for_all_comps(c, doc.hline_seps_comps()) + doc.hline_seps_comps()(c).accept(*this); + if (doc.has_vline_seps()) + for_all_comps(c, doc.vline_seps_comps()) + doc.vline_seps_comps()(c).accept(*this); // Whitespace seraparators diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 52d8f12..9dec1e7 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -116,8 +116,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); output << " </page>" << std::endl; output << "</pcGts>" << std::endl; diff --git a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh index 40f013c..3e6668f 100644 --- a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh +++ b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh @@ -162,6 +162,7 @@ namespace scribo mln_precondition(exact(processed_image).is_valid()); doc.set_image(exact(original_image)); + doc.set_binary_image(exact(processed_image)); // Remove separators mln_ch_value(I,bool) @@ -169,17 +170,30 @@ namespace scribo input_cleaned = exact(processed_image); if (enable_line_seps) { + // FIXME: SLOW on_new_progress_label("Find vertical and horizontal separators..."); // Vertical and horizontal separators - separators = primitive::extract::separators(processed_image, 81); + { + mln_ch_value(I,bool) + vseparators = primitive::extract::vertical_separators(processed_image, 81), + hseparators = primitive::extract::horizontal_separators(processed_image, 81); + + doc.set_vline_separators(vseparators); + doc.set_hline_separators(hseparators); + + separators = vseparators; + separators += hseparators; + + border::resize(processed_image, border::thickness); + } on_progress(); on_new_progress_label("Remove separators..."); - input_cleaned = primitive::remove::separators(processed_image, separators); - doc.set_line_separators(separators); + input_cleaned = primitive::remove::separators(processed_image, + separators); on_progress(); } -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
last-svn-commit-796-g20da74d Store more information in scribo::document.
by Guillaume Lazzara
* scribo/core/document.hh: Make a distinction between horizontal and vertical lines. Store the binary image. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh, * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of that new methods and information. --- scribo/ChangeLog | 13 ++ scribo/scribo/core/document.hh | 137 ++++++++++++++----- .../io/xml/internal/extended_page_xml_visitor.hh | 6 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 14 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 6 +- .../toolchain/internal/content_in_doc_functor.hh | 20 +++- 6 files changed, 145 insertions(+), 51 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 1928592..33b036a 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,18 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. + + * scribo/core/document.hh: Make a distinction between horizontal + and vertical lines. Store the binary image. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh, + * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of + that new methods and information. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename line_info::components() to line_info::component_ids. * scribo/core/line_info.hh: Here. diff --git a/scribo/scribo/core/document.hh b/scribo/scribo/core/document.hh index 689d0e3..f38b20b 100644 --- a/scribo/scribo/core/document.hh +++ b/scribo/scribo/core/document.hh @@ -85,23 +85,34 @@ namespace scribo const component_set<L>& elements() const; void set_elements(const component_set<L>& elements); - const mln::image2d<value::rgb8>& image() const; - void set_image(const mln::image2d<value::rgb8>& image); - bool has_whitespace_seps() const; const mln::image2d<bool>& whitespace_seps() const; const component_set<L>& whitespace_seps_comps() const; void set_whitespace_separators(const image2d<bool>& whitespace_seps); - bool has_line_seps() const; - const mln::image2d<bool>& line_seps() const; - const component_set<L>& line_seps_comps() const; - void set_line_separators(const image2d<bool>& line_seps); + // Horizontal separators + bool has_hline_seps() const; + const mln::image2d<bool>& hline_seps() const; + const component_set<L>& hline_seps_comps() const; + void set_hline_separators(const image2d<bool>& line_seps); + + // Vertical separators + bool has_vline_seps() const; + const mln::image2d<bool>& vline_seps() const; + const component_set<L>& vline_seps_comps() const; + void set_vline_separators(const image2d<bool>& line_seps); + + const mln::image2d<value::rgb8>& image() const; + void set_image(const mln::image2d<value::rgb8>& image); + + const mln::image2d<bool>& binary_image() const; + void set_binary_image(const mln::image2d<bool>& binary_image); private: std::string filename_; mln::image2d<mln::value::rgb8> image_; + mln::image2d<bool> binary_image_; paragraph_set<L> parset_; component_set<L> elements_; @@ -109,8 +120,11 @@ namespace scribo mln::image2d<bool> whitespace_seps_; component_set<L> whitespace_seps_comps_; - mln::image2d<bool> line_seps_; - component_set<L> line_seps_comps_; + mln::image2d<bool> hline_seps_; + component_set<L> hline_seps_comps_; + + mln::image2d<bool> vline_seps_; + component_set<L> vline_seps_comps_; }; @@ -251,97 +265,148 @@ namespace scribo elements_ = elements; } + template <typename L> + bool + document<L>::has_whitespace_seps() const + { + return whitespace_seps_.is_valid(); + } + template <typename L> - const mln::image2d<value::rgb8>& - document<L>::image() const + const mln::image2d<bool>& + document<L>::whitespace_seps() const { - return image_; + return whitespace_seps_; + } + + + template <typename L> + const component_set<L>& + document<L>::whitespace_seps_comps() const + { + return whitespace_seps_comps_; } template <typename L> void - document<L>::set_image(const mln::image2d<value::rgb8>& image) + document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) { - image_ = image; + whitespace_seps_ = whitespace_seps; + + mln_value(L) ncomps; + whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, + mln::c8(), ncomps, + component::WhitespaceSeparator); } template <typename L> bool - document<L>::has_whitespace_seps() const + document<L>::has_hline_seps() const { - return whitespace_seps_.is_valid(); + return hline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::whitespace_seps() const + document<L>::hline_seps() const { - return whitespace_seps_; + return hline_seps_; } template <typename L> const component_set<L>& - document<L>::whitespace_seps_comps() const + document<L>::hline_seps_comps() const { - return whitespace_seps_comps_; + return hline_seps_comps_; } template <typename L> void - document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) + document<L>::set_hline_separators(const image2d<bool>& hline_seps) { - whitespace_seps_ = whitespace_seps; + hline_seps_ = hline_seps; mln_value(L) ncomps; - whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, - mln::c8(), ncomps, - component::WhitespaceSeparator); + hline_seps_comps_ = primitive::extract::components(hline_seps, + mln::c8(), ncomps, + component::LineSeparator); } template <typename L> bool - document<L>::has_line_seps() const + document<L>::has_vline_seps() const { - return line_seps_.is_valid(); + return vline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::line_seps() const + document<L>::vline_seps() const { - return line_seps_; + return vline_seps_; } template <typename L> const component_set<L>& - document<L>::line_seps_comps() const + document<L>::vline_seps_comps() const { - return line_seps_comps_; + return vline_seps_comps_; } template <typename L> void - document<L>::set_line_separators(const image2d<bool>& line_seps) + document<L>::set_vline_separators(const image2d<bool>& vline_seps) { - line_seps_ = line_seps; + vline_seps_ = vline_seps; mln_value(L) ncomps; - line_seps_comps_ = primitive::extract::components(line_seps, - mln::c8(), ncomps, - component::LineSeparator); + vline_seps_comps_ = primitive::extract::components(vline_seps, + mln::c8(), ncomps, + component::LineSeparator); + } + + + template <typename L> + const mln::image2d<value::rgb8>& + document<L>::image() const + { + return image_; } + template <typename L> + void + document<L>::set_image(const mln::image2d<value::rgb8>& image) + { + image_ = image; + } + + + template <typename L> + const mln::image2d<bool>& + document<L>::binary_image() const + { + return binary_image_; + } + + + template <typename L> + void + document<L>::set_binary_image(const mln::image2d<bool>& binary_image) + { + binary_image_ = binary_image; + } + # endif // ! MLN_INCLUDE_ONLY diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index f573d88..51e7ad3 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -114,8 +114,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); // Whitespace seraparators if (doc.has_whitespace_seps()) diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 701c1b7..d466b34 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -164,14 +164,12 @@ namespace scribo // line seraparators - if (doc.has_line_seps()) - { - const component_set<L>& - line_seps_comps = doc.line_seps_comps(); - - for_all_comps(c, line_seps_comps) - line_seps_comps(c).accept(*this); - } + if (doc.has_hline_seps()) + for_all_comps(c, doc.hline_seps_comps()) + doc.hline_seps_comps()(c).accept(*this); + if (doc.has_vline_seps()) + for_all_comps(c, doc.vline_seps_comps()) + doc.vline_seps_comps()(c).accept(*this); // Whitespace seraparators diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 52d8f12..9dec1e7 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -116,8 +116,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); output << " </page>" << std::endl; output << "</pcGts>" << std::endl; diff --git a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh index 40f013c..3e6668f 100644 --- a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh +++ b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh @@ -162,6 +162,7 @@ namespace scribo mln_precondition(exact(processed_image).is_valid()); doc.set_image(exact(original_image)); + doc.set_binary_image(exact(processed_image)); // Remove separators mln_ch_value(I,bool) @@ -169,17 +170,30 @@ namespace scribo input_cleaned = exact(processed_image); if (enable_line_seps) { + // FIXME: SLOW on_new_progress_label("Find vertical and horizontal separators..."); // Vertical and horizontal separators - separators = primitive::extract::separators(processed_image, 81); + { + mln_ch_value(I,bool) + vseparators = primitive::extract::vertical_separators(processed_image, 81), + hseparators = primitive::extract::horizontal_separators(processed_image, 81); + + doc.set_vline_separators(vseparators); + doc.set_hline_separators(hseparators); + + separators = vseparators; + separators += hseparators; + + border::resize(processed_image, border::thickness); + } on_progress(); on_new_progress_label("Remove separators..."); - input_cleaned = primitive::remove::separators(processed_image, separators); - doc.set_line_separators(separators); + input_cleaned = primitive::remove::separators(processed_image, + separators); on_progress(); } -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
last-svn-commit-797-gfffcde7 Store more information in scribo::document.
by Guillaume Lazzara
* scribo/core/document.hh: Make a distinction between horizontal and vertical lines. Store the binary image. * scribo/io/xml/internal/extended_page_xml_visitor.hh, * scribo/io/xml/internal/full_xml_visitor.hh, * scribo/io/xml/internal/page_xml_visitor.hh, * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of that new methods and information. --- scribo/ChangeLog | 13 ++ scribo/scribo/core/document.hh | 137 ++++++++++++++----- .../io/xml/internal/extended_page_xml_visitor.hh | 6 +- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 14 +- scribo/scribo/io/xml/internal/page_xml_visitor.hh | 6 +- .../toolchain/internal/content_in_doc_functor.hh | 20 +++- 6 files changed, 145 insertions(+), 51 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 52e3125..213fa0a 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,18 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Store more information in scribo::document. + + * scribo/core/document.hh: Make a distinction between horizontal + and vertical lines. Store the binary image. + + * scribo/io/xml/internal/extended_page_xml_visitor.hh, + * scribo/io/xml/internal/full_xml_visitor.hh, + * scribo/io/xml/internal/page_xml_visitor.hh, + * scribo/toolchain/internal/content_in_doc_functor.hh: Make use of + that new methods and information. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + Rename line_info::components() to line_info::component_ids. * scribo/core/line_info.hh: Here. diff --git a/scribo/scribo/core/document.hh b/scribo/scribo/core/document.hh index 689d0e3..f38b20b 100644 --- a/scribo/scribo/core/document.hh +++ b/scribo/scribo/core/document.hh @@ -85,23 +85,34 @@ namespace scribo const component_set<L>& elements() const; void set_elements(const component_set<L>& elements); - const mln::image2d<value::rgb8>& image() const; - void set_image(const mln::image2d<value::rgb8>& image); - bool has_whitespace_seps() const; const mln::image2d<bool>& whitespace_seps() const; const component_set<L>& whitespace_seps_comps() const; void set_whitespace_separators(const image2d<bool>& whitespace_seps); - bool has_line_seps() const; - const mln::image2d<bool>& line_seps() const; - const component_set<L>& line_seps_comps() const; - void set_line_separators(const image2d<bool>& line_seps); + // Horizontal separators + bool has_hline_seps() const; + const mln::image2d<bool>& hline_seps() const; + const component_set<L>& hline_seps_comps() const; + void set_hline_separators(const image2d<bool>& line_seps); + + // Vertical separators + bool has_vline_seps() const; + const mln::image2d<bool>& vline_seps() const; + const component_set<L>& vline_seps_comps() const; + void set_vline_separators(const image2d<bool>& line_seps); + + const mln::image2d<value::rgb8>& image() const; + void set_image(const mln::image2d<value::rgb8>& image); + + const mln::image2d<bool>& binary_image() const; + void set_binary_image(const mln::image2d<bool>& binary_image); private: std::string filename_; mln::image2d<mln::value::rgb8> image_; + mln::image2d<bool> binary_image_; paragraph_set<L> parset_; component_set<L> elements_; @@ -109,8 +120,11 @@ namespace scribo mln::image2d<bool> whitespace_seps_; component_set<L> whitespace_seps_comps_; - mln::image2d<bool> line_seps_; - component_set<L> line_seps_comps_; + mln::image2d<bool> hline_seps_; + component_set<L> hline_seps_comps_; + + mln::image2d<bool> vline_seps_; + component_set<L> vline_seps_comps_; }; @@ -251,97 +265,148 @@ namespace scribo elements_ = elements; } + template <typename L> + bool + document<L>::has_whitespace_seps() const + { + return whitespace_seps_.is_valid(); + } + template <typename L> - const mln::image2d<value::rgb8>& - document<L>::image() const + const mln::image2d<bool>& + document<L>::whitespace_seps() const { - return image_; + return whitespace_seps_; + } + + + template <typename L> + const component_set<L>& + document<L>::whitespace_seps_comps() const + { + return whitespace_seps_comps_; } template <typename L> void - document<L>::set_image(const mln::image2d<value::rgb8>& image) + document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) { - image_ = image; + whitespace_seps_ = whitespace_seps; + + mln_value(L) ncomps; + whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, + mln::c8(), ncomps, + component::WhitespaceSeparator); } template <typename L> bool - document<L>::has_whitespace_seps() const + document<L>::has_hline_seps() const { - return whitespace_seps_.is_valid(); + return hline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::whitespace_seps() const + document<L>::hline_seps() const { - return whitespace_seps_; + return hline_seps_; } template <typename L> const component_set<L>& - document<L>::whitespace_seps_comps() const + document<L>::hline_seps_comps() const { - return whitespace_seps_comps_; + return hline_seps_comps_; } template <typename L> void - document<L>::set_whitespace_separators(const image2d<bool>& whitespace_seps) + document<L>::set_hline_separators(const image2d<bool>& hline_seps) { - whitespace_seps_ = whitespace_seps; + hline_seps_ = hline_seps; mln_value(L) ncomps; - whitespace_seps_comps_ = primitive::extract::components(whitespace_seps, - mln::c8(), ncomps, - component::WhitespaceSeparator); + hline_seps_comps_ = primitive::extract::components(hline_seps, + mln::c8(), ncomps, + component::LineSeparator); } template <typename L> bool - document<L>::has_line_seps() const + document<L>::has_vline_seps() const { - return line_seps_.is_valid(); + return vline_seps_.is_valid(); } template <typename L> const mln::image2d<bool>& - document<L>::line_seps() const + document<L>::vline_seps() const { - return line_seps_; + return vline_seps_; } template <typename L> const component_set<L>& - document<L>::line_seps_comps() const + document<L>::vline_seps_comps() const { - return line_seps_comps_; + return vline_seps_comps_; } template <typename L> void - document<L>::set_line_separators(const image2d<bool>& line_seps) + document<L>::set_vline_separators(const image2d<bool>& vline_seps) { - line_seps_ = line_seps; + vline_seps_ = vline_seps; mln_value(L) ncomps; - line_seps_comps_ = primitive::extract::components(line_seps, - mln::c8(), ncomps, - component::LineSeparator); + vline_seps_comps_ = primitive::extract::components(vline_seps, + mln::c8(), ncomps, + component::LineSeparator); + } + + + template <typename L> + const mln::image2d<value::rgb8>& + document<L>::image() const + { + return image_; } + template <typename L> + void + document<L>::set_image(const mln::image2d<value::rgb8>& image) + { + image_ = image; + } + + + template <typename L> + const mln::image2d<bool>& + document<L>::binary_image() const + { + return binary_image_; + } + + + template <typename L> + void + document<L>::set_binary_image(const mln::image2d<bool>& binary_image) + { + binary_image_ = binary_image; + } + # endif // ! MLN_INCLUDE_ONLY diff --git a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh index f573d88..51e7ad3 100644 --- a/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/extended_page_xml_visitor.hh @@ -114,8 +114,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); // Whitespace seraparators if (doc.has_whitespace_seps()) diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 701c1b7..d466b34 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -164,14 +164,12 @@ namespace scribo // line seraparators - if (doc.has_line_seps()) - { - const component_set<L>& - line_seps_comps = doc.line_seps_comps(); - - for_all_comps(c, line_seps_comps) - line_seps_comps(c).accept(*this); - } + if (doc.has_hline_seps()) + for_all_comps(c, doc.hline_seps_comps()) + doc.hline_seps_comps()(c).accept(*this); + if (doc.has_vline_seps()) + for_all_comps(c, doc.vline_seps_comps()) + doc.vline_seps_comps()(c).accept(*this); // Whitespace seraparators diff --git a/scribo/scribo/io/xml/internal/page_xml_visitor.hh b/scribo/scribo/io/xml/internal/page_xml_visitor.hh index 52d8f12..9dec1e7 100644 --- a/scribo/scribo/io/xml/internal/page_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/page_xml_visitor.hh @@ -116,8 +116,10 @@ namespace scribo doc.elements().accept(*this); // line seraparators - if (doc.has_line_seps()) - doc.line_seps_comps().accept(*this); + if (doc.has_vline_seps()) + doc.vline_seps_comps().accept(*this); + if (doc.has_hline_seps()) + doc.hline_seps_comps().accept(*this); output << " </page>" << std::endl; output << "</pcGts>" << std::endl; diff --git a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh index 40f013c..3e6668f 100644 --- a/scribo/scribo/toolchain/internal/content_in_doc_functor.hh +++ b/scribo/scribo/toolchain/internal/content_in_doc_functor.hh @@ -162,6 +162,7 @@ namespace scribo mln_precondition(exact(processed_image).is_valid()); doc.set_image(exact(original_image)); + doc.set_binary_image(exact(processed_image)); // Remove separators mln_ch_value(I,bool) @@ -169,17 +170,30 @@ namespace scribo input_cleaned = exact(processed_image); if (enable_line_seps) { + // FIXME: SLOW on_new_progress_label("Find vertical and horizontal separators..."); // Vertical and horizontal separators - separators = primitive::extract::separators(processed_image, 81); + { + mln_ch_value(I,bool) + vseparators = primitive::extract::vertical_separators(processed_image, 81), + hseparators = primitive::extract::horizontal_separators(processed_image, 81); + + doc.set_vline_separators(vseparators); + doc.set_hline_separators(hseparators); + + separators = vseparators; + separators += hseparators; + + border::resize(processed_image, border::thickness); + } on_progress(); on_new_progress_label("Remove separators..."); - input_cleaned = primitive::remove::separators(processed_image, separators); - doc.set_line_separators(separators); + input_cleaned = primitive::remove::separators(processed_image, + separators); on_progress(); } -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
last-svn-commit-795-g2cd9b01 Rename line_info::components() to line_info::component_ids.
by Guillaume Lazzara
* scribo/core/line_info.hh: Here. * scribo/debug/char_space_image.hh, * scribo/text/recognition.hh, * src/debug/show_text_lines.cc, * scribo/io/xml/internal/full_xml_visitor.hh: Update calls to that method. --- scribo/ChangeLog | 22 ++++++++++++++++++++- scribo/scribo/core/line_info.hh | 8 +++--- scribo/scribo/debug/char_space_image.hh | 8 +++--- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 4 +- scribo/scribo/text/recognition.hh | 4 +- scribo/src/debug/show_text_lines.cc | 2 +- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 439db69..1928592 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,12 +1,32 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> - Rename debug routines. + Rename line_info::components() to line_info::component_ids. + + * scribo/core/line_info.hh: Here. + + * scribo/debug/char_space_image.hh, + * scribo/text/recognition.hh, + * src/debug/show_text_lines.cc, + * scribo/io/xml/internal/full_xml_visitor.hh: Update calls to that + method. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + + Some changes in debug routines. * scribo/debug/save_bboxes_image.hh, * scribo/debug/save_linked_bboxes_image.hh: Rename as... * scribo/debug/bboxes_image.hh, * scribo/debug/linked_bboxes_image.hh: ... this. + * scribo/debug/links_image.hh: New. + + * scribo/debug/several_links_decision_image.hh: + Remove. Deprecated. + + * scribo/debug/alignment_decision_image.hh: Make use of + compute_anchor routine. + * scribo/debug/all.hh, * scribo/table/extract.hh, * scribo/toolchain/text_in_picture.hh, diff --git a/scribo/scribo/core/line_info.hh b/scribo/scribo/core/line_info.hh index 46ba720..4def6fe 100644 --- a/scribo/scribo/core/line_info.hh +++ b/scribo/scribo/core/line_info.hh @@ -172,7 +172,7 @@ namespace scribo // const mln::box2d& ebbox() const; - const mln::util::array<component_id_t>& components() const; + const mln::util::array<component_id_t>& component_ids() const; unsigned card() const; int baseline() const; @@ -481,7 +481,7 @@ namespace scribo template <typename L> const mln::util::array<typename line_info<L>::component_id_t>& - line_info<L>::components() const + line_info<L>::component_ids() const { return data_->components_; } @@ -856,7 +856,7 @@ namespace scribo // Update bbox and ebbox update_bbox_and_ebox(other); - data_->components_.append(other.components()); + data_->components_.append(other.component_ids()); } @@ -1023,7 +1023,7 @@ namespace scribo << ", type=" << info.type() << ", bbox=" << info.bbox() << ", ebbox=" << info.ebbox() - << ", components=" << info.components() + << ", components=" << info.component_ids() << ", baseline=" << info.baseline() << ", meanline=" << info.meanline() << ", ascent=" << info.ascent() diff --git a/scribo/scribo/debug/char_space_image.hh b/scribo/scribo/debug/char_space_image.hh index 6dc6f8f..53fc303 100644 --- a/scribo/scribo/debug/char_space_image.hh +++ b/scribo/scribo/debug/char_space_image.hh @@ -76,16 +76,16 @@ namespace scribo for_all_lines(l, line) { if (! line(l).is_valid() || line(l).is_hidden() - || line(l).components().size() < 2) + || line(l).component_ids().size() < 2) continue; - for_all_elements(i, line(l).components()) + for_all_elements(i, line(l).component_ids()) { - if (i == line(l).components().nelements() - 1) + if (i == line(l).component_ids().nelements() - 1) continue; - unsigned c = line(l).components()[i]; + unsigned c = line(l).component_ids()[i]; point2d beg = comps(c).bbox().pmax(), diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 8576c27..701c1b7 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -447,9 +447,9 @@ namespace scribo output << " <compid_list>" << std::endl; - for_all_line_comps(c, line.components()) + for_all_line_comps(c, line.component_ids()) output << " <compid value=\"" - << line.components()(c) << "\" />" << std::endl; + << line.component_ids()(c) << "\" />" << std::endl; output << " </compid_list>" << std::endl; diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh index 3a9742b..1e11a3e 100644 --- a/scribo/scribo/text/recognition.hh +++ b/scribo/scribo/text/recognition.hh @@ -144,8 +144,8 @@ namespace scribo const L& lbl = comp_set.labeled_image(); // Extract each character components to create the line image. - const mln::util::array<component_id_t>& comps = lines(i).components(); - for_all_elements(e, lines(i).components()) + const mln::util::array<component_id_t>& comps = lines(i).component_ids(); + for_all_elements(e, lines(i).component_ids()) { unsigned comp_id = comps(e); data::fill(((text_ima | comp_set(comp_id).bbox()).rw() | (pw::value(lbl) == pw::cst(comp_id))).rw(), diff --git a/scribo/src/debug/show_text_lines.cc b/scribo/src/debug/show_text_lines.cc index 368f375..d5a5c8f 100644 --- a/scribo/src/debug/show_text_lines.cc +++ b/scribo/src/debug/show_text_lines.cc @@ -110,7 +110,7 @@ int main(int argc, char* argv[]) for_all_lines(l, lines) if (lines(l).is_textline()) { - const util::array<component_id_t>& comps = lines(l).components(); + const util::array<component_id_t>& comps = lines(l).component_ids(); const L& lbl = lines.components().labeled_image(); for_all_elements(c, comps) data::fill((output | lines.components()(comps(c)).bbox()).rw(), -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
last-svn-commit-795-g881caef Rename line_info::components() to line_info::component_ids.
by Guillaume Lazzara
* scribo/core/line_info.hh: Here. * scribo/debug/char_space_image.hh, * scribo/text/recognition.hh, * src/debug/show_text_lines.cc, * scribo/io/xml/internal/full_xml_visitor.hh: Update calls to that method. --- scribo/ChangeLog | 22 ++++++++++++++++++++- scribo/scribo/core/line_info.hh | 8 +++--- scribo/scribo/debug/char_space_image.hh | 8 +++--- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 4 +- scribo/scribo/text/recognition.hh | 4 +- scribo/src/debug/show_text_lines.cc | 2 +- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 439db69..1928592 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,12 +1,32 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> - Rename debug routines. + Rename line_info::components() to line_info::component_ids. + + * scribo/core/line_info.hh: Here. + + * scribo/debug/char_space_image.hh, + * scribo/text/recognition.hh, + * src/debug/show_text_lines.cc, + * scribo/io/xml/internal/full_xml_visitor.hh: Update calls to that + method. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + + Some changes in debug routines. * scribo/debug/save_bboxes_image.hh, * scribo/debug/save_linked_bboxes_image.hh: Rename as... * scribo/debug/bboxes_image.hh, * scribo/debug/linked_bboxes_image.hh: ... this. + * scribo/debug/links_image.hh: New. + + * scribo/debug/several_links_decision_image.hh: + Remove. Deprecated. + + * scribo/debug/alignment_decision_image.hh: Make use of + compute_anchor routine. + * scribo/debug/all.hh, * scribo/table/extract.hh, * scribo/toolchain/text_in_picture.hh, diff --git a/scribo/scribo/core/line_info.hh b/scribo/scribo/core/line_info.hh index 46ba720..4def6fe 100644 --- a/scribo/scribo/core/line_info.hh +++ b/scribo/scribo/core/line_info.hh @@ -172,7 +172,7 @@ namespace scribo // const mln::box2d& ebbox() const; - const mln::util::array<component_id_t>& components() const; + const mln::util::array<component_id_t>& component_ids() const; unsigned card() const; int baseline() const; @@ -481,7 +481,7 @@ namespace scribo template <typename L> const mln::util::array<typename line_info<L>::component_id_t>& - line_info<L>::components() const + line_info<L>::component_ids() const { return data_->components_; } @@ -856,7 +856,7 @@ namespace scribo // Update bbox and ebbox update_bbox_and_ebox(other); - data_->components_.append(other.components()); + data_->components_.append(other.component_ids()); } @@ -1023,7 +1023,7 @@ namespace scribo << ", type=" << info.type() << ", bbox=" << info.bbox() << ", ebbox=" << info.ebbox() - << ", components=" << info.components() + << ", components=" << info.component_ids() << ", baseline=" << info.baseline() << ", meanline=" << info.meanline() << ", ascent=" << info.ascent() diff --git a/scribo/scribo/debug/char_space_image.hh b/scribo/scribo/debug/char_space_image.hh index 6dc6f8f..53fc303 100644 --- a/scribo/scribo/debug/char_space_image.hh +++ b/scribo/scribo/debug/char_space_image.hh @@ -76,16 +76,16 @@ namespace scribo for_all_lines(l, line) { if (! line(l).is_valid() || line(l).is_hidden() - || line(l).components().size() < 2) + || line(l).component_ids().size() < 2) continue; - for_all_elements(i, line(l).components()) + for_all_elements(i, line(l).component_ids()) { - if (i == line(l).components().nelements() - 1) + if (i == line(l).component_ids().nelements() - 1) continue; - unsigned c = line(l).components()[i]; + unsigned c = line(l).component_ids()[i]; point2d beg = comps(c).bbox().pmax(), diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 8576c27..701c1b7 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -447,9 +447,9 @@ namespace scribo output << " <compid_list>" << std::endl; - for_all_line_comps(c, line.components()) + for_all_line_comps(c, line.component_ids()) output << " <compid value=\"" - << line.components()(c) << "\" />" << std::endl; + << line.component_ids()(c) << "\" />" << std::endl; output << " </compid_list>" << std::endl; diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh index 3a9742b..1e11a3e 100644 --- a/scribo/scribo/text/recognition.hh +++ b/scribo/scribo/text/recognition.hh @@ -144,8 +144,8 @@ namespace scribo const L& lbl = comp_set.labeled_image(); // Extract each character components to create the line image. - const mln::util::array<component_id_t>& comps = lines(i).components(); - for_all_elements(e, lines(i).components()) + const mln::util::array<component_id_t>& comps = lines(i).component_ids(); + for_all_elements(e, lines(i).component_ids()) { unsigned comp_id = comps(e); data::fill(((text_ima | comp_set(comp_id).bbox()).rw() | (pw::value(lbl) == pw::cst(comp_id))).rw(), diff --git a/scribo/src/debug/show_text_lines.cc b/scribo/src/debug/show_text_lines.cc index 368f375..d5a5c8f 100644 --- a/scribo/src/debug/show_text_lines.cc +++ b/scribo/src/debug/show_text_lines.cc @@ -110,7 +110,7 @@ int main(int argc, char* argv[]) for_all_lines(l, lines) if (lines(l).is_textline()) { - const util::array<component_id_t>& comps = lines(l).components(); + const util::array<component_id_t>& comps = lines(l).component_ids(); const L& lbl = lines.components().labeled_image(); for_all_elements(c, comps) data::fill((output | lines.components()(comps(c)).bbox()).rw(), -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
last-svn-commit-796-gdd1061b Rename line_info::components() to line_info::component_ids.
by Guillaume Lazzara
* scribo/core/line_info.hh: Here. * scribo/debug/char_space_image.hh, * scribo/text/recognition.hh, * src/debug/show_text_lines.cc, * scribo/io/xml/internal/full_xml_visitor.hh: Update calls to that method. --- scribo/ChangeLog | 22 ++++++++++++++++++++- scribo/scribo/core/line_info.hh | 8 +++--- scribo/scribo/debug/char_space_image.hh | 8 +++--- scribo/scribo/io/xml/internal/full_xml_visitor.hh | 4 +- scribo/scribo/text/recognition.hh | 4 +- scribo/src/debug/show_text_lines.cc | 2 +- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 8de7299..52e3125 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,12 +1,32 @@ 2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> - Rename debug routines. + Rename line_info::components() to line_info::component_ids. + + * scribo/core/line_info.hh: Here. + + * scribo/debug/char_space_image.hh, + * scribo/text/recognition.hh, + * src/debug/show_text_lines.cc, + * scribo/io/xml/internal/full_xml_visitor.hh: Update calls to that + method. + +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + + Some changes in debug routines. * scribo/debug/save_bboxes_image.hh, * scribo/debug/save_linked_bboxes_image.hh: Rename as... * scribo/debug/bboxes_image.hh, * scribo/debug/linked_bboxes_image.hh: ... this. + * scribo/debug/links_image.hh: New. + + * scribo/debug/several_links_decision_image.hh: + Remove. Deprecated. + + * scribo/debug/alignment_decision_image.hh: Make use of + compute_anchor routine. + * scribo/debug/all.hh, * scribo/table/extract.hh, * scribo/toolchain/text_in_picture.hh, diff --git a/scribo/scribo/core/line_info.hh b/scribo/scribo/core/line_info.hh index 46ba720..4def6fe 100644 --- a/scribo/scribo/core/line_info.hh +++ b/scribo/scribo/core/line_info.hh @@ -172,7 +172,7 @@ namespace scribo // const mln::box2d& ebbox() const; - const mln::util::array<component_id_t>& components() const; + const mln::util::array<component_id_t>& component_ids() const; unsigned card() const; int baseline() const; @@ -481,7 +481,7 @@ namespace scribo template <typename L> const mln::util::array<typename line_info<L>::component_id_t>& - line_info<L>::components() const + line_info<L>::component_ids() const { return data_->components_; } @@ -856,7 +856,7 @@ namespace scribo // Update bbox and ebbox update_bbox_and_ebox(other); - data_->components_.append(other.components()); + data_->components_.append(other.component_ids()); } @@ -1023,7 +1023,7 @@ namespace scribo << ", type=" << info.type() << ", bbox=" << info.bbox() << ", ebbox=" << info.ebbox() - << ", components=" << info.components() + << ", components=" << info.component_ids() << ", baseline=" << info.baseline() << ", meanline=" << info.meanline() << ", ascent=" << info.ascent() diff --git a/scribo/scribo/debug/char_space_image.hh b/scribo/scribo/debug/char_space_image.hh index 6dc6f8f..53fc303 100644 --- a/scribo/scribo/debug/char_space_image.hh +++ b/scribo/scribo/debug/char_space_image.hh @@ -76,16 +76,16 @@ namespace scribo for_all_lines(l, line) { if (! line(l).is_valid() || line(l).is_hidden() - || line(l).components().size() < 2) + || line(l).component_ids().size() < 2) continue; - for_all_elements(i, line(l).components()) + for_all_elements(i, line(l).component_ids()) { - if (i == line(l).components().nelements() - 1) + if (i == line(l).component_ids().nelements() - 1) continue; - unsigned c = line(l).components()[i]; + unsigned c = line(l).component_ids()[i]; point2d beg = comps(c).bbox().pmax(), diff --git a/scribo/scribo/io/xml/internal/full_xml_visitor.hh b/scribo/scribo/io/xml/internal/full_xml_visitor.hh index 8576c27..701c1b7 100644 --- a/scribo/scribo/io/xml/internal/full_xml_visitor.hh +++ b/scribo/scribo/io/xml/internal/full_xml_visitor.hh @@ -447,9 +447,9 @@ namespace scribo output << " <compid_list>" << std::endl; - for_all_line_comps(c, line.components()) + for_all_line_comps(c, line.component_ids()) output << " <compid value=\"" - << line.components()(c) << "\" />" << std::endl; + << line.component_ids()(c) << "\" />" << std::endl; output << " </compid_list>" << std::endl; diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh index 3a9742b..1e11a3e 100644 --- a/scribo/scribo/text/recognition.hh +++ b/scribo/scribo/text/recognition.hh @@ -144,8 +144,8 @@ namespace scribo const L& lbl = comp_set.labeled_image(); // Extract each character components to create the line image. - const mln::util::array<component_id_t>& comps = lines(i).components(); - for_all_elements(e, lines(i).components()) + const mln::util::array<component_id_t>& comps = lines(i).component_ids(); + for_all_elements(e, lines(i).component_ids()) { unsigned comp_id = comps(e); data::fill(((text_ima | comp_set(comp_id).bbox()).rw() | (pw::value(lbl) == pw::cst(comp_id))).rw(), diff --git a/scribo/src/debug/show_text_lines.cc b/scribo/src/debug/show_text_lines.cc index 368f375..d5a5c8f 100644 --- a/scribo/src/debug/show_text_lines.cc +++ b/scribo/src/debug/show_text_lines.cc @@ -110,7 +110,7 @@ int main(int argc, char* argv[]) for_all_lines(l, lines) if (lines(l).is_textline()) { - const util::array<component_id_t>& comps = lines(l).components(); + const util::array<component_id_t>& comps = lines(l).component_ids(); const L& lbl = lines.components().labeled_image(); for_all_elements(c, comps) data::fill((output | lines.components()(comps(c)).bbox()).rw(), -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
last-svn-commit-794-g00e84b1 Some changes in debug routines.
by Guillaume Lazzara
* scribo/debug/save_bboxes_image.hh, * scribo/debug/save_linked_bboxes_image.hh: Rename as... * scribo/debug/bboxes_image.hh, * scribo/debug/linked_bboxes_image.hh: ... this. * scribo/debug/links_image.hh: New. * scribo/debug/several_links_decision_image.hh: Remove. Deprecated. * scribo/debug/alignment_decision_image.hh: Make use of compute_anchor routine. * scribo/debug/all.hh, * scribo/table/extract.hh, * scribo/toolchain/text_in_picture.hh, * src/debug/show_links_several_right_overlap.cc, * src/debug/show_links_single_down.cc, * src/debug/show_links_single_down_left_aligned.cc, * src/debug/show_links_single_down_right_aligned.cc, * src/debug/show_links_single_left.cc, * src/debug/show_links_single_left_dmax_ratio.cc, * src/debug/show_links_single_right.cc, * src/debug/show_links_single_right_dmax_ratio.cc, * src/debug/show_links_single_up.cc, * src/debug/show_links_single_up_left_aligned.cc, * src/debug/show_links_single_up_right_aligned.cc, * src/debug/show_separators.cc, * src/primitive/group/group_from_double_link.cc, * src/primitive/group/group_from_double_several_links.cc, * src/primitive/group/group_from_several_left_links.cc, * src/primitive/group/group_from_single_link.cc, * src/text_in_picture.cc, * src/text_in_picture_neg.cc, * src/text_recognition_in_picture.cc, * tests/filter/components_large.cc, * tests/filter/components_small.cc: Update includes. --- scribo/ChangeLog | 34 +++ scribo/scribo/debug/alignment_decision_image.hh | 87 ++------- scribo/scribo/debug/all.hh | 7 +- .../{save_bboxes_image.hh => bboxes_image.hh} | 82 ++++---- ...nked_bboxes_image.hh => linked_bboxes_image.hh} | 213 +++++++++----------- .../{links_decision_image.hh => links_image.hh} | 77 ++++---- .../scribo/debug/several_links_decision_image.hh | 179 ---------------- scribo/scribo/table/extract.hh | 6 +- scribo/scribo/toolchain/text_in_picture.hh | 20 +- .../src/debug/show_links_several_right_overlap.cc | 6 +- scribo/src/debug/show_links_single_down.cc | 5 +- .../debug/show_links_single_down_left_aligned.cc | 11 +- .../debug/show_links_single_down_right_aligned.cc | 14 +- scribo/src/debug/show_links_single_left.cc | 5 +- .../src/debug/show_links_single_left_dmax_ratio.cc | 5 +- scribo/src/debug/show_links_single_right.cc | 5 +- .../debug/show_links_single_right_dmax_ratio.cc | 5 +- scribo/src/debug/show_links_single_up.cc | 5 +- .../src/debug/show_links_single_up_left_aligned.cc | 15 +- .../debug/show_links_single_up_right_aligned.cc | 15 +- scribo/src/debug/show_separators.cc | 6 +- .../src/primitive/group/group_from_double_link.cc | 28 ++-- .../group/group_from_double_several_links.cc | 25 ++- .../group/group_from_several_left_links.cc | 23 +- .../src/primitive/group/group_from_single_link.cc | 36 ++-- scribo/src/text_in_picture.cc | 17 +- scribo/src/text_in_picture_neg.cc | 2 - scribo/src/text_recognition_in_picture.cc | 2 - scribo/tests/filter/components_large.cc | 8 +- scribo/tests/filter/components_small.cc | 8 +- 30 files changed, 357 insertions(+), 594 deletions(-) rename scribo/scribo/debug/{save_bboxes_image.hh => bboxes_image.hh} (65%) rename scribo/scribo/debug/{save_linked_bboxes_image.hh => linked_bboxes_image.hh} (54%) copy scribo/scribo/debug/{links_decision_image.hh => links_image.hh} (58%) delete mode 100644 scribo/scribo/debug/several_links_decision_image.hh diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 714874c..439db69 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,3 +1,37 @@ +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + + Rename debug routines. + + * scribo/debug/save_bboxes_image.hh, + * scribo/debug/save_linked_bboxes_image.hh: Rename as... + * scribo/debug/bboxes_image.hh, + * scribo/debug/linked_bboxes_image.hh: ... this. + + * scribo/debug/all.hh, + * scribo/table/extract.hh, + * scribo/toolchain/text_in_picture.hh, + * src/debug/show_links_several_right_overlap.cc, + * src/debug/show_links_single_down.cc, + * src/debug/show_links_single_down_left_aligned.cc, + * src/debug/show_links_single_down_right_aligned.cc, + * src/debug/show_links_single_left.cc, + * src/debug/show_links_single_left_dmax_ratio.cc, + * src/debug/show_links_single_right.cc, + * src/debug/show_links_single_right_dmax_ratio.cc, + * src/debug/show_links_single_up.cc, + * src/debug/show_links_single_up_left_aligned.cc, + * src/debug/show_links_single_up_right_aligned.cc, + * src/debug/show_separators.cc, + * src/primitive/group/group_from_double_link.cc, + * src/primitive/group/group_from_double_several_links.cc, + * src/primitive/group/group_from_several_left_links.cc, + * src/primitive/group/group_from_single_link.cc, + * src/text_in_picture.cc, + * src/text_in_picture_neg.cc, + * src/text_recognition_in_picture.cc, + * tests/filter/components_large.cc, + * tests/filter/components_small.cc: Update includes. + 2011-03-11 Guillaume Lazzara <z(a)lrde.epita.fr> Add HAVE_QT guards. diff --git a/scribo/scribo/debug/alignment_decision_image.hh b/scribo/scribo/debug/alignment_decision_image.hh index 841bd38..450091d 100644 --- a/scribo/scribo/debug/alignment_decision_image.hh +++ b/scribo/scribo/debug/alignment_decision_image.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -36,12 +37,12 @@ # include <mln/literal/colors.hh> # include <mln/util/array.hh> # include <mln/util/couple.hh> -# include <mln/norm/l1.hh> # include <scribo/core/component_set.hh> # include <scribo/core/object_groups.hh> # include <scribo/draw/bounding_boxes.hh> +# include <scribo/primitive/link/internal/compute_anchor.hh> namespace scribo { @@ -51,8 +52,6 @@ namespace scribo using namespace mln; - enum Alignment { top, center, bottom }; - /*! \brief Save a color image showing the difference between to object links. @@ -70,54 +69,17 @@ namespace scribo alignment_decision_image(const Image<I>& input_, const object_links<L>& links, const object_links<L>& filtered_links, - const Alignment& alignment); + const anchor::Type& anchor); # ifndef MLN_INCLUDE_ONLY - - namespace internal - { - - template <typename L> - mln::util::couple<mln_site(L),mln_site(L)> - find_anchors(const component_set<L>& components, - unsigned i, - unsigned link_i, - const Alignment& alignment) - { - mln_site(L) - a1 = components(i).bbox().pcenter(), - a2 = components(link_i).bbox().pcenter(); - - switch (alignment) - { - case top: - a1.row() = components(i).bbox().pmin().row(); - a2.row() = components(link_i).bbox().pmin().row(); - break; - - case center: - break; - - case bottom: - a1.row() = components(i).bbox().pmax().row(); - a2.row() = components(link_i).bbox().pmax().row(); - break; - - } - return make::couple(a1, a2); - } - - } - template <typename I, typename L> mln_ch_value(I,value::rgb8) - alignment_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links, - const Alignment& alignment, - unsigned max_link_length) + alignment_decision_image(const Image<I>& input_, + const object_links<L>& links, + const object_links<L>& filtered_links, + const anchor::Type& anchor) { trace::entering("scribo::debug::alignment_decision_image"); const I& input = exact(input_); @@ -138,43 +100,26 @@ namespace scribo typedef mln_site(L) P; for_all_links(i, links) - { if (links(i) != i) { value::rgb8 value = literal::green; + P + anchor_i = primitive::link::internal::compute_anchor(components, + i, anchor), + anchor_li = primitive::link::internal::compute_anchor(components, + links(i), + anchor); + if (links(i) != filtered_links(i)) value = literal::red; - mln::util::couple<P,P> - anchors = internal::find_anchors(components, i, links(i), alignment); - if (mln::norm::l1_distance(anchors.first().to_vec(), anchors.second().to_vec()) < max_link_length) - mln::draw::line(decision_image, - anchors.first(), - anchors.second(), - value); + mln::draw::line(decision_image, anchor_i, anchor_li, value); } - } trace::exiting("scribo::debug::alignment_decision_image"); return decision_image; } - - template <typename I, typename L> - mln_ch_value(I,value::rgb8) - alignment_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links, - const Alignment& alignment) - { - return alignment_decision_image(input_, - links, - filtered_links, - alignment, - mln_max(unsigned)); - } - - # endif // ! MLN_INCLUDE_ONLY } // end of namespace scribo::debug diff --git a/scribo/scribo/debug/all.hh b/scribo/scribo/debug/all.hh index f7ffe1c..7181ec1 100644 --- a/scribo/scribo/debug/all.hh +++ b/scribo/scribo/debug/all.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -41,9 +42,9 @@ namespace scribo } // end of namespace scribo -# include <scribo/debug/save_bboxes_image.hh> +# include <scribo/debug/bboxes_image.hh> # include <scribo/debug/save_label_image.hh> -# include <scribo/debug/save_linked_bboxes_image.hh> +# include <scribo/debug/linked_bboxes_image.hh> # include <scribo/debug/save_table_image.hh> #endif // ! SCRIBO_DEBUG_ALL_HH diff --git a/scribo/scribo/debug/save_bboxes_image.hh b/scribo/scribo/debug/bboxes_image.hh similarity index 65% rename from scribo/scribo/debug/save_bboxes_image.hh rename to scribo/scribo/debug/bboxes_image.hh index ee781c1..ca3d646 100644 --- a/scribo/scribo/debug/save_bboxes_image.hh +++ b/scribo/scribo/debug/bboxes_image.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -24,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_DEBUG_SAVE_BBOXES_IMAGE_HH -# define SCRIBO_DEBUG_SAVE_BBOXES_IMAGE_HH +#ifndef SCRIBO_DEBUG_BBOXES_IMAGE_HH +# define SCRIBO_DEBUG_BBOXES_IMAGE_HH /// \file /// @@ -53,18 +53,16 @@ namespace scribo /// Draw a list of bounding boxes template <typename I> - void - save_bboxes_image(const Image<I>& input, + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, const mln::util::array< box<mln_site(I)> >& bboxes, - const std::string& filename, const value::rgb8& value); template <typename I, typename L> - void - save_bboxes_image(const Image<I>& input, + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, const line_set<L>& lines, - const std::string& filename, const value::rgb8& value); /// \overload @@ -72,50 +70,46 @@ namespace scribo // template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, - const line_set<L>& lines, - const std::string& filename); + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, + const line_set<L>& lines); /// \overload. template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, const component_set<L>& comps, - const std::string& filename, const value::rgb8& value); # ifndef MLN_INCLUDE_ONLY template <typename I> inline - void - save_bboxes_image(const Image<I>& input, - const mln::util::array< box<mln_site(I)> >& bboxes, - const std::string& filename, - const value::rgb8& value) + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, + const mln::util::array< box<mln_site(I)> >& bboxes, + const value::rgb8& value) { - trace::entering("scribo::debug::save_bboxes_image"); + trace::entering("scribo::debug::bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input); draw::bounding_boxes(tmp, bboxes, value); - mln::io::ppm::save(tmp, filename); - trace::exiting("scribo::debug::save_bboxes_image"); + trace::exiting("scribo::debug::bboxes_image"); + return tmp; } template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, const line_set<L>& lines, - const std::string& filename, const value::rgb8& value) { - trace::entering("scribo::debug::save_bboxes_image"); + trace::entering("scribo::debug::bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I, value::rgb8) @@ -125,31 +119,29 @@ namespace scribo if (! lines(l).is_hidden()) mln::draw::box(output, lines(l).bbox(), value); - mln::io::ppm::save(output, filename); - trace::exiting("scribo::debug::save_bboxes_image"); + trace::exiting("scribo::debug::bboxes_image"); + return output; } template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, - const line_set<L>& lines, - const std::string& filename) + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, + const line_set<L>& lines) { - return save_bboxes_image(input, lines, filename, literal::red); + return bboxes_image(input, lines, literal::red); } template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, - const component_set<L>& comps, - const std::string& filename, - const value::rgb8& value) + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, + const component_set<L>& comps, + const value::rgb8& value) { - trace::entering("scribo::debug::save_bboxes_image"); + trace::entering("scribo::debug::bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I, value::rgb8) @@ -159,8 +151,8 @@ namespace scribo if (comps(c).is_valid()) mln::draw::box(output, comps(c).bbox(), value); - mln::io::ppm::save(output, filename); - trace::exiting("scribo::debug::save_bboxes_image"); + trace::exiting("scribo::debug::bboxes_image"); + return output; } @@ -171,4 +163,4 @@ namespace scribo } // end of namespace scribo -#endif // ! SCRIBO_DEBUG_SAVE_BBOXES_IMAGE_HH +#endif // ! SCRIBO_DEBUG_BBOXES_IMAGE_HH diff --git a/scribo/scribo/debug/save_linked_bboxes_image.hh b/scribo/scribo/debug/linked_bboxes_image.hh similarity index 54% rename from scribo/scribo/debug/save_linked_bboxes_image.hh rename to scribo/scribo/debug/linked_bboxes_image.hh index d4c940a..2373405 100644 --- a/scribo/scribo/debug/save_linked_bboxes_image.hh +++ b/scribo/scribo/debug/linked_bboxes_image.hh @@ -24,12 +24,12 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef SCRIBO_DEBUG_SAVE_LINKED_BBOXES_IMAGE_HH -# define SCRIBO_DEBUG_SAVE_LINKED_BBOXES_IMAGE_HH +#ifndef SCRIBO_DEBUG_LINKED_BBOXES_IMAGE_HH +# define SCRIBO_DEBUG_LINKED_BBOXES_IMAGE_HH /// \file /// -/// Save the bounding box links image. +/// Compute the bounding box links image. # include <mln/core/concept/image.hh> # include <mln/core/concept/graph.hh> @@ -56,54 +56,50 @@ namespace scribo using namespace mln; - /// Save the line of components links image. + /// Compute the line of components links image. /// /// \param[in,out] input The binary from where the components are extracted. /// \param[in] link_array Lines of components links. /// \param[in] box_value Value used to draw line bounding boxes. /// \param[in] link_value Value used to draw line links. - /// \param[in] filename The target file name. /// \param[in] anchor Anchor from where the links are drawn. // template <typename I, typename L> - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& array, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename); + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& array, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor); /// \overload /// The default anchor type is set to anchor::Center. // template <typename I, typename L> - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& array, - const value::rgb8& box_value, - const value::rgb8& link_value, - const std::string& filename); - - /// Save the line of components left and right links image. + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& array, + const value::rgb8& box_value, + const value::rgb8& link_value); + + /// Compute the line of components left and right links image. /// /// \param[in,out] input The binary from where the components are extracted. /// \param[in] left_link Lines of components left links. /// \param[in] right_link Lines of components right links. /// \param[in] box_value Value used to draw line bounding boxes. /// \param[in] link_value Value used to draw line links. - /// \param[in] filename The target file name. + // template <typename I, typename L> - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& left_link, - const object_links<L>& right_link, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename); - - /// Save the line of components left and right links image. + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& left_link, + const object_links<L>& right_link, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor); + + /// Compute the line of components left and right links image. /// Draw also validated links. /// /// \param[in,out] input The binary from where the components are extracted. @@ -113,36 +109,34 @@ namespace scribo /// \param[in] left_link_value Value used to draw line left links. /// \param[in] right_link_value Value used to draw line left links. /// \param[in] validated_link_value Value used to draw line validated links. - /// \param[in] filename The target file name. + // template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& left_link, - const object_links<L>& right_link, - const value::rgb8& box_value, - const value::rgb8& left_link_value, - const value::rgb8& right_link_value, - const value::rgb8& validated_link_value, - anchor::Type anchor, - const std::string& filename); - - - /// Save the line link graph image. + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& left_link, + const object_links<L>& right_link, + const value::rgb8& box_value, + const value::rgb8& left_link_value, + const value::rgb8& right_link_value, + const value::rgb8& validated_link_value, + anchor::Type anchor); + + + /// Compute the line link graph image. /// /// \param[in,out] input The binary from where the components are extracted. /// \param[in] g The link graph. /// \param[in] box_value Value used to draw line bounding boxes. /// \param[in] link_value Value used to draw line links. - /// \param[in] filename The target file name. + // template <typename I, typename L, typename G> - void - save_linked_bboxes_image(const Image<I>& input, - const Graph<G>& g, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename); + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const Graph<G>& g, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor); # ifndef MLN_INCLUDE_ONLY @@ -150,15 +144,14 @@ namespace scribo template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& links, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& links, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor) { - trace::entering("scribo::debug::save_linked_bboxes_image"); + trace::entering("scribo::debug::linked_bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input); @@ -166,63 +159,58 @@ namespace scribo draw::bounding_boxes(tmp, links.components(), box_value); draw::bounding_box_links(tmp, links, link_value, anchor); - mln::io::ppm::save(tmp, filename); - - trace::exiting("scribo::debug::save_linked_bboxes_image"); + trace::exiting("scribo::debug::linked_bboxes_image"); + return tmp; } template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& links, - const value::rgb8& box_value, - const value::rgb8& link_value, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& links, + const value::rgb8& box_value, + const value::rgb8& link_value) { - save_linked_bboxes_image(input, links, box_value, - link_value, anchor::Center, filename); + return linked_bboxes_image(input, links, box_value, + link_value, anchor::Center); } template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& left_link, - const object_links<L>& right_link, - const value::rgb8& box_value, - const value::rgb8& value, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& left_link, + const object_links<L>& right_link, + const value::rgb8& box_value, + const value::rgb8& value) { - save_linked_bboxes_image(input, - left_link, - right_link, - box_value, - literal::yellow, - literal::cyan, - value, - anchor::Center, - filename); + return linked_bboxes_image(input, + left_link, + right_link, + box_value, + literal::yellow, + literal::cyan, + value, + anchor::Center); } template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& left_link, - const object_links<L>& right_link, - const value::rgb8& box_value, - const value::rgb8& left_link_value, - const value::rgb8& right_link_value, - const value::rgb8& validated_link_value, - anchor::Type anchor, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& left_link, + const object_links<L>& right_link, + const value::rgb8& box_value, + const value::rgb8& left_link_value, + const value::rgb8& right_link_value, + const value::rgb8& validated_link_value, + anchor::Type anchor) { - trace::entering("scribo::debug::save_linked_bboxes_image"); + trace::entering("scribo::debug::linked_bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input); @@ -234,24 +222,22 @@ namespace scribo validated_link_value, anchor); - mln::io::ppm::save(tmp, filename); - - trace::exiting("scribo::debug::save_linked_bboxes_image"); + trace::exiting("scribo::debug::linked_bboxes_image"); + return tmp; } template <typename I, typename L, typename G> inline - void - save_linked_bboxes_image(const Image<I>& input, - const Graph<G>& g, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const Graph<G>& g, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor) { - trace::entering("scribo::debug::save_linked_bboxes_image"); + trace::entering("scribo::debug::linked_bboxes_image"); mln_precondition(exact(g).is_valid()); mln_precondition(exact(input).is_valid()); @@ -261,9 +247,8 @@ namespace scribo draw::bounding_box_links(tmp, exact(g).components(), g, link_value, anchor); - mln::io::ppm::save(tmp, filename); - - trace::exiting("scribo::debug::save_linked_bboxes_image"); + trace::exiting("scribo::debug::linked_bboxes_image"); + return tmp; } @@ -274,4 +259,4 @@ namespace scribo } // end of namespace scribo -#endif // ! SCRIBO_DEBUG_SAVE_LINKED_BBOXES_IMAGE_HH +#endif // ! SCRIBO_DEBUG_LINKED_BBOXES_IMAGE_HH diff --git a/scribo/scribo/debug/links_decision_image.hh b/scribo/scribo/debug/links_image.hh similarity index 58% copy from scribo/scribo/debug/links_decision_image.hh copy to scribo/scribo/debug/links_image.hh index 387cd7f..76447b7 100644 --- a/scribo/scribo/debug/links_decision_image.hh +++ b/scribo/scribo/debug/links_image.hh @@ -1,5 +1,4 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -24,21 +23,23 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef SCRIBO_DEBUG_LINKS_DECISION_IMAGE_HH -# define SCRIBO_DEBUG_LINKS_DECISION_IMAGE_HH +#ifndef SCRIBO_DEBUG_LINKS_IMAGE_HH +# define SCRIBO_DEBUG_LINKS_IMAGE_HH /// \file /// -/// Save a color image showing the difference between to object groups. +/// Save a color image showing components links. # include <mln/core/concept/image.hh> +# include <mln/accu/center.hh> # include <mln/data/convert.hh> # include <mln/value/rgb8.hh> # include <mln/literal/colors.hh> -# include <mln/draw/box.hh> # include <mln/draw/line.hh> # include <scribo/core/object_links.hh> +# include <scribo/draw/bounding_boxes.hh> +# include <scribo/primitive/link/internal/compute_anchor.hh> namespace scribo @@ -52,52 +53,46 @@ namespace scribo /// FIXME: DOC! template <typename I, typename L> mln_ch_value(I,value::rgb8) - links_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links); + links_image(const Image<I>& input_, + const object_links<L>& links, + anchor::Type anchor); + # ifndef MLN_INCLUDE_ONLY + template <typename I, typename L> mln_ch_value(I,value::rgb8) - links_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links) + links_image(const Image<I>& input_, + const object_links<L>& links, + anchor::Type anchor) { - trace::entering("scribo::debug::links_decision_image"); + trace::entering("scribo::debug::links_image"); const I& input = exact(input_); - const component_set<L>& comps = links.components(); - mln_precondition(input.is_valid()); - mln_precondition(comps.is_valid()); mln_precondition(links.is_valid()); - mln_precondition(filtered_links.is_valid()); - mln_precondition(links.size() == filtered_links.size()); - /// Fixme: check that objects has been computed from input. - - image2d<value::rgb8> - links_decision_image = data::convert(value::rgb8(), input); - for_all_comps(i, comps) - mln::draw::box(links_decision_image, comps(i).bbox(), literal::blue); - - for_all_links(i, links) - if (links(i) != i) - { - value::rgb8 value = literal::green; - if (links(i) != filtered_links(i)) - value = literal::red; - - mln_site(I) - p1 = comps(i).mass_center(), - p2 = comps(links(i)).mass_center(); - - mln::draw::line(links_decision_image, p1, p2, value); - } + const component_set<L>& comps = links.components(); - trace::exiting("scribo::debug::links_decision_image"); - return links_decision_image; + image2d<value::rgb8> + links_image = data::convert(value::rgb8(), input); + + scribo::draw::bounding_boxes(links_image, comps, literal::blue); + + for_all_links(l, links) + if (links(l) != l) + mln::draw::line(links_image, + primitive::link::internal::compute_anchor(comps, + l, + anchor), + primitive::link::internal::compute_anchor(comps, + links(l), + anchor), + literal::green); + + trace::exiting("scribo::debug::links_image"); + return links_image; } @@ -108,4 +103,4 @@ namespace scribo } // end of namespace scribo -#endif // ! SCRIBO_DEBUG_LINKS_DECISION_IMAGE_HH +#endif // ! SCRIBO_DEBUG_LINKS_IMAGE_HH diff --git a/scribo/scribo/debug/several_links_decision_image.hh b/scribo/scribo/debug/several_links_decision_image.hh deleted file mode 100644 index 73e66a1..0000000 --- a/scribo/scribo/debug/several_links_decision_image.hh +++ /dev/null @@ -1,179 +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_DEBUG_SEVERAL_LINKS_DECISION_IMAGE_HH -# define SCRIBO_DEBUG_SEVERAL_LINKS_DECISION_IMAGE_HH - -/// \file -/// -/// Save a color image showing the difference between to object groups. - -# include <mln/core/concept/image.hh> -# include <mln/accu/center.hh> -# include <mln/data/convert.hh> -# include <mln/value/rgb8.hh> -# include <mln/literal/colors.hh> -# include <mln/util/array.hh> - -# include <scribo/core/object_groups.hh> -# include <scribo/draw/bounding_boxes.hh> - - -namespace scribo -{ - - namespace debug - { - - using namespace mln; - - /// FIXME: DOC! - template <typename I, typename L> - mln_ch_value(I,value::rgb8) - several_links_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links); - - -# ifndef MLN_INCLUDE_ONLY - - - - namespace internal - { - - template <typename L, typename I> - bool - draw_line(const L& objects, I& output, - unsigned link, - const mln_site(L)& p1, const mln_site(L)& p2, - const mln_value(I)& value) - { - - if (objects.domain().has(p2)) - if (objects(p2) == link) - { - mln::draw::line(output, p1, p2, value); - return true; - } - return false; - } - - } - - - - template <typename I, typename L> - mln_ch_value(I,value::rgb8) - several_links_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links) - { - trace::entering("scribo::debug::several_links_decision_image"); - const I& input = exact(input_); - - const component_set<L>& comps = links.components(); - - mln_precondition(input.is_valid()); - mln_precondition(links.is_valid()); - mln_precondition(filtered_links.is_valid()); - - /// Fixme: check that objects has been computed from input. - - image2d<value::rgb8> - links_decision_image = data::convert(value::rgb8(), input); - - for_all_comps(c, comps) - mln::draw::box(links_decision_image, comps(c).bbox(), literal::blue); - - for_all_links(l, links) - { - if (links(l) != l) - { - value::rgb8 value = literal::green; - if (links(l) != filtered_links(l)) - value = literal::red; - - mln_site(L) c = comps(l).bbox().pcenter(); - - // Right link from the top anchor. - mln_site(L) a1 = c; - a1.row() = comps(l).bbox().pmin().row() - + (c.row() - comps(l).bbox().pmin().row()) / 4; - - // Right link from the central site - mln_site(I) p1 = comps(l).mass_center(); - - // Right link from the bottom anchor. - mln_site(L) a2 = c; - a2.row() = comps(l).bbox().pmax().row() - - (c.row() - comps(l).bbox().pmin().row()) / 4; - - mln_site(L) - a1_bak = a1, - a2_bak = a2; - - const L& lbl_ima = comps.labeled_image(); - - mln_site(L) tmp; - while(lbl_ima.domain().has(a1) - || lbl_ima.domain().has(a2) - || lbl_ima.domain().has(p1)) - { - if (internal::draw_line(lbl_ima, links_decision_image, links(l), - a1_bak, a1, value)) - break; - else - ++a1.col(); - - if (internal::draw_line(lbl_ima, links_decision_image, links(l), - comps(l).mass_center(), p1, value)) - break; - else - ++p1.col(); - - if (internal::draw_line(lbl_ima, links_decision_image, links(l), - a2_bak, a2, value)) - break; - else - ++a2.col(); - - } - } - } - - trace::exiting("scribo::debug::several_links_decision_image"); - return links_decision_image; - } - - -# endif // ! MLN_INCLUDE_ONLY - - } // end of namespace scribo::debug - -} // end of namespace scribo - - -#endif // ! SCRIBO_DEBUG_SEVERAL_LINKS_DECISION_IMAGE_HH diff --git a/scribo/scribo/table/extract.hh b/scribo/scribo/table/extract.hh index 49a7d50..a87667f 100644 --- a/scribo/scribo/table/extract.hh +++ b/scribo/scribo/table/extract.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -45,8 +45,6 @@ # include <scribo/primitive/extract/lines_v_pattern.hh> # include <scribo/primitive/extract/components.hh> -# include <scribo/debug/save_bboxes_image.hh> - namespace scribo { diff --git a/scribo/scribo/toolchain/text_in_picture.hh b/scribo/scribo/toolchain/text_in_picture.hh index 9746645..42e69db 100644 --- a/scribo/scribo/toolchain/text_in_picture.hh +++ b/scribo/scribo/toolchain/text_in_picture.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -74,7 +74,7 @@ # include <scribo/filter/object_groups_v_thickness.hh> # include <scribo/debug/decision_image.hh> -# include <scribo/debug/save_linked_bboxes_image.hh> +# include <scribo/debug/linked_bboxes_image.hh> # include <scribo/debug/usage.hh> @@ -321,13 +321,13 @@ namespace scribo if (debug) { std::cerr << "BEFORE - ncomponents = " << filtered_components.nelements() << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, right_link, - literal::red, literal::cyan, - literal::yellow, - literal::green, - anchor::MassCenter, - scribo::make::debug_filename("links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, right_link, + literal::red, literal::cyan, + literal::yellow, + literal::green, + anchor::MassCenter), + scribo::make::debug_filename("links.ppm")); } #endif diff --git a/scribo/src/debug/show_links_several_right_overlap.cc b/scribo/src/debug/show_links_several_right_overlap.cc index ae27e55..5559fec 100644 --- a/scribo/src/debug/show_links_several_right_overlap.cc +++ b/scribo/src/debug/show_links_several_right_overlap.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -48,8 +48,6 @@ #include <scribo/primitive/link/compute_several.hh> #include <scribo/draw/bounding_boxes.hh> - -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_down.cc b/scribo/src/debug/show_links_single_down.cc index f1ed130..8ea3d6a 100644 --- a/scribo/src/debug/show_links_single_down.cc +++ b/scribo/src/debug/show_links_single_down.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -46,7 +46,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_down_left_aligned.cc b/scribo/src/debug/show_links_single_down_left_aligned.cc index ea31db7..5804799 100644 --- a/scribo/src/debug/show_links_single_down_left_aligned.cc +++ b/scribo/src/debug/show_links_single_down_left_aligned.cc @@ -49,7 +49,7 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -94,8 +94,9 @@ int main(int argc, char* argv[]) down_links = filter::object_links_left_aligned(down_links, 5); - scribo::debug::save_linked_bboxes_image(input, down_links, - literal::blue, literal::green, - anchor::ActualLeft, - argv[3]); + io::ppm::save(scribo::debug::linked_bboxes_image(input, down_links, + literal::blue, + literal::green, + anchor::StrictLeft), + argv[3]); } diff --git a/scribo/src/debug/show_links_single_down_right_aligned.cc b/scribo/src/debug/show_links_single_down_right_aligned.cc index d261e5c..38cc335 100644 --- a/scribo/src/debug/show_links_single_down_right_aligned.cc +++ b/scribo/src/debug/show_links_single_down_right_aligned.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -49,7 +49,7 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -95,8 +95,8 @@ int main(int argc, char* argv[]) down_links = filter::object_links_right_aligned(down_links, 5); - scribo::debug::save_linked_bboxes_image(input, down_links, - literal::blue, literal::green, - anchor::ActualRight, - argv[3]); + io::ppm::save(scribo::debug::linked_bboxes_image(input, down_links, + literal::blue, literal::green, + anchor::StrictRight), + argv[3]); } diff --git a/scribo/src/debug/show_links_single_left.cc b/scribo/src/debug/show_links_single_left.cc index 2211ce1..dfcb07b 100644 --- a/scribo/src/debug/show_links_single_left.cc +++ b/scribo/src/debug/show_links_single_left.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -47,7 +47,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_left_dmax_ratio.cc b/scribo/src/debug/show_links_single_left_dmax_ratio.cc index 9b48a42..c1d6b01 100644 --- a/scribo/src/debug/show_links_single_left_dmax_ratio.cc +++ b/scribo/src/debug/show_links_single_left_dmax_ratio.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -47,7 +47,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_right.cc b/scribo/src/debug/show_links_single_right.cc index 2392e62..9b37c44 100644 --- a/scribo/src/debug/show_links_single_right.cc +++ b/scribo/src/debug/show_links_single_right.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -47,7 +47,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_right_dmax_ratio.cc b/scribo/src/debug/show_links_single_right_dmax_ratio.cc index 5b292ed..133fe82 100644 --- a/scribo/src/debug/show_links_single_right_dmax_ratio.cc +++ b/scribo/src/debug/show_links_single_right_dmax_ratio.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -47,7 +47,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_up.cc b/scribo/src/debug/show_links_single_up.cc index db9d3e7..1933af1 100644 --- a/scribo/src/debug/show_links_single_up.cc +++ b/scribo/src/debug/show_links_single_up.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -46,7 +46,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_up_left_aligned.cc b/scribo/src/debug/show_links_single_up_left_aligned.cc index d0df1e4..839aad8 100644 --- a/scribo/src/debug/show_links_single_up_left_aligned.cc +++ b/scribo/src/debug/show_links_single_up_left_aligned.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -49,7 +49,7 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -96,8 +96,9 @@ int main(int argc, char* argv[]) up_links = filter::object_links_left_aligned(up_links, 5); - scribo::debug::save_linked_bboxes_image(input, up_links, - literal::blue, literal::green, - anchor::ActualLeft, - argv[3]); + io::ppm::save(scribo::debug::linked_bboxes_image(input, up_links, + literal::blue, + literal::green, + anchor::StrictLeft), + argv[3]); } diff --git a/scribo/src/debug/show_links_single_up_right_aligned.cc b/scribo/src/debug/show_links_single_up_right_aligned.cc index 3f40daf..561fbe9 100644 --- a/scribo/src/debug/show_links_single_up_right_aligned.cc +++ b/scribo/src/debug/show_links_single_up_right_aligned.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -49,7 +49,7 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -94,8 +94,9 @@ int main(int argc, char* argv[]) up_links = filter::object_links_right_aligned(up_links, 5); - scribo::debug::save_linked_bboxes_image(input, up_links, - literal::blue, literal::green, - anchor::ActualRight, - argv[3]); + io::ppm::save(scribo::debug::linked_bboxes_image(input, up_links, + literal::blue, + literal::green, + anchor::StrictRight), + argv[3]); } diff --git a/scribo/src/debug/show_separators.cc b/scribo/src/debug/show_separators.cc index ef80da6..40e2fde 100644 --- a/scribo/src/debug/show_separators.cc +++ b/scribo/src/debug/show_separators.cc @@ -18,13 +18,15 @@ #include <mln/core/alias/box2d.hh> #include <mln/core/alias/neighb2d.hh> #include <mln/io/pbm/all.hh> +#include <mln/io/ppm/save.hh> #include <mln/arith/plus.hh> #include <mln/labeling/foreground.hh> +#include <mln/labeling/compute.hh> #include <scribo/primitive/extract/lines_h_pattern.hh> #include <scribo/primitive/extract/lines_v_pattern.hh> #include <scribo/debug/usage.hh> -#include <scribo/debug/save_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> const char *args_desc[][2] = @@ -90,7 +92,7 @@ int main(int argc, char *argv[]) image2d<value::int_u8> lbl = labeling::foreground(v_lines, c4(), nlabels); mln::util::array<box2d> bbox = labeling::compute(accu::shape::bbox<point2d>(), lbl, nlabels); - scribo::debug::save_bboxes_image(input, bbox, argv[4], literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, bbox, literal::red), argv[4]); trace::exiting("main"); } diff --git a/scribo/src/primitive/group/group_from_double_link.cc b/scribo/src/primitive/group/group_from_double_link.cc index 39b1bb9..ec4e180 100644 --- a/scribo/src/primitive/group/group_from_double_link.cc +++ b/scribo/src/primitive/group/group_from_double_link.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -41,11 +41,11 @@ #include <scribo/primitive/group/apply.hh> #include <scribo/primitive/link/with_single_left_link.hh> #include <scribo/primitive/link/with_single_right_link.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/primitive/group/from_double_link.hh> #include <scribo/filter/objects_small.hh> -#include <scribo/debug/save_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> #include <scribo/make/debug_filename.hh> @@ -95,12 +95,14 @@ int main(int argc, char *argv[]) std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, right_link, - literal::red, literal::cyan, literal::yellow, - literal::green, - anchor::MassCenter, - scribo::make::debug_filename("links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, right_link, + literal::red, + literal::cyan, + literal::yellow, + literal::green, + anchor::MassCenter), + scribo::make::debug_filename("links.ppm")); // With validation. object_groups<L> groups @@ -116,8 +118,8 @@ int main(int argc, char *argv[]) std::cout << "AFTER double grouping - nbboxes = " << grouped_text.nelements() << std::endl; - scribo::debug::save_bboxes_image(input, grouped_text, - scribo::make::debug_filename("bboxes.ppm"), - literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_text, + literal::red), + scribo::make::debug_filename("bboxes.ppm")); } diff --git a/scribo/src/primitive/group/group_from_double_several_links.cc b/scribo/src/primitive/group/group_from_double_several_links.cc index 2a49b33..86b3cf4 100644 --- a/scribo/src/primitive/group/group_from_double_several_links.cc +++ b/scribo/src/primitive/group/group_from_double_several_links.cc @@ -41,11 +41,11 @@ #include <scribo/primitive/group/apply.hh> #include <scribo/primitive/link/with_several_left_links.hh> #include <scribo/primitive/link/with_several_right_links.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/primitive/group/from_double_link.hh> #include <scribo/filter/objects_small.hh> -#include <scribo/debug/save_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> #include <scribo/make/debug_filename.hh> int usage(const char *name) @@ -89,12 +89,15 @@ int main(int argc, char* argv[]) std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, right_link, - literal::red, literal::cyan, literal::yellow, - literal::green, - anchor::Center, - scribo::make::debug_filename("links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, + right_link, + literal::red, + literal::cyan, + literal::yellow, + literal::green, + anchor::Center), + scribo::make::debug_filename("links.ppm")); // With validation. std::cout << "Group from double link" << std::endl; @@ -111,8 +114,8 @@ int main(int argc, char* argv[]) std::cout << "AFTER double grouping - nbboxes = " << grouped_comps.nelements() << std::endl; - scribo::debug::save_bboxes_image(input, grouped_comps, - scribo::make::debug_filename("bboxes.ppm"), - literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_comps, + literal::red), + scribo::make::debug_filename("bboxes.ppm")); } diff --git a/scribo/src/primitive/group/group_from_several_left_links.cc b/scribo/src/primitive/group/group_from_several_left_links.cc index ef70a19..42ad98a 100644 --- a/scribo/src/primitive/group/group_from_several_left_links.cc +++ b/scribo/src/primitive/group/group_from_several_left_links.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -46,8 +46,8 @@ #include <scribo/primitive/link/with_several_left_links.hh> #include <scribo/primitive/group/from_single_link.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/make/debug_filename.hh> int usage(const char *name) @@ -80,10 +80,11 @@ int main(int argc, char* argv[]) = primitive::link::with_several_left_links(comps, 30); std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, - literal::red, literal::cyan, - scribo::make::debug_filename("left_links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, + literal::red, + literal::cyan), + scribo::make::debug_filename("left_links.ppm")); object_groups<L> @@ -96,9 +97,9 @@ int main(int argc, char* argv[]) grouped_comps.labeled_image(), grouped_comps.nelements()), scribo::make::debug_filename("left_label_color.ppm")); - scribo::debug::save_bboxes_image(input, grouped_comps, - scribo::make::debug_filename("left_bboxes.ppm"), - literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_comps, + literal::red), + scribo::make::debug_filename("left_bboxes.ppm")); } } diff --git a/scribo/src/primitive/group/group_from_single_link.cc b/scribo/src/primitive/group/group_from_single_link.cc index 5b5f710..fc904a0 100644 --- a/scribo/src/primitive/group/group_from_single_link.cc +++ b/scribo/src/primitive/group/group_from_single_link.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -44,8 +44,8 @@ #include <scribo/primitive/group/from_single_link.hh> #include <scribo/primitive/group/apply.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/make/debug_filename.hh> @@ -80,10 +80,11 @@ int main(int argc, char* argv[]) = primitive::link::with_single_left_link(comps, 30); std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, - literal::red, literal::cyan, - scribo::make::debug_filename("left_links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, + literal::red, + literal::cyan), + scribo::make::debug_filename("left_links.ppm")); // io::ppm::save(mln::labeling::colorize(value::rgb8(), // comps, // comps.nlabels()), @@ -99,8 +100,9 @@ int main(int argc, char* argv[]) grouped_comps.labeled_image(), grouped_comps.nelements()), scribo::make::debug_filename("left_label_color.ppm")); - scribo::debug::save_bboxes_image(input, grouped_comps, - scribo::make::debug_filename("left_bboxes.ppm"), literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_comps, + literal::red), + scribo::make::debug_filename("left_bboxes.ppm")); } { @@ -109,10 +111,10 @@ int main(int argc, char* argv[]) = primitive::link::with_single_right_link(comps, 30); std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - right_link, - literal::red, literal::cyan, - scribo::make::debug_filename("right_links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + right_link, + literal::red, literal::cyan), + scribo::make::debug_filename("right_links.ppm")); // io::ppm::save(mln::labeling::colorize(value::rgb8(), // comps, // comps.nlabels()), @@ -129,9 +131,9 @@ int main(int argc, char* argv[]) scribo::make::debug_filename("right_label_color.ppm")); std::cout << "AFTER - nbboxes = " << grouped_comps.nelements() << std::endl; - scribo::debug::save_bboxes_image(input, grouped_comps, - scribo::make::debug_filename("right_bboxes.ppm"), - literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_comps, + literal::red), + scribo::make::debug_filename("right_bboxes.ppm")); } diff --git a/scribo/src/text_in_picture.cc b/scribo/src/text_in_picture.cc index 77cf7b6..af00c4f 100644 --- a/scribo/src/text_in_picture.cc +++ b/scribo/src/text_in_picture.cc @@ -75,8 +75,7 @@ #include <scribo/debug/text_areas_image.hh> #include <scribo/debug/decision_image.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -342,13 +341,13 @@ int main(int argc, char* argv[]) if (debug) { std::cerr << "BEFORE - ncomponents = " << filtered_components.nelements() << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, right_link, - literal::red, literal::cyan, - literal::yellow, - literal::green, - anchor::MassCenter, - scribo::make::debug_filename("links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, right_link, + literal::red, literal::cyan, + literal::yellow, + literal::green, + anchor::MassCenter), + scribo::make::debug_filename("links.ppm")); } #endif diff --git a/scribo/src/text_in_picture_neg.cc b/scribo/src/text_in_picture_neg.cc index 8d818e0..2b06a72 100644 --- a/scribo/src/text_in_picture_neg.cc +++ b/scribo/src/text_in_picture_neg.cc @@ -92,8 +92,6 @@ #include <scribo/debug/text_areas_image.hh> #include <scribo/debug/decision_image.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/text_recognition_in_picture.cc b/scribo/src/text_recognition_in_picture.cc index 8b76f48..de7a9ed 100644 --- a/scribo/src/text_recognition_in_picture.cc +++ b/scribo/src/text_recognition_in_picture.cc @@ -95,8 +95,6 @@ #include <scribo/debug/highlight_text_area.hh> #include <scribo/debug/decision_image.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/tests/filter/components_large.cc b/scribo/tests/filter/components_large.cc index 543b90d..4a7a10b 100644 --- a/scribo/tests/filter/components_large.cc +++ b/scribo/tests/filter/components_large.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -40,10 +40,6 @@ #include <scribo/primitive/group/from_single_link.hh> #include <scribo/filter/objects_large.hh> -#include <scribo/make/debug_filename.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> - #include "tests/data.hh" int main() diff --git a/scribo/tests/filter/components_small.cc b/scribo/tests/filter/components_small.cc index d9b5325..d5d466c 100644 --- a/scribo/tests/filter/components_small.cc +++ b/scribo/tests/filter/components_small.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -40,10 +40,6 @@ #include <scribo/primitive/group/from_single_link.hh> #include <scribo/filter/objects_small.hh> -#include <scribo/make/debug_filename.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> - #include "tests/data.hh" -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
last-svn-commit-794-g5c06e04 Some changes in debug routines.
by Guillaume Lazzara
* scribo/debug/save_bboxes_image.hh, * scribo/debug/save_linked_bboxes_image.hh: Rename as... * scribo/debug/bboxes_image.hh, * scribo/debug/linked_bboxes_image.hh: ... this. * scribo/debug/links_image.hh: New. * scribo/debug/several_links_decision_image.hh: Remove. Deprecated. * scribo/debug/alignment_decision_image.hh: Make use of compute_anchor routine. * scribo/debug/all.hh, * scribo/table/extract.hh, * scribo/toolchain/text_in_picture.hh, * src/debug/show_links_several_right_overlap.cc, * src/debug/show_links_single_down.cc, * src/debug/show_links_single_down_left_aligned.cc, * src/debug/show_links_single_down_right_aligned.cc, * src/debug/show_links_single_left.cc, * src/debug/show_links_single_left_dmax_ratio.cc, * src/debug/show_links_single_right.cc, * src/debug/show_links_single_right_dmax_ratio.cc, * src/debug/show_links_single_up.cc, * src/debug/show_links_single_up_left_aligned.cc, * src/debug/show_links_single_up_right_aligned.cc, * src/debug/show_separators.cc, * src/primitive/group/group_from_double_link.cc, * src/primitive/group/group_from_double_several_links.cc, * src/primitive/group/group_from_several_left_links.cc, * src/primitive/group/group_from_single_link.cc, * src/text_in_picture.cc, * src/text_in_picture_neg.cc, * src/text_recognition_in_picture.cc, * tests/filter/components_large.cc, * tests/filter/components_small.cc: Update includes. --- scribo/ChangeLog | 34 +++ scribo/scribo/debug/alignment_decision_image.hh | 87 ++------- scribo/scribo/debug/all.hh | 7 +- .../{save_bboxes_image.hh => bboxes_image.hh} | 82 ++++---- ...nked_bboxes_image.hh => linked_bboxes_image.hh} | 213 +++++++++----------- .../{links_decision_image.hh => links_image.hh} | 77 ++++---- .../scribo/debug/several_links_decision_image.hh | 179 ---------------- scribo/scribo/table/extract.hh | 6 +- scribo/scribo/toolchain/text_in_picture.hh | 20 +- .../src/debug/show_links_several_right_overlap.cc | 6 +- scribo/src/debug/show_links_single_down.cc | 5 +- .../debug/show_links_single_down_left_aligned.cc | 11 +- .../debug/show_links_single_down_right_aligned.cc | 14 +- scribo/src/debug/show_links_single_left.cc | 5 +- .../src/debug/show_links_single_left_dmax_ratio.cc | 5 +- scribo/src/debug/show_links_single_right.cc | 5 +- .../debug/show_links_single_right_dmax_ratio.cc | 5 +- scribo/src/debug/show_links_single_up.cc | 5 +- .../src/debug/show_links_single_up_left_aligned.cc | 15 +- .../debug/show_links_single_up_right_aligned.cc | 15 +- scribo/src/debug/show_separators.cc | 6 +- .../src/primitive/group/group_from_double_link.cc | 28 ++-- .../group/group_from_double_several_links.cc | 25 ++- .../group/group_from_several_left_links.cc | 23 +- .../src/primitive/group/group_from_single_link.cc | 36 ++-- scribo/src/text_in_picture.cc | 17 +- scribo/src/text_in_picture_neg.cc | 2 - scribo/src/text_recognition_in_picture.cc | 2 - scribo/tests/filter/components_large.cc | 8 +- scribo/tests/filter/components_small.cc | 8 +- 30 files changed, 357 insertions(+), 594 deletions(-) rename scribo/scribo/debug/{save_bboxes_image.hh => bboxes_image.hh} (65%) rename scribo/scribo/debug/{save_linked_bboxes_image.hh => linked_bboxes_image.hh} (54%) copy scribo/scribo/debug/{links_decision_image.hh => links_image.hh} (58%) delete mode 100644 scribo/scribo/debug/several_links_decision_image.hh diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 714874c..439db69 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,3 +1,37 @@ +2011-03-14 Guillaume Lazzara <z(a)lrde.epita.fr> + + Rename debug routines. + + * scribo/debug/save_bboxes_image.hh, + * scribo/debug/save_linked_bboxes_image.hh: Rename as... + * scribo/debug/bboxes_image.hh, + * scribo/debug/linked_bboxes_image.hh: ... this. + + * scribo/debug/all.hh, + * scribo/table/extract.hh, + * scribo/toolchain/text_in_picture.hh, + * src/debug/show_links_several_right_overlap.cc, + * src/debug/show_links_single_down.cc, + * src/debug/show_links_single_down_left_aligned.cc, + * src/debug/show_links_single_down_right_aligned.cc, + * src/debug/show_links_single_left.cc, + * src/debug/show_links_single_left_dmax_ratio.cc, + * src/debug/show_links_single_right.cc, + * src/debug/show_links_single_right_dmax_ratio.cc, + * src/debug/show_links_single_up.cc, + * src/debug/show_links_single_up_left_aligned.cc, + * src/debug/show_links_single_up_right_aligned.cc, + * src/debug/show_separators.cc, + * src/primitive/group/group_from_double_link.cc, + * src/primitive/group/group_from_double_several_links.cc, + * src/primitive/group/group_from_several_left_links.cc, + * src/primitive/group/group_from_single_link.cc, + * src/text_in_picture.cc, + * src/text_in_picture_neg.cc, + * src/text_recognition_in_picture.cc, + * tests/filter/components_large.cc, + * tests/filter/components_small.cc: Update includes. + 2011-03-11 Guillaume Lazzara <z(a)lrde.epita.fr> Add HAVE_QT guards. diff --git a/scribo/scribo/debug/alignment_decision_image.hh b/scribo/scribo/debug/alignment_decision_image.hh index 841bd38..450091d 100644 --- a/scribo/scribo/debug/alignment_decision_image.hh +++ b/scribo/scribo/debug/alignment_decision_image.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -36,12 +37,12 @@ # include <mln/literal/colors.hh> # include <mln/util/array.hh> # include <mln/util/couple.hh> -# include <mln/norm/l1.hh> # include <scribo/core/component_set.hh> # include <scribo/core/object_groups.hh> # include <scribo/draw/bounding_boxes.hh> +# include <scribo/primitive/link/internal/compute_anchor.hh> namespace scribo { @@ -51,8 +52,6 @@ namespace scribo using namespace mln; - enum Alignment { top, center, bottom }; - /*! \brief Save a color image showing the difference between to object links. @@ -70,54 +69,17 @@ namespace scribo alignment_decision_image(const Image<I>& input_, const object_links<L>& links, const object_links<L>& filtered_links, - const Alignment& alignment); + const anchor::Type& anchor); # ifndef MLN_INCLUDE_ONLY - - namespace internal - { - - template <typename L> - mln::util::couple<mln_site(L),mln_site(L)> - find_anchors(const component_set<L>& components, - unsigned i, - unsigned link_i, - const Alignment& alignment) - { - mln_site(L) - a1 = components(i).bbox().pcenter(), - a2 = components(link_i).bbox().pcenter(); - - switch (alignment) - { - case top: - a1.row() = components(i).bbox().pmin().row(); - a2.row() = components(link_i).bbox().pmin().row(); - break; - - case center: - break; - - case bottom: - a1.row() = components(i).bbox().pmax().row(); - a2.row() = components(link_i).bbox().pmax().row(); - break; - - } - return make::couple(a1, a2); - } - - } - template <typename I, typename L> mln_ch_value(I,value::rgb8) - alignment_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links, - const Alignment& alignment, - unsigned max_link_length) + alignment_decision_image(const Image<I>& input_, + const object_links<L>& links, + const object_links<L>& filtered_links, + const anchor::Type& anchor) { trace::entering("scribo::debug::alignment_decision_image"); const I& input = exact(input_); @@ -138,43 +100,26 @@ namespace scribo typedef mln_site(L) P; for_all_links(i, links) - { if (links(i) != i) { value::rgb8 value = literal::green; + P + anchor_i = primitive::link::internal::compute_anchor(components, + i, anchor), + anchor_li = primitive::link::internal::compute_anchor(components, + links(i), + anchor); + if (links(i) != filtered_links(i)) value = literal::red; - mln::util::couple<P,P> - anchors = internal::find_anchors(components, i, links(i), alignment); - if (mln::norm::l1_distance(anchors.first().to_vec(), anchors.second().to_vec()) < max_link_length) - mln::draw::line(decision_image, - anchors.first(), - anchors.second(), - value); + mln::draw::line(decision_image, anchor_i, anchor_li, value); } - } trace::exiting("scribo::debug::alignment_decision_image"); return decision_image; } - - template <typename I, typename L> - mln_ch_value(I,value::rgb8) - alignment_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links, - const Alignment& alignment) - { - return alignment_decision_image(input_, - links, - filtered_links, - alignment, - mln_max(unsigned)); - } - - # endif // ! MLN_INCLUDE_ONLY } // end of namespace scribo::debug diff --git a/scribo/scribo/debug/all.hh b/scribo/scribo/debug/all.hh index f7ffe1c..7181ec1 100644 --- a/scribo/scribo/debug/all.hh +++ b/scribo/scribo/debug/all.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -41,9 +42,9 @@ namespace scribo } // end of namespace scribo -# include <scribo/debug/save_bboxes_image.hh> +# include <scribo/debug/bboxes_image.hh> # include <scribo/debug/save_label_image.hh> -# include <scribo/debug/save_linked_bboxes_image.hh> +# include <scribo/debug/linked_bboxes_image.hh> # include <scribo/debug/save_table_image.hh> #endif // ! SCRIBO_DEBUG_ALL_HH diff --git a/scribo/scribo/debug/save_bboxes_image.hh b/scribo/scribo/debug/bboxes_image.hh similarity index 65% rename from scribo/scribo/debug/save_bboxes_image.hh rename to scribo/scribo/debug/bboxes_image.hh index ee781c1..ca3d646 100644 --- a/scribo/scribo/debug/save_bboxes_image.hh +++ b/scribo/scribo/debug/bboxes_image.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -24,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_DEBUG_SAVE_BBOXES_IMAGE_HH -# define SCRIBO_DEBUG_SAVE_BBOXES_IMAGE_HH +#ifndef SCRIBO_DEBUG_BBOXES_IMAGE_HH +# define SCRIBO_DEBUG_BBOXES_IMAGE_HH /// \file /// @@ -53,18 +53,16 @@ namespace scribo /// Draw a list of bounding boxes template <typename I> - void - save_bboxes_image(const Image<I>& input, + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, const mln::util::array< box<mln_site(I)> >& bboxes, - const std::string& filename, const value::rgb8& value); template <typename I, typename L> - void - save_bboxes_image(const Image<I>& input, + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, const line_set<L>& lines, - const std::string& filename, const value::rgb8& value); /// \overload @@ -72,50 +70,46 @@ namespace scribo // template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, - const line_set<L>& lines, - const std::string& filename); + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, + const line_set<L>& lines); /// \overload. template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, const component_set<L>& comps, - const std::string& filename, const value::rgb8& value); # ifndef MLN_INCLUDE_ONLY template <typename I> inline - void - save_bboxes_image(const Image<I>& input, - const mln::util::array< box<mln_site(I)> >& bboxes, - const std::string& filename, - const value::rgb8& value) + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, + const mln::util::array< box<mln_site(I)> >& bboxes, + const value::rgb8& value) { - trace::entering("scribo::debug::save_bboxes_image"); + trace::entering("scribo::debug::bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input); draw::bounding_boxes(tmp, bboxes, value); - mln::io::ppm::save(tmp, filename); - trace::exiting("scribo::debug::save_bboxes_image"); + trace::exiting("scribo::debug::bboxes_image"); + return tmp; } template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, const line_set<L>& lines, - const std::string& filename, const value::rgb8& value) { - trace::entering("scribo::debug::save_bboxes_image"); + trace::entering("scribo::debug::bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I, value::rgb8) @@ -125,31 +119,29 @@ namespace scribo if (! lines(l).is_hidden()) mln::draw::box(output, lines(l).bbox(), value); - mln::io::ppm::save(output, filename); - trace::exiting("scribo::debug::save_bboxes_image"); + trace::exiting("scribo::debug::bboxes_image"); + return output; } template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, - const line_set<L>& lines, - const std::string& filename) + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, + const line_set<L>& lines) { - return save_bboxes_image(input, lines, filename, literal::red); + return bboxes_image(input, lines, literal::red); } template <typename I, typename L> inline - void - save_bboxes_image(const Image<I>& input, - const component_set<L>& comps, - const std::string& filename, - const value::rgb8& value) + mln_ch_value(I, value::rgb8) + bboxes_image(const Image<I>& input, + const component_set<L>& comps, + const value::rgb8& value) { - trace::entering("scribo::debug::save_bboxes_image"); + trace::entering("scribo::debug::bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I, value::rgb8) @@ -159,8 +151,8 @@ namespace scribo if (comps(c).is_valid()) mln::draw::box(output, comps(c).bbox(), value); - mln::io::ppm::save(output, filename); - trace::exiting("scribo::debug::save_bboxes_image"); + trace::exiting("scribo::debug::bboxes_image"); + return output; } @@ -171,4 +163,4 @@ namespace scribo } // end of namespace scribo -#endif // ! SCRIBO_DEBUG_SAVE_BBOXES_IMAGE_HH +#endif // ! SCRIBO_DEBUG_BBOXES_IMAGE_HH diff --git a/scribo/scribo/debug/save_linked_bboxes_image.hh b/scribo/scribo/debug/linked_bboxes_image.hh similarity index 54% rename from scribo/scribo/debug/save_linked_bboxes_image.hh rename to scribo/scribo/debug/linked_bboxes_image.hh index d4c940a..2373405 100644 --- a/scribo/scribo/debug/save_linked_bboxes_image.hh +++ b/scribo/scribo/debug/linked_bboxes_image.hh @@ -24,12 +24,12 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef SCRIBO_DEBUG_SAVE_LINKED_BBOXES_IMAGE_HH -# define SCRIBO_DEBUG_SAVE_LINKED_BBOXES_IMAGE_HH +#ifndef SCRIBO_DEBUG_LINKED_BBOXES_IMAGE_HH +# define SCRIBO_DEBUG_LINKED_BBOXES_IMAGE_HH /// \file /// -/// Save the bounding box links image. +/// Compute the bounding box links image. # include <mln/core/concept/image.hh> # include <mln/core/concept/graph.hh> @@ -56,54 +56,50 @@ namespace scribo using namespace mln; - /// Save the line of components links image. + /// Compute the line of components links image. /// /// \param[in,out] input The binary from where the components are extracted. /// \param[in] link_array Lines of components links. /// \param[in] box_value Value used to draw line bounding boxes. /// \param[in] link_value Value used to draw line links. - /// \param[in] filename The target file name. /// \param[in] anchor Anchor from where the links are drawn. // template <typename I, typename L> - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& array, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename); + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& array, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor); /// \overload /// The default anchor type is set to anchor::Center. // template <typename I, typename L> - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& array, - const value::rgb8& box_value, - const value::rgb8& link_value, - const std::string& filename); - - /// Save the line of components left and right links image. + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& array, + const value::rgb8& box_value, + const value::rgb8& link_value); + + /// Compute the line of components left and right links image. /// /// \param[in,out] input The binary from where the components are extracted. /// \param[in] left_link Lines of components left links. /// \param[in] right_link Lines of components right links. /// \param[in] box_value Value used to draw line bounding boxes. /// \param[in] link_value Value used to draw line links. - /// \param[in] filename The target file name. + // template <typename I, typename L> - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& left_link, - const object_links<L>& right_link, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename); - - /// Save the line of components left and right links image. + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& left_link, + const object_links<L>& right_link, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor); + + /// Compute the line of components left and right links image. /// Draw also validated links. /// /// \param[in,out] input The binary from where the components are extracted. @@ -113,36 +109,34 @@ namespace scribo /// \param[in] left_link_value Value used to draw line left links. /// \param[in] right_link_value Value used to draw line left links. /// \param[in] validated_link_value Value used to draw line validated links. - /// \param[in] filename The target file name. + // template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& left_link, - const object_links<L>& right_link, - const value::rgb8& box_value, - const value::rgb8& left_link_value, - const value::rgb8& right_link_value, - const value::rgb8& validated_link_value, - anchor::Type anchor, - const std::string& filename); - - - /// Save the line link graph image. + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& left_link, + const object_links<L>& right_link, + const value::rgb8& box_value, + const value::rgb8& left_link_value, + const value::rgb8& right_link_value, + const value::rgb8& validated_link_value, + anchor::Type anchor); + + + /// Compute the line link graph image. /// /// \param[in,out] input The binary from where the components are extracted. /// \param[in] g The link graph. /// \param[in] box_value Value used to draw line bounding boxes. /// \param[in] link_value Value used to draw line links. - /// \param[in] filename The target file name. + // template <typename I, typename L, typename G> - void - save_linked_bboxes_image(const Image<I>& input, - const Graph<G>& g, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename); + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const Graph<G>& g, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor); # ifndef MLN_INCLUDE_ONLY @@ -150,15 +144,14 @@ namespace scribo template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& links, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& links, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor) { - trace::entering("scribo::debug::save_linked_bboxes_image"); + trace::entering("scribo::debug::linked_bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input); @@ -166,63 +159,58 @@ namespace scribo draw::bounding_boxes(tmp, links.components(), box_value); draw::bounding_box_links(tmp, links, link_value, anchor); - mln::io::ppm::save(tmp, filename); - - trace::exiting("scribo::debug::save_linked_bboxes_image"); + trace::exiting("scribo::debug::linked_bboxes_image"); + return tmp; } template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& links, - const value::rgb8& box_value, - const value::rgb8& link_value, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& links, + const value::rgb8& box_value, + const value::rgb8& link_value) { - save_linked_bboxes_image(input, links, box_value, - link_value, anchor::Center, filename); + return linked_bboxes_image(input, links, box_value, + link_value, anchor::Center); } template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& left_link, - const object_links<L>& right_link, - const value::rgb8& box_value, - const value::rgb8& value, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& left_link, + const object_links<L>& right_link, + const value::rgb8& box_value, + const value::rgb8& value) { - save_linked_bboxes_image(input, - left_link, - right_link, - box_value, - literal::yellow, - literal::cyan, - value, - anchor::Center, - filename); + return linked_bboxes_image(input, + left_link, + right_link, + box_value, + literal::yellow, + literal::cyan, + value, + anchor::Center); } template <typename I, typename L> inline - void - save_linked_bboxes_image(const Image<I>& input, - const object_links<L>& left_link, - const object_links<L>& right_link, - const value::rgb8& box_value, - const value::rgb8& left_link_value, - const value::rgb8& right_link_value, - const value::rgb8& validated_link_value, - anchor::Type anchor, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const object_links<L>& left_link, + const object_links<L>& right_link, + const value::rgb8& box_value, + const value::rgb8& left_link_value, + const value::rgb8& right_link_value, + const value::rgb8& validated_link_value, + anchor::Type anchor) { - trace::entering("scribo::debug::save_linked_bboxes_image"); + trace::entering("scribo::debug::linked_bboxes_image"); mln_precondition(exact(input).is_valid()); mln_ch_value(I,value::rgb8) tmp = data::convert(value::rgb8(), input); @@ -234,24 +222,22 @@ namespace scribo validated_link_value, anchor); - mln::io::ppm::save(tmp, filename); - - trace::exiting("scribo::debug::save_linked_bboxes_image"); + trace::exiting("scribo::debug::linked_bboxes_image"); + return tmp; } template <typename I, typename L, typename G> inline - void - save_linked_bboxes_image(const Image<I>& input, - const Graph<G>& g, - const value::rgb8& box_value, - const value::rgb8& link_value, - anchor::Type anchor, - const std::string& filename) + mln_ch_value(I,value::rgb8) + linked_bboxes_image(const Image<I>& input, + const Graph<G>& g, + const value::rgb8& box_value, + const value::rgb8& link_value, + anchor::Type anchor) { - trace::entering("scribo::debug::save_linked_bboxes_image"); + trace::entering("scribo::debug::linked_bboxes_image"); mln_precondition(exact(g).is_valid()); mln_precondition(exact(input).is_valid()); @@ -261,9 +247,8 @@ namespace scribo draw::bounding_box_links(tmp, exact(g).components(), g, link_value, anchor); - mln::io::ppm::save(tmp, filename); - - trace::exiting("scribo::debug::save_linked_bboxes_image"); + trace::exiting("scribo::debug::linked_bboxes_image"); + return tmp; } @@ -274,4 +259,4 @@ namespace scribo } // end of namespace scribo -#endif // ! SCRIBO_DEBUG_SAVE_LINKED_BBOXES_IMAGE_HH +#endif // ! SCRIBO_DEBUG_LINKED_BBOXES_IMAGE_HH diff --git a/scribo/scribo/debug/links_decision_image.hh b/scribo/scribo/debug/links_image.hh similarity index 58% copy from scribo/scribo/debug/links_decision_image.hh copy to scribo/scribo/debug/links_image.hh index 387cd7f..76447b7 100644 --- a/scribo/scribo/debug/links_decision_image.hh +++ b/scribo/scribo/debug/links_image.hh @@ -1,5 +1,4 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -24,21 +23,23 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef SCRIBO_DEBUG_LINKS_DECISION_IMAGE_HH -# define SCRIBO_DEBUG_LINKS_DECISION_IMAGE_HH +#ifndef SCRIBO_DEBUG_LINKS_IMAGE_HH +# define SCRIBO_DEBUG_LINKS_IMAGE_HH /// \file /// -/// Save a color image showing the difference between to object groups. +/// Save a color image showing components links. # include <mln/core/concept/image.hh> +# include <mln/accu/center.hh> # include <mln/data/convert.hh> # include <mln/value/rgb8.hh> # include <mln/literal/colors.hh> -# include <mln/draw/box.hh> # include <mln/draw/line.hh> # include <scribo/core/object_links.hh> +# include <scribo/draw/bounding_boxes.hh> +# include <scribo/primitive/link/internal/compute_anchor.hh> namespace scribo @@ -52,52 +53,46 @@ namespace scribo /// FIXME: DOC! template <typename I, typename L> mln_ch_value(I,value::rgb8) - links_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links); + links_image(const Image<I>& input_, + const object_links<L>& links, + anchor::Type anchor); + # ifndef MLN_INCLUDE_ONLY + template <typename I, typename L> mln_ch_value(I,value::rgb8) - links_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links) + links_image(const Image<I>& input_, + const object_links<L>& links, + anchor::Type anchor) { - trace::entering("scribo::debug::links_decision_image"); + trace::entering("scribo::debug::links_image"); const I& input = exact(input_); - const component_set<L>& comps = links.components(); - mln_precondition(input.is_valid()); - mln_precondition(comps.is_valid()); mln_precondition(links.is_valid()); - mln_precondition(filtered_links.is_valid()); - mln_precondition(links.size() == filtered_links.size()); - /// Fixme: check that objects has been computed from input. - - image2d<value::rgb8> - links_decision_image = data::convert(value::rgb8(), input); - for_all_comps(i, comps) - mln::draw::box(links_decision_image, comps(i).bbox(), literal::blue); - - for_all_links(i, links) - if (links(i) != i) - { - value::rgb8 value = literal::green; - if (links(i) != filtered_links(i)) - value = literal::red; - - mln_site(I) - p1 = comps(i).mass_center(), - p2 = comps(links(i)).mass_center(); - - mln::draw::line(links_decision_image, p1, p2, value); - } + const component_set<L>& comps = links.components(); - trace::exiting("scribo::debug::links_decision_image"); - return links_decision_image; + image2d<value::rgb8> + links_image = data::convert(value::rgb8(), input); + + scribo::draw::bounding_boxes(links_image, comps, literal::blue); + + for_all_links(l, links) + if (links(l) != l) + mln::draw::line(links_image, + primitive::link::internal::compute_anchor(comps, + l, + anchor), + primitive::link::internal::compute_anchor(comps, + links(l), + anchor), + literal::green); + + trace::exiting("scribo::debug::links_image"); + return links_image; } @@ -108,4 +103,4 @@ namespace scribo } // end of namespace scribo -#endif // ! SCRIBO_DEBUG_LINKS_DECISION_IMAGE_HH +#endif // ! SCRIBO_DEBUG_LINKS_IMAGE_HH diff --git a/scribo/scribo/debug/several_links_decision_image.hh b/scribo/scribo/debug/several_links_decision_image.hh deleted file mode 100644 index 73e66a1..0000000 --- a/scribo/scribo/debug/several_links_decision_image.hh +++ /dev/null @@ -1,179 +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_DEBUG_SEVERAL_LINKS_DECISION_IMAGE_HH -# define SCRIBO_DEBUG_SEVERAL_LINKS_DECISION_IMAGE_HH - -/// \file -/// -/// Save a color image showing the difference between to object groups. - -# include <mln/core/concept/image.hh> -# include <mln/accu/center.hh> -# include <mln/data/convert.hh> -# include <mln/value/rgb8.hh> -# include <mln/literal/colors.hh> -# include <mln/util/array.hh> - -# include <scribo/core/object_groups.hh> -# include <scribo/draw/bounding_boxes.hh> - - -namespace scribo -{ - - namespace debug - { - - using namespace mln; - - /// FIXME: DOC! - template <typename I, typename L> - mln_ch_value(I,value::rgb8) - several_links_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links); - - -# ifndef MLN_INCLUDE_ONLY - - - - namespace internal - { - - template <typename L, typename I> - bool - draw_line(const L& objects, I& output, - unsigned link, - const mln_site(L)& p1, const mln_site(L)& p2, - const mln_value(I)& value) - { - - if (objects.domain().has(p2)) - if (objects(p2) == link) - { - mln::draw::line(output, p1, p2, value); - return true; - } - return false; - } - - } - - - - template <typename I, typename L> - mln_ch_value(I,value::rgb8) - several_links_decision_image(const Image<I>& input_, - const object_links<L>& links, - const object_links<L>& filtered_links) - { - trace::entering("scribo::debug::several_links_decision_image"); - const I& input = exact(input_); - - const component_set<L>& comps = links.components(); - - mln_precondition(input.is_valid()); - mln_precondition(links.is_valid()); - mln_precondition(filtered_links.is_valid()); - - /// Fixme: check that objects has been computed from input. - - image2d<value::rgb8> - links_decision_image = data::convert(value::rgb8(), input); - - for_all_comps(c, comps) - mln::draw::box(links_decision_image, comps(c).bbox(), literal::blue); - - for_all_links(l, links) - { - if (links(l) != l) - { - value::rgb8 value = literal::green; - if (links(l) != filtered_links(l)) - value = literal::red; - - mln_site(L) c = comps(l).bbox().pcenter(); - - // Right link from the top anchor. - mln_site(L) a1 = c; - a1.row() = comps(l).bbox().pmin().row() - + (c.row() - comps(l).bbox().pmin().row()) / 4; - - // Right link from the central site - mln_site(I) p1 = comps(l).mass_center(); - - // Right link from the bottom anchor. - mln_site(L) a2 = c; - a2.row() = comps(l).bbox().pmax().row() - - (c.row() - comps(l).bbox().pmin().row()) / 4; - - mln_site(L) - a1_bak = a1, - a2_bak = a2; - - const L& lbl_ima = comps.labeled_image(); - - mln_site(L) tmp; - while(lbl_ima.domain().has(a1) - || lbl_ima.domain().has(a2) - || lbl_ima.domain().has(p1)) - { - if (internal::draw_line(lbl_ima, links_decision_image, links(l), - a1_bak, a1, value)) - break; - else - ++a1.col(); - - if (internal::draw_line(lbl_ima, links_decision_image, links(l), - comps(l).mass_center(), p1, value)) - break; - else - ++p1.col(); - - if (internal::draw_line(lbl_ima, links_decision_image, links(l), - a2_bak, a2, value)) - break; - else - ++a2.col(); - - } - } - } - - trace::exiting("scribo::debug::several_links_decision_image"); - return links_decision_image; - } - - -# endif // ! MLN_INCLUDE_ONLY - - } // end of namespace scribo::debug - -} // end of namespace scribo - - -#endif // ! SCRIBO_DEBUG_SEVERAL_LINKS_DECISION_IMAGE_HH diff --git a/scribo/scribo/table/extract.hh b/scribo/scribo/table/extract.hh index 49a7d50..a87667f 100644 --- a/scribo/scribo/table/extract.hh +++ b/scribo/scribo/table/extract.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -45,8 +45,6 @@ # include <scribo/primitive/extract/lines_v_pattern.hh> # include <scribo/primitive/extract/components.hh> -# include <scribo/debug/save_bboxes_image.hh> - namespace scribo { diff --git a/scribo/scribo/toolchain/text_in_picture.hh b/scribo/scribo/toolchain/text_in_picture.hh index 9746645..42e69db 100644 --- a/scribo/scribo/toolchain/text_in_picture.hh +++ b/scribo/scribo/toolchain/text_in_picture.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -74,7 +74,7 @@ # include <scribo/filter/object_groups_v_thickness.hh> # include <scribo/debug/decision_image.hh> -# include <scribo/debug/save_linked_bboxes_image.hh> +# include <scribo/debug/linked_bboxes_image.hh> # include <scribo/debug/usage.hh> @@ -321,13 +321,13 @@ namespace scribo if (debug) { std::cerr << "BEFORE - ncomponents = " << filtered_components.nelements() << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, right_link, - literal::red, literal::cyan, - literal::yellow, - literal::green, - anchor::MassCenter, - scribo::make::debug_filename("links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, right_link, + literal::red, literal::cyan, + literal::yellow, + literal::green, + anchor::MassCenter), + scribo::make::debug_filename("links.ppm")); } #endif diff --git a/scribo/src/debug/show_links_several_right_overlap.cc b/scribo/src/debug/show_links_several_right_overlap.cc index ae27e55..5559fec 100644 --- a/scribo/src/debug/show_links_several_right_overlap.cc +++ b/scribo/src/debug/show_links_several_right_overlap.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -48,8 +48,6 @@ #include <scribo/primitive/link/compute_several.hh> #include <scribo/draw/bounding_boxes.hh> - -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_down.cc b/scribo/src/debug/show_links_single_down.cc index f1ed130..8ea3d6a 100644 --- a/scribo/src/debug/show_links_single_down.cc +++ b/scribo/src/debug/show_links_single_down.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -46,7 +46,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_down_left_aligned.cc b/scribo/src/debug/show_links_single_down_left_aligned.cc index ea31db7..5804799 100644 --- a/scribo/src/debug/show_links_single_down_left_aligned.cc +++ b/scribo/src/debug/show_links_single_down_left_aligned.cc @@ -49,7 +49,7 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -94,8 +94,9 @@ int main(int argc, char* argv[]) down_links = filter::object_links_left_aligned(down_links, 5); - scribo::debug::save_linked_bboxes_image(input, down_links, - literal::blue, literal::green, - anchor::ActualLeft, - argv[3]); + io::ppm::save(scribo::debug::linked_bboxes_image(input, down_links, + literal::blue, + literal::green, + anchor::StrictLeft), + argv[3]); } diff --git a/scribo/src/debug/show_links_single_down_right_aligned.cc b/scribo/src/debug/show_links_single_down_right_aligned.cc index d261e5c..38cc335 100644 --- a/scribo/src/debug/show_links_single_down_right_aligned.cc +++ b/scribo/src/debug/show_links_single_down_right_aligned.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -49,7 +49,7 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -95,8 +95,8 @@ int main(int argc, char* argv[]) down_links = filter::object_links_right_aligned(down_links, 5); - scribo::debug::save_linked_bboxes_image(input, down_links, - literal::blue, literal::green, - anchor::ActualRight, - argv[3]); + io::ppm::save(scribo::debug::linked_bboxes_image(input, down_links, + literal::blue, literal::green, + anchor::StrictRight), + argv[3]); } diff --git a/scribo/src/debug/show_links_single_left.cc b/scribo/src/debug/show_links_single_left.cc index 2211ce1..dfcb07b 100644 --- a/scribo/src/debug/show_links_single_left.cc +++ b/scribo/src/debug/show_links_single_left.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -47,7 +47,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_left_dmax_ratio.cc b/scribo/src/debug/show_links_single_left_dmax_ratio.cc index 9b48a42..c1d6b01 100644 --- a/scribo/src/debug/show_links_single_left_dmax_ratio.cc +++ b/scribo/src/debug/show_links_single_left_dmax_ratio.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -47,7 +47,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_right.cc b/scribo/src/debug/show_links_single_right.cc index 2392e62..9b37c44 100644 --- a/scribo/src/debug/show_links_single_right.cc +++ b/scribo/src/debug/show_links_single_right.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -47,7 +47,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_right_dmax_ratio.cc b/scribo/src/debug/show_links_single_right_dmax_ratio.cc index 5b292ed..133fe82 100644 --- a/scribo/src/debug/show_links_single_right_dmax_ratio.cc +++ b/scribo/src/debug/show_links_single_right_dmax_ratio.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -47,7 +47,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_up.cc b/scribo/src/debug/show_links_single_up.cc index db9d3e7..1933af1 100644 --- a/scribo/src/debug/show_links_single_up.cc +++ b/scribo/src/debug/show_links_single_up.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -46,7 +46,6 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/debug/show_links_single_up_left_aligned.cc b/scribo/src/debug/show_links_single_up_left_aligned.cc index d0df1e4..839aad8 100644 --- a/scribo/src/debug/show_links_single_up_left_aligned.cc +++ b/scribo/src/debug/show_links_single_up_left_aligned.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -49,7 +49,7 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -96,8 +96,9 @@ int main(int argc, char* argv[]) up_links = filter::object_links_left_aligned(up_links, 5); - scribo::debug::save_linked_bboxes_image(input, up_links, - literal::blue, literal::green, - anchor::ActualLeft, - argv[3]); + io::ppm::save(scribo::debug::linked_bboxes_image(input, up_links, + literal::blue, + literal::green, + anchor::StrictLeft), + argv[3]); } diff --git a/scribo/src/debug/show_links_single_up_right_aligned.cc b/scribo/src/debug/show_links_single_up_right_aligned.cc index 3f40daf..561fbe9 100644 --- a/scribo/src/debug/show_links_single_up_right_aligned.cc +++ b/scribo/src/debug/show_links_single_up_right_aligned.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -49,7 +49,7 @@ #include <scribo/draw/bounding_boxes.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -94,8 +94,9 @@ int main(int argc, char* argv[]) up_links = filter::object_links_right_aligned(up_links, 5); - scribo::debug::save_linked_bboxes_image(input, up_links, - literal::blue, literal::green, - anchor::ActualRight, - argv[3]); + io::ppm::save(scribo::debug::linked_bboxes_image(input, up_links, + literal::blue, + literal::green, + anchor::StrictRight), + argv[3]); } diff --git a/scribo/src/debug/show_separators.cc b/scribo/src/debug/show_separators.cc index ef80da6..40e2fde 100644 --- a/scribo/src/debug/show_separators.cc +++ b/scribo/src/debug/show_separators.cc @@ -18,13 +18,15 @@ #include <mln/core/alias/box2d.hh> #include <mln/core/alias/neighb2d.hh> #include <mln/io/pbm/all.hh> +#include <mln/io/ppm/save.hh> #include <mln/arith/plus.hh> #include <mln/labeling/foreground.hh> +#include <mln/labeling/compute.hh> #include <scribo/primitive/extract/lines_h_pattern.hh> #include <scribo/primitive/extract/lines_v_pattern.hh> #include <scribo/debug/usage.hh> -#include <scribo/debug/save_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> const char *args_desc[][2] = @@ -90,7 +92,7 @@ int main(int argc, char *argv[]) image2d<value::int_u8> lbl = labeling::foreground(v_lines, c4(), nlabels); mln::util::array<box2d> bbox = labeling::compute(accu::shape::bbox<point2d>(), lbl, nlabels); - scribo::debug::save_bboxes_image(input, bbox, argv[4], literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, bbox, literal::red), argv[4]); trace::exiting("main"); } diff --git a/scribo/src/primitive/group/group_from_double_link.cc b/scribo/src/primitive/group/group_from_double_link.cc index 39b1bb9..ec4e180 100644 --- a/scribo/src/primitive/group/group_from_double_link.cc +++ b/scribo/src/primitive/group/group_from_double_link.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -41,11 +41,11 @@ #include <scribo/primitive/group/apply.hh> #include <scribo/primitive/link/with_single_left_link.hh> #include <scribo/primitive/link/with_single_right_link.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/primitive/group/from_double_link.hh> #include <scribo/filter/objects_small.hh> -#include <scribo/debug/save_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> #include <scribo/make/debug_filename.hh> @@ -95,12 +95,14 @@ int main(int argc, char *argv[]) std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, right_link, - literal::red, literal::cyan, literal::yellow, - literal::green, - anchor::MassCenter, - scribo::make::debug_filename("links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, right_link, + literal::red, + literal::cyan, + literal::yellow, + literal::green, + anchor::MassCenter), + scribo::make::debug_filename("links.ppm")); // With validation. object_groups<L> groups @@ -116,8 +118,8 @@ int main(int argc, char *argv[]) std::cout << "AFTER double grouping - nbboxes = " << grouped_text.nelements() << std::endl; - scribo::debug::save_bboxes_image(input, grouped_text, - scribo::make::debug_filename("bboxes.ppm"), - literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_text, + literal::red), + scribo::make::debug_filename("bboxes.ppm")); } diff --git a/scribo/src/primitive/group/group_from_double_several_links.cc b/scribo/src/primitive/group/group_from_double_several_links.cc index 2a49b33..86b3cf4 100644 --- a/scribo/src/primitive/group/group_from_double_several_links.cc +++ b/scribo/src/primitive/group/group_from_double_several_links.cc @@ -41,11 +41,11 @@ #include <scribo/primitive/group/apply.hh> #include <scribo/primitive/link/with_several_left_links.hh> #include <scribo/primitive/link/with_several_right_links.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/primitive/group/from_double_link.hh> #include <scribo/filter/objects_small.hh> -#include <scribo/debug/save_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> #include <scribo/make/debug_filename.hh> int usage(const char *name) @@ -89,12 +89,15 @@ int main(int argc, char* argv[]) std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, right_link, - literal::red, literal::cyan, literal::yellow, - literal::green, - anchor::Center, - scribo::make::debug_filename("links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, + right_link, + literal::red, + literal::cyan, + literal::yellow, + literal::green, + anchor::Center), + scribo::make::debug_filename("links.ppm")); // With validation. std::cout << "Group from double link" << std::endl; @@ -111,8 +114,8 @@ int main(int argc, char* argv[]) std::cout << "AFTER double grouping - nbboxes = " << grouped_comps.nelements() << std::endl; - scribo::debug::save_bboxes_image(input, grouped_comps, - scribo::make::debug_filename("bboxes.ppm"), - literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_comps, + literal::red), + scribo::make::debug_filename("bboxes.ppm")); } diff --git a/scribo/src/primitive/group/group_from_several_left_links.cc b/scribo/src/primitive/group/group_from_several_left_links.cc index ef70a19..42ad98a 100644 --- a/scribo/src/primitive/group/group_from_several_left_links.cc +++ b/scribo/src/primitive/group/group_from_several_left_links.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -46,8 +46,8 @@ #include <scribo/primitive/link/with_several_left_links.hh> #include <scribo/primitive/group/from_single_link.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/make/debug_filename.hh> int usage(const char *name) @@ -80,10 +80,11 @@ int main(int argc, char* argv[]) = primitive::link::with_several_left_links(comps, 30); std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, - literal::red, literal::cyan, - scribo::make::debug_filename("left_links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, + literal::red, + literal::cyan), + scribo::make::debug_filename("left_links.ppm")); object_groups<L> @@ -96,9 +97,9 @@ int main(int argc, char* argv[]) grouped_comps.labeled_image(), grouped_comps.nelements()), scribo::make::debug_filename("left_label_color.ppm")); - scribo::debug::save_bboxes_image(input, grouped_comps, - scribo::make::debug_filename("left_bboxes.ppm"), - literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_comps, + literal::red), + scribo::make::debug_filename("left_bboxes.ppm")); } } diff --git a/scribo/src/primitive/group/group_from_single_link.cc b/scribo/src/primitive/group/group_from_single_link.cc index 5b5f710..fc904a0 100644 --- a/scribo/src/primitive/group/group_from_single_link.cc +++ b/scribo/src/primitive/group/group_from_single_link.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -44,8 +44,8 @@ #include <scribo/primitive/group/from_single_link.hh> #include <scribo/primitive/group/apply.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/make/debug_filename.hh> @@ -80,10 +80,11 @@ int main(int argc, char* argv[]) = primitive::link::with_single_left_link(comps, 30); std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, - literal::red, literal::cyan, - scribo::make::debug_filename("left_links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, + literal::red, + literal::cyan), + scribo::make::debug_filename("left_links.ppm")); // io::ppm::save(mln::labeling::colorize(value::rgb8(), // comps, // comps.nlabels()), @@ -99,8 +100,9 @@ int main(int argc, char* argv[]) grouped_comps.labeled_image(), grouped_comps.nelements()), scribo::make::debug_filename("left_label_color.ppm")); - scribo::debug::save_bboxes_image(input, grouped_comps, - scribo::make::debug_filename("left_bboxes.ppm"), literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_comps, + literal::red), + scribo::make::debug_filename("left_bboxes.ppm")); } { @@ -109,10 +111,10 @@ int main(int argc, char* argv[]) = primitive::link::with_single_right_link(comps, 30); std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - scribo::debug::save_linked_bboxes_image(input, - right_link, - literal::red, literal::cyan, - scribo::make::debug_filename("right_links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + right_link, + literal::red, literal::cyan), + scribo::make::debug_filename("right_links.ppm")); // io::ppm::save(mln::labeling::colorize(value::rgb8(), // comps, // comps.nlabels()), @@ -129,9 +131,9 @@ int main(int argc, char* argv[]) scribo::make::debug_filename("right_label_color.ppm")); std::cout << "AFTER - nbboxes = " << grouped_comps.nelements() << std::endl; - scribo::debug::save_bboxes_image(input, grouped_comps, - scribo::make::debug_filename("right_bboxes.ppm"), - literal::red); + io::ppm::save(scribo::debug::bboxes_image(input, grouped_comps, + literal::red), + scribo::make::debug_filename("right_bboxes.ppm")); } diff --git a/scribo/src/text_in_picture.cc b/scribo/src/text_in_picture.cc index 77cf7b6..af00c4f 100644 --- a/scribo/src/text_in_picture.cc +++ b/scribo/src/text_in_picture.cc @@ -75,8 +75,7 @@ #include <scribo/debug/text_areas_image.hh> #include <scribo/debug/decision_image.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> +#include <scribo/debug/linked_bboxes_image.hh> #include <scribo/debug/usage.hh> @@ -342,13 +341,13 @@ int main(int argc, char* argv[]) if (debug) { std::cerr << "BEFORE - ncomponents = " << filtered_components.nelements() << std::endl; - scribo::debug::save_linked_bboxes_image(input, - left_link, right_link, - literal::red, literal::cyan, - literal::yellow, - literal::green, - anchor::MassCenter, - scribo::make::debug_filename("links.ppm")); + io::ppm::save(scribo::debug::linked_bboxes_image(input, + left_link, right_link, + literal::red, literal::cyan, + literal::yellow, + literal::green, + anchor::MassCenter), + scribo::make::debug_filename("links.ppm")); } #endif diff --git a/scribo/src/text_in_picture_neg.cc b/scribo/src/text_in_picture_neg.cc index 8d818e0..2b06a72 100644 --- a/scribo/src/text_in_picture_neg.cc +++ b/scribo/src/text_in_picture_neg.cc @@ -92,8 +92,6 @@ #include <scribo/debug/text_areas_image.hh> #include <scribo/debug/decision_image.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/src/text_recognition_in_picture.cc b/scribo/src/text_recognition_in_picture.cc index 8b76f48..de7a9ed 100644 --- a/scribo/src/text_recognition_in_picture.cc +++ b/scribo/src/text_recognition_in_picture.cc @@ -95,8 +95,6 @@ #include <scribo/debug/highlight_text_area.hh> #include <scribo/debug/decision_image.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> #include <scribo/debug/usage.hh> diff --git a/scribo/tests/filter/components_large.cc b/scribo/tests/filter/components_large.cc index 543b90d..4a7a10b 100644 --- a/scribo/tests/filter/components_large.cc +++ b/scribo/tests/filter/components_large.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -40,10 +40,6 @@ #include <scribo/primitive/group/from_single_link.hh> #include <scribo/filter/objects_large.hh> -#include <scribo/make/debug_filename.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> - #include "tests/data.hh" int main() diff --git a/scribo/tests/filter/components_small.cc b/scribo/tests/filter/components_small.cc index d9b5325..d5d466c 100644 --- a/scribo/tests/filter/components_small.cc +++ b/scribo/tests/filter/components_small.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -40,10 +40,6 @@ #include <scribo/primitive/group/from_single_link.hh> #include <scribo/filter/objects_small.hh> -#include <scribo/make/debug_filename.hh> -#include <scribo/debug/save_bboxes_image.hh> -#include <scribo/debug/save_linked_bboxes_image.hh> - #include "tests/data.hh" -- 1.5.6.5
13Â years, 10Â months
1
0
0
0
← Newer
1
...
299
300
301
302
303
304
305
...
963
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
Results per page:
10
25
50
100
200