This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch next-build-test has been updated
via d58738a0e23770f8795a83ca5912d167fcd541af (commit)
via 3369290e191d9f0239b912022396a7053d527be6 (commit)
from c127a164c2c633a92b28520826598874cc977703 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
d58738a lrde-upload.sh: Upload tarball for branch next-build-test.
3369290 Add a fastest implementation in io::magick.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 +++
lrde-upload.sh | 2 +-
milena/ChangeLog | 7 ++++++
milena/mln/io/magick/load.hh | 50 ++++++++++++++++++++++++++----------------
milena/mln/io/magick/save.hh | 24 ++++++++++++++++----
5 files changed, 62 insertions(+), 25 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch libiberty-pic has been deleted
was e22251860ebb2ed0691abaeb10a60cbdf899802a
-----------------------------------------------------------------------
e22251860ebb2ed0691abaeb10a60cbdf899802a Build Libiberty as a shared library.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch embed-libiberty has been updated
via e22251860ebb2ed0691abaeb10a60cbdf899802a (commit)
from 72191f7881ca5da0df2d0a0be82b8f75a99bfcb0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
No new revisions were added by this update.
-----------------------------------------------------------------------
Summary of changes:
extatica/ChangeLog | 11 +++++++++++
extatica/libiberty.mk | 3 +++
extatica/{ => libiberty}/configure.gnu | 19 +++++++++----------
extatica/src/Makefile.am | 2 +-
4 files changed, 24 insertions(+), 11 deletions(-)
copy extatica/{ => libiberty}/configure.gnu (65%)
mode change 100644 => 100755
hooks/post-receive
--
Olena, a generic and efficient image processing platform
---
scribo/scribo/primitive/merge/components.hh | 121 +++++++++++++++++++++++++++
1 files changed, 121 insertions(+), 0 deletions(-)
create mode 100644 scribo/scribo/primitive/merge/components.hh
diff --git a/scribo/scribo/primitive/merge/components.hh b/scribo/scribo/primitive/merge/components.hh
new file mode 100644
index 0000000..7570d2e
--- /dev/null
+++ b/scribo/scribo/primitive/merge/components.hh
@@ -0,0 +1,121 @@
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+///
+///
+
+#ifndef SCRIBO_PRIMITIVE_MERGE_COMPONENTS_HH
+# define SCRIBO_PRIMITIVE_MERGE_COMPONENTS_HH
+
+# include <mln/core/image/vmorph/fun_image.hh>
+
+
+namespace scribo
+{
+
+ namespace primitive
+ {
+
+ namespace merge
+ {
+
+ using namespace mln;
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+
+ template <typename V>
+ struct rebase_label : mln::Function_v2v<rebase_label<V> >
+ {
+ typedef V result;
+
+ rebase_label()
+ : base_label_(0)
+ {}
+
+ rebase_label(const V& base_label)
+ : base_label_(base_label)
+ {}
+
+ V operator()(const V& v) const
+ {
+ if (v)
+ return unsigned(base_label_) + unsigned(v);
+ return literal::zero;
+ }
+
+
+ V base_label_;
+ };
+
+
+ } // end of namespace scribo::primitive::merge
+
+
+ template <typename L>
+ component_set<L>
+ components(const component_set<L>& lhs, const component_set<L>& rhs)
+ {
+ trace::entering("scribo::primitive::merge::components");
+
+ const L& lhs_lbl = lhs.labeled_image();
+ const L& rhs_lbl = rhs.labeled_image();
+
+ typedef mln_value(L) V;
+
+
+ V nlabels = unsigned(lhs.nelements()) + unsigned(rhs.nelements());
+
+ // Merge labeled images.
+ //
+ // Rebase labeling in the second image, according to the
+ // number of labels in the first one.
+ //
+ L lbl_merge = duplicate(lhs_lbl);
+
+ internal::rebase_label<V> f(lhs.nelements());
+ fun_image<internal::rebase_label<V>, L> fima(f, rhs_lbl);
+ data::fill((lbl_merge | (pw::value(lbl_merge) == pw::cst(0))).rw(), fima);
+
+ component_set<L> output(lbl_merge, nlabels);
+
+ trace::exiting("scribo::primitive::merge::components");
+ return output;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::primitive::merge
+
+ } // end of namespace scribo::primitive
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_PRIMITIVE_MERGE_COMPONENTS_HH
--
1.5.6.5
---
scribo/src/Makefile.am | 10 ++
scribo/src/text_in_picture_neg.cc | 195 +++++++++++++++++++++++++++++++++++++
2 files changed, 205 insertions(+), 0 deletions(-)
create mode 100644 scribo/src/text_in_picture_neg.cc
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index cd7618c..9efa0da 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -70,6 +70,16 @@ if HAVE_MAGICKXX
-lpthread \
$(MAGICKXX_LDFLAGS)
+
+ utilexec_PROGRAMS += text_in_picture_neg
+ text_in_picture_neg_SOURCES = text_in_picture_neg.cc
+ text_in_picture_neg_CPPFLAGS = $(AM_CPPFLAGS) \
+ $(MAGICKXX_CPPFLAGS)
+ text_in_picture_neg_LDFLAGS = $(AM_LDFLAGS) \
+ -lpthread \
+ $(MAGICKXX_LDFLAGS)
+
+
if HAVE_TESSERACT
utilexec_PROGRAMS += text_recognition_in_picture
diff --git a/scribo/src/text_in_picture_neg.cc b/scribo/src/text_in_picture_neg.cc
new file mode 100644
index 0000000..e3078c6
--- /dev/null
+++ b/scribo/src/text_in_picture_neg.cc
@@ -0,0 +1,195 @@
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#include <libgen.h>
+#include <iostream>
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/image/imorph/tr_image.hh>
+#include <mln/core/alias/neighb2d.hh>
+
+#include <mln/labeling/colorize.hh>
+
+#include <mln/data/stretch.hh>
+
+#include <mln/io/pbm/all.hh>
+#include <mln/io/ppm/save.hh>
+#include <mln/io/magick/all.hh>
+
+#include <mln/math/min.hh>
+
+#include <mln/logical/not.hh>
+
+#include <mln/literal/colors.hh>
+#include <mln/value/rgb8.hh>
+#include <mln/value/label_16.hh>
+
+#include <mln/fun/v2v/rgb_to_int_u.hh>
+
+#include <mln/data/wrap.hh>
+
+#include <mln/draw/box.hh>
+
+#include <mln/geom/translate.hh>
+
+#include <mln/subsampling/antialiased.hh>
+
+#include <scribo/draw/bounding_boxes.hh>
+#include <scribo/draw/groups_bboxes.hh>
+
+#include <scribo/binarization/sauvola_ms.hh>
+#include <scribo/binarization/sauvola.hh>
+
+#include <scribo/primitive/extract/components.hh>
+
+#include <scribo/primitive/link/merge_double_link.hh>
+#include <scribo/primitive/link/with_single_left_link.hh>
+#include <scribo/primitive/link/with_single_right_link.hh>
+
+#include <scribo/primitive/group/apply.hh>
+#include <scribo/primitive/group/from_double_link.hh>
+#include <scribo/primitive/group/from_single_link.hh>
+
+#include <scribo/primitive/regroup/from_single_left_link.hh>
+// #include <scribo/primitive/regroup/from_single_left_link_wrt_h_ratio.hh>
+
+#include <scribo/filter/object_groups_with_holes.hh>
+
+#include <scribo/filter/object_links_bbox_h_ratio.hh>
+#include <scribo/filter/object_links_bbox_overlap.hh>
+
+#include <scribo/filter/common/objects_photo.hh>
+
+#include <scribo/filter/object_groups_small.hh>
+#include <scribo/filter/object_groups_v_thickness.hh>
+
+#include <scribo/debug/highlight_text_area.hh>
+#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>
+
+#include <scribo/preprocessing/split_bg_fg.hh>
+
+#include <scribo/make/debug_filename.hh>
+
+#include <scribo/toolchain/text_in_picture.hh>
+
+#include <scribo/primitive/merge/components.hh>
+
+#include <mln/util/timer.hh>
+#include <mln/core/var.hh>
+
+const char *args_desc[][2] =
+{
+ { "input.*", "A color image." },
+ { "ouput.ppm", "A color image where the text is highlighted." },
+ { "debug_output_dir", "Directory were debug images will be saved" },
+ { "lambda", "Lambda value used for foreground extraction" },
+ {0, 0}
+};
+
+
+
+int main(int argc, char* argv[])
+{
+ using namespace scribo;
+ using namespace scribo::primitive;
+ using namespace mln;
+
+ if (argc < 3 || argc > 8)
+ return scribo::debug::usage(argv,
+ "Find text in a photo.\n\n"
+ "Common usage: ./text_in_photo_fast input.*"
+ " output.ppm 1 1",
+ "input.ppm output.ppm <bg/fg enabled>"
+ " <sauvola_ms enabled> "
+ "[debug_output_dir] [max_dim_size] [lambda]",
+ args_desc);
+
+ char *out_base_dir = 0;
+ if (argc > 5)
+ out_base_dir = argv[5];
+
+ trace::entering("main");
+
+ image2d<value::rgb8> input_rgb;
+ io::magick::load(input_rgb, argv[1]);
+
+ unsigned max_dim_size = 0;
+ if (argc >= 7)
+ max_dim_size = atoi(argv[6]);
+
+
+ unsigned lambda = 0;
+ if (argc == 8)
+ lambda = atoi(argv[7]);
+
+ bool bg_removal = false;
+ if (argc > 3 && atoi(argv[3]) != 0)
+ bg_removal = true;
+
+ bool multi_scale_bin = false;
+ if (argc > 4 && atoi(argv[4]) != 0)
+ multi_scale_bin = true;
+
+
+ typedef image2d<value::label_16> L;
+ component_set<L>
+ comps = toolchain::text_in_picture(input_rgb, bg_removal, multi_scale_bin,
+ false,
+ max_dim_size, lambda, out_base_dir);
+
+
+ typedef image2d<value::label_16> L;
+ component_set<L>
+ comps_neg = toolchain::text_in_picture(input_rgb, bg_removal, multi_scale_bin,
+ true,
+ max_dim_size, lambda, out_base_dir);
+
+
+ component_set<L> merged_comps = primitive::merge::components(comps, comps_neg);
+
+
+
+ io::ppm::save(mln::labeling::colorize(value::rgb8(),
+ merged_comps.labeled_image(),
+ merged_comps.nelements()),
+ argv[2]);
+
+ if (out_base_dir)
+ {
+ io::ppm::save(scribo::debug::highlight_text_area(input_rgb, merged_comps),
+ std::string(out_base_dir) + "_input_with_bboxes.ppm");
+ io::ppm::save(scribo::debug::text_areas_image(input_rgb, merged_comps),
+ std::string(out_base_dir) + "_out_text.ppm");
+ }
+
+ std::cout << "# objects = " << merged_comps.nelements() << std::endl;
+
+}
--
1.5.6.5