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 compil/clang++ has been deleted
was 276ad3db3217651981534e7a5908c0b8954d2502
-----------------------------------------------------------------------
276ad3db3217651981534e7a5908c0b8954d2502 Fix different forward declarations (class/struct) in scribo/core.
-----------------------------------------------------------------------
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 next has been updated
via 276ad3db3217651981534e7a5908c0b8954d2502 (commit)
via bd478ecf1a53fd1c42b3c267f220aab3f146c4ca (commit)
from 81824c6b2a74d526744302b38a5479989c961f76 (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:
scribo/ChangeLog | 16 ++++++++++++++++
scribo/scribo/core/component_set.hh | 2 +-
scribo/scribo/core/line_set.hh | 4 ++--
3 files changed, 19 insertions(+), 3 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 exp/TL has been updated
via afa987bad716e6ff5afcb1e1a23a04af6d269cdc (commit)
via 1455cd4741d695598df033f958af61bde2aafacb (commit)
from c3bdf5c8577d0abf076fb9750f8ad96ecb92ff11 (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:
milena/mln/data/stretch.hh | 4 +-
milena/mln/data/stretch_inplace.hh | 133 ++++++++++++++++++++++++++++++++++++
2 files changed, 134 insertions(+), 3 deletions(-)
create mode 100644 milena/mln/data/stretch_inplace.hh
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 exp/stretch_inplace has been created
at afa987bad716e6ff5afcb1e1a23a04af6d269cdc (commit)
- Log -----------------------------------------------------------------
afa987b mnl/data/stretch.hh: Improve stretch.
1455cd4 mln/data/stretch_inplace.hh: Add stretch inplace.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
---
milena/mln/data/stretch.hh | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/milena/mln/data/stretch.hh b/milena/mln/data/stretch.hh
index 5b36dbe..1738341 100644
--- a/milena/mln/data/stretch.hh
+++ b/milena/mln/data/stretch.hh
@@ -33,8 +33,6 @@
/// stretching way.
///
/// \todo Make it work with other types than scalars (e.g., vectors).
-///
-/// \todo Think about adding a stretch_inplace(?)
# include <mln/estim/min_max.hh>
# include <mln/value/int_u.hh>
@@ -93,7 +91,7 @@ namespace mln
mln_value(I) min_, max_;
estim::min_max(input, min_, max_);
- if (max_ != min_)
+ if (max_ != min_ && (mln_max(V)>max_ || mln_min(V)>min_))
{
//FIXME: we would like to use float instead of double but we
//can't for precision reasons. See ticket #179.
--
1.7.2.5
---
milena/mln/data/stretch.hh | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/milena/mln/data/stretch.hh b/milena/mln/data/stretch.hh
index 5b36dbe..1738341 100644
--- a/milena/mln/data/stretch.hh
+++ b/milena/mln/data/stretch.hh
@@ -33,8 +33,6 @@
/// stretching way.
///
/// \todo Make it work with other types than scalars (e.g., vectors).
-///
-/// \todo Think about adding a stretch_inplace(?)
# include <mln/estim/min_max.hh>
# include <mln/value/int_u.hh>
@@ -93,7 +91,7 @@ namespace mln
mln_value(I) min_, max_;
estim::min_max(input, min_, max_);
- if (max_ != min_)
+ if (max_ != min_ && (mln_max(V)>max_ || mln_min(V)>min_))
{
//FIXME: we would like to use float instead of double but we
//can't for precision reasons. See ticket #179.
--
1.7.2.5
---
milena/mln/data/stretch_inplace.hh | 133 ++++++++++++++++++++++++++++++++++++
1 files changed, 133 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/data/stretch_inplace.hh
diff --git a/milena/mln/data/stretch_inplace.hh b/milena/mln/data/stretch_inplace.hh
new file mode 100644
index 0000000..618f43d
--- /dev/null
+++ b/milena/mln/data/stretch_inplace.hh
@@ -0,0 +1,133 @@
+// Copyright (C) 2013 EPITA Research and
+// Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_DATA_STRETCH_INPLACE_HH
+# define MLN_DATA_STRETCH_INPLACE_HH
+
+/// \file
+///
+/// Transform linearly the contents of an image into another one in a
+/// stretching way.
+///
+/// \todo Make it work with other types than scalars (e.g., vectors).
+
+
+# include <mln/estim/min_max.hh>
+# include <mln/value/int_u.hh>
+# include <mln/fun/v2v/linear.hh>
+# include <mln/data/transform_inplace.hh>
+
+
+# include <mln/value/internal/encoding.hh>
+# include <iomanip>
+namespace mln
+{
+
+ namespace data
+ {
+
+ /*! \brief Stretch the values of \p ima so that they can be
+ * stored inplace.
+ *
+ * \param[in,out] ima The input image.
+ *
+ *
+ * \pre input.is_valid
+ *
+ * \ingroup mlndata
+ */
+ template <typename I>
+ void
+ stretch_inplace(Image<I>& ima);
+
+ /*! \brief Stretch the values of \p ima so that they can be
+ * stored inplace.
+ *
+ * \param[in,out] ima The input image.
+ * \param[out] stretched The image has changed.
+ *
+ * \pre input.is_valid
+ *
+ * \ingroup mlndata
+ */
+ template <typename I>
+ void
+ stretch_inplace(Image<I>& ima, bool& stretched);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename I>
+ inline
+ void
+ stretch_inplace(Image<I>& ima, bool& stretched)
+ {
+ mln_trace("data::stretch_inplace");
+ typedef mln_value(I) V;
+ mln_precondition(exact(ima).is_valid());
+
+ V min_, max_;
+ estim::min_max(ima, min_, max_);
+ if (max_ != min_ && (mln_max(V)>max_ || mln_min(V)>min_))
+ {
+ //FIXME: we would like to use float instead of double but we
+ //can't for precision reasons. See ticket #179.
+ double
+ min = double(min_),
+ max = double(max_),
+ epsilon = mln_epsilon(float),
+ M = mln_max(V) + 0.5f - epsilon,
+ m = 0.0f - 0.5f + epsilon,
+ a = (M - m) / (max - min),
+ b = (m * max - M * min) / (max - min);
+ fun::v2v::linear_sat<V, double, V> f(a, b);
+ data::transform_inplace(input, f);
+ stretched = true;
+ }
+ else
+ {
+ stretched = false;
+ mln_trace_warning("output has no significative data!");
+ }
+ }
+
+ template <typename I>
+ void
+ stretch_inplace(Image<I>& ima)
+ {
+ bool b;
+ stretch_inplace(ima, b);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::data
+
+} // end of namespace mln
+
+
+#endif // ! MLN_DATA_STRETCH_INPLACE_HH
--
1.7.2.5
---
milena/mln/data/stretch_inplace.hh | 133 ++++++++++++++++++++++++++++++++++++
1 files changed, 133 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/data/stretch_inplace.hh
diff --git a/milena/mln/data/stretch_inplace.hh b/milena/mln/data/stretch_inplace.hh
new file mode 100644
index 0000000..a4579f1
--- /dev/null
+++ b/milena/mln/data/stretch_inplace.hh
@@ -0,0 +1,133 @@
+// Copyright (C) 2013 EPITA Research and
+// Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_DATA_STRETCH_INPLACE_HH
+# define MLN_DATA_STRETCH_INPLACE_HH
+
+/// \file
+///
+/// Transform linearly the contents of an image into another one in a
+/// stretching way.
+///
+/// \todo Make it work with other types than scalars (e.g., vectors).
+
+
+# include <mln/estim/min_max.hh>
+# include <mln/value/int_u.hh>
+# include <mln/fun/v2v/linear.hh>
+# include <mln/data/transform_inplace.hh>
+
+
+# include <mln/value/internal/encoding.hh>
+# include <iomanip>
+namespace mln
+{
+
+ namespace data
+ {
+
+ /*! \brief Stretch the values of \p ima so that they can be
+ * stored inplace.
+ *
+ * \param[in,out] ima The input image.
+ *
+ *
+ * \pre input.is_valid
+ *
+ * \ingroup mlndata
+ */
+ template <typename I>
+ void
+ stretch_inplace(Image<I>& ima);
+
+ /*! \brief Stretch the values of \p ima so that they can be
+ * stored inplace.
+ *
+ * \param[in,out] ima The input image.
+ * \param[out] stretched The image has changed.
+ *
+ * \pre input.is_valid
+ *
+ * \ingroup mlndata
+ */
+ template <typename I>
+ void
+ stretch_inplace(Image<I>& ima, bool& stretched);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename I>
+ inline
+ void
+ stretch_inplace(Image<I>& ima, bool& stretched)
+ {
+ mln_trace("data::stretch_inplace");
+ typedef mln_value(I) V;
+ mln_precondition(exact(ima).is_valid());
+
+ V min_, max_;
+ estim::min_max(ima, min_, max_);
+ if (max_ != min_ && (mln_max(V)>max_ || mln_min(V)>min_))
+ {
+ //FIXME: we would like to use float instead of double but we
+ //can't for precision reasons. See ticket #179.
+ double
+ min = double(min_),
+ max = double(max_),
+ epsilon = mln_epsilon(float),
+ M = mln_max(V) + 0.5f - epsilon,
+ m = 0.0f - 0.5f + epsilon,
+ a = (M - m) / (max - min),
+ b = (m * max - M * min) / (max - min);
+ fun::v2v::linear_sat<V, double, V> f(a, b);
+ data::transform_inplace(ima, f);
+ stretched = true;
+ }
+ else
+ {
+ stretched = false;
+ mln_trace_warning("output has no significative data!");
+ }
+ }
+
+ template <typename I>
+ void
+ stretch_inplace(Image<I>& ima)
+ {
+ bool b;
+ stretch_inplace(ima, b);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::data
+
+} // end of namespace mln
+
+
+#endif // ! MLN_DATA_STRETCH_INPLACE_HH
--
1.7.2.5
* mln/data/stretch.hh: Remove fixme.
* mln/data/stretch_inplace.hh,
* tests/data/stretch_inplace.cc: New.
* tests/data/stretch.cc: Remove a useless include.
* tests/data/Makefile.am: New target.
---
milena/ChangeLog | 13 ++
milena/mln/data/stretch.hh | 10 +-
milena/mln/data/stretch_inplace.hh | 137 ++++++++++++++++++++
milena/tests/data/Makefile.am | 3 +-
milena/tests/data/stretch.cc | 4 +-
.../tests/data/{saturate.cc => stretch_inplace.cc} | 25 ++--
6 files changed, 175 insertions(+), 17 deletions(-)
create mode 100644 milena/mln/data/stretch_inplace.hh
copy milena/tests/data/{saturate.cc => stretch_inplace.cc} (76%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index edf3a65..3499fd3 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,16 @@
+2013-04-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add data::stretch_inplace.
+
+ * mln/data/stretch.hh: Remove fixme.
+
+ * mln/data/stretch_inplace.hh,
+ * tests/data/stretch_inplace.cc: New.
+
+ * tests/data/stretch.cc: Remove a useless include.
+
+ * tests/data/Makefile.am: New target.
+
2013-04-17 Guillaume Lazzara <z(a)lrde.epita.fr>
* doc/mln/convert.dox: Fix from_to_ module name.
diff --git a/milena/mln/data/stretch.hh b/milena/mln/data/stretch.hh
index 5b36dbe..2473494 100644
--- a/milena/mln/data/stretch.hh
+++ b/milena/mln/data/stretch.hh
@@ -33,8 +33,6 @@
/// stretching way.
///
/// \todo Make it work with other types than scalars (e.g., vectors).
-///
-/// \todo Think about adding a stretch_inplace(?)
# include <mln/estim/min_max.hh>
# include <mln/value/int_u.hh>
@@ -82,7 +80,7 @@ namespace mln
template <typename V, typename I>
inline
mln_ch_value(I, V)
- stretch(const V& v, const Image<I>& input)
+ stretch(const V& v, const Image<I>& input)
{
mln_trace("data::impl::stretch");
@@ -95,6 +93,12 @@ namespace mln
estim::min_max(input, min_, max_);
if (max_ != min_)
{
+ // We always want to perform this algorithm even if (min_ ==
+ // mln_min(V) and max_ == mln_max(V)) since we need to
+ // convert the input image towards the given type and a
+ // default conversion function may not exist between V and
+ // mln_value(I).
+
//FIXME: we would like to use float instead of double but we
//can't for precision reasons. See ticket #179.
double
diff --git a/milena/mln/data/stretch_inplace.hh b/milena/mln/data/stretch_inplace.hh
new file mode 100644
index 0000000..12c8b8e
--- /dev/null
+++ b/milena/mln/data/stretch_inplace.hh
@@ -0,0 +1,137 @@
+// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_DATA_STRETCH_INPLACE_HH
+# define MLN_DATA_STRETCH_INPLACE_HH
+
+/// \file
+///
+/// Transform linearly the contents of an image into another one in a
+/// stretching way.
+
+
+# include <mln/estim/min_max.hh>
+# include <mln/value/int_u.hh>
+# include <mln/fun/v2v/linear.hh>
+# include <mln/data/transform_inplace.hh>
+
+
+# include <mln/value/internal/encoding.hh>
+# include <iomanip>
+namespace mln
+{
+
+ namespace data
+ {
+
+ /*! \brief Stretch the values of \p ima so that they can be
+ * stored inplace.
+ *
+ * \param[in,out] ima The input image.
+ *
+ * If input is filled with a single value, this function does
+ * nothing.
+ *
+ * \pre input.is_valid
+ *
+ * \ingroup mlndata
+ */
+ template <typename I>
+ void
+ stretch_inplace(Image<I>& ima);
+
+ /*! \brief Stretch the values of \p ima so that they can be
+ * stored inplace.
+ *
+ * \param[in,out] ima The input image.
+ * \param[out] stretched The image has changed.
+ *
+ * If input is filled with a single value, this function does
+ * nothing.
+ *
+ * \pre input.is_valid
+ *
+ * \ingroup mlndata
+ */
+ template <typename I>
+ void
+ stretch_inplace(Image<I>& ima, bool& stretched);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename I>
+ inline
+ void
+ stretch_inplace(Image<I>& ima, bool& stretched)
+ {
+ mln_trace("data::stretch_inplace");
+ typedef mln_value(I) V;
+ mln_precondition(exact(ima).is_valid());
+
+ stretched = false;
+ V min_, max_;
+ estim::min_max(ima, min_, max_);
+ if (max_ != min_)
+ {
+ // Already stretched ?
+ if (min_ == mln_min(V) && max_ == mln_max(V))
+ return;
+
+ //FIXME: we would like to use float instead of double but we
+ //can't for precision reasons. See ticket #179.
+ double
+ min = double(min_),
+ max = double(max_),
+ epsilon = mln_epsilon(float),
+ M = mln_max(V) + 0.5f - epsilon,
+ m = 0.0f - 0.5f + epsilon,
+ a = (M - m) / (max - min),
+ b = (m * max - M * min) / (max - min);
+ fun::v2v::linear_sat<V, double, V> f(a, b);
+ data::transform_inplace(ima, f);
+ stretched = true;
+ }
+ // else nothing to do.
+ }
+
+
+ template <typename I>
+ void
+ stretch_inplace(Image<I>& ima)
+ {
+ bool b;
+ stretch_inplace(ima, b);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::data
+
+} // end of namespace mln
+
+
+#endif // ! MLN_DATA_STRETCH_INPLACE_HH
diff --git a/milena/tests/data/Makefile.am b/milena/tests/data/Makefile.am
index b733718..565987e 100644
--- a/milena/tests/data/Makefile.am
+++ b/milena/tests/data/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+# Copyright (C) 2008, 2009, 2010, 2013 EPITA Research and Development
# Laboratory (LRDE)
#
# This file is part of Olena.
@@ -39,6 +39,7 @@ check_PROGRAMS = \
sort_psites \
split \
stretch \
+ stretch_inplace \
transform \
transform_inplace \
update
diff --git a/milena/tests/data/stretch.cc b/milena/tests/data/stretch.cc
index 5144146..e22605e 100644
--- a/milena/tests/data/stretch.cc
+++ b/milena/tests/data/stretch.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -25,7 +26,6 @@
#include <mln/core/image/image2d.hh>
#include <mln/data/stretch.hh>
-#include <mln/debug/iota.hh>
#include <mln/value/int_u8.hh>
diff --git a/milena/tests/data/saturate.cc b/milena/tests/data/stretch_inplace.cc
similarity index 76%
copy from milena/tests/data/saturate.cc
copy to milena/tests/data/stretch_inplace.cc
index 4baee22..fb7b071 100644
--- a/milena/tests/data/saturate.cc
+++ b/milena/tests/data/stretch_inplace.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -24,24 +24,27 @@
// executable file might be covered by the GNU General Public License.
#include <mln/core/image/image2d.hh>
-#include <mln/data/saturate.hh>
-#include <mln/debug/iota.hh>
-
+#include <mln/data/stretch_inplace.hh>
int main()
{
using namespace mln;
- image2d<int> ima(3, 3);
int vs[3][3] = {
- { 2, 2, 3 },
- { 4, 5, 6 },
- { 6, 6, 6 }
+ { 1000, 2000, 3000 },
+ { 1000, 2000, 3000 },
+ { 1000, 2000, 3000 }
+ };
+ image2d<int> ima = make::image(vs);
+ data::stretch_inplace(ima);
+
+ int ws[3][3] = {
+ { 0, 1073741824, 2147483647 },
+ { 0, 1073741824, 2147483647 },
+ { 0, 1073741824, 2147483647 }
};
+ image2d<int> ref = make::image(ws);
- image2d<int> ref = make::image(vs);
- debug::iota(ima);
- data::saturate_inplace(ima, 2, 6);
box_fwd_piter_<point2d> p(ima.domain());
for_all(p)
mln_assertion(ima(p) == ref(p));
--
1.7.2.5