#122: [TRAITS] image_if_base
---------------------+------------------------------------------------------
Reporter: duhamel | Owner: Olena Team
Type: defect | Status: new
Priority: major | Milestone: Olena 1.0ß
Component: Milena | Version: 1.0
Keywords: |
---------------------+------------------------------------------------------
In source:trunk/milena/mln/core/internal/image_if_base.hh data trait is
suspect.
For example an image_if from an image1d has always data trait raw !
--
Ticket URL: <https://trac.lrde.org/olena/ticket/122>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image library.
#131: Implement area closing and attribue closing
--------------------------------------------------------+-------------------
Reporter: levill_r | Owner: Olena Team
Type: defect | Status: new
Priority: minor | Milestone: Static 1.0
Component: Milena | Version: 1.0
Keywords: completion dual naming routines algorithms |
--------------------------------------------------------+-------------------
Currently, these files are available:
* source:trunk/morpho/mln/opening_area.hh
* source:trunk/morpho/mln/opening_attribute.hh
but there is no equivalent for closings. Implement them.
BTW, these files and their routines are called `opening_area` and
`opening_attribute`, which is not elegant. Of course the goal is to put
forward the opening term; but IMHO, we should use namespace to do this,
not prefixes. Or rename them to `area_opening` and `attribute_opening`,
which are much more natural. Anyway, any further discussion on the subject
of naming algorithms should be carried on in another ticket.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/131>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image library.
#140: Add points having floating-point coordinates
----------------------+-----------------------------------------------------
Reporter: levill_r | Owner: levill_r
Type: task | Status: new
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Keywords: |
----------------------+-----------------------------------------------------
Name regular instances `point1df`, `point2df` and `point3df`.
(N.B.: Aroune will need them so as to build the 3-d surface graph from a
set of triangles.)
--
Ticket URL: <https://trac.lrde.org/olena/ticket/140>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
#130: Don not pass neighborhoods as argument to algorithms
----------------------+-----------------------------------------------------
Reporter: levill_r | Owner: Olena Team
Type: defect | Status: new
Priority: major | Milestone: Olena 1.0ß
Component: Milena | Version: 1.0
Keywords: |
----------------------+-----------------------------------------------------
Neighborhoods shall be bound to images: they are a property of them.
Hence an algorithm (at least a facade) shall not accept an image along
with an ''external'' neighborhood. Most of the time, these algorithms are
based on windows improperly called neighborhoods.
Here is the list of files to revamp, as of revision 1663:
* source:trunk/labeling/level.spe.hh
* source:trunk/labeling/regional_maxima.hh
* source:trunk/labeling/regional_minima.hh
* source:trunk/make/voronoi.hh
* source:trunk/milena/mln/geom/labeling/blobs.hh
* source:trunk/milena/mln/geom/seeds2tiling_roundness.hh
* source:trunk/milena/mln/labeling/background.hh
* source:trunk/milena/mln/labeling/flat_zones.hh
* source:trunk/milena/mln/labeling/foreground.hh
* source:trunk/milena/mln/labeling/level.hh
* source:trunk/morpho/Rd.hh
* source:trunk/morpho/dilation.hh
* source:trunk/morpho/opening_area.hh
* source:trunk/morpho/opening_attribute.hh
--
Ticket URL: <https://trac.lrde.org/olena/ticket/130>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image library.
#127: Generalize the definition of the Sobel gradient
-------------------------+--------------------------------------------------
Reporter: levill_r | Owner: Olena Team
Type: enhancement | Status: new
Priority: trivial | Milestone:
Component: Milena | Version: 1.0
Keywords: |
-------------------------+--------------------------------------------------
For the moment (rev. 1656), the Sobel gradient only works on 2-D images.
We could generalize its definition to n-D (regular) images. For instance,
a 3-D version is mentioned in
http://www.aravind.ca/cs788h_Final_Project/gradient_estimators.htm.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/127>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image library.
#135: Name Confilts between util::node and util::node.
-----------------------+----------------------------------------------------
Reporter: garrigues | Owner: Olena Team
Type: defect | Status: new
Priority: major | Milestone: Olena 1.0ß
Component: Milena | Version: 1.0
Keywords: |
-----------------------+----------------------------------------------------
We have two util::node : one for the graph implementation and also one for
the tree.
see source:/trunk/milena/mln/util/tree.hh and
source:/trunk/milena/mln/util/internal/graph_base.hh
--
Ticket URL: <https://trac.lrde.org/olena/ticket/135>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
#137: Write more attribute (connected) filters
----------------------+-----------------------------------------------------
Reporter: levill_r | Owner: Olena Team
Type: task | Status: new
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Keywords: |
----------------------+-----------------------------------------------------
For instance,
* a volume opening/closing;
* a filter based on the height of a component;
* etc.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/137>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Nicolas Ballas <ballas(a)lrde.epita.fr>
Add run image type encoded by image type.
* tests/core/value_enc_image.cc: tests.
* mln/core/pset_array.hh: Fix a mistake.
* mln/core/value_enc_image.hh: New image type.
mln/core/pset_array.hh | 4
mln/core/value_enc_image.hh | 243 ++++++++++++++++++++++++++++++++++++++++++
tests/core/value_enc_image.cc | 47 ++++++++
3 files changed, 292 insertions(+), 2 deletions(-)
Index: tests/core/value_enc_image.cc
--- tests/core/value_enc_image.cc (revision 0)
+++ tests/core/value_enc_image.cc (revision 0)
@@ -0,0 +1,47 @@
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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 tests/core/rle_image.cc
+ *
+ * \brief Test on mln::core::value_enc_image.hh.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/core/value_enc_image.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ /// Basic tests
+ {
+ typedef value_enc_image<point2d, int> ima_type;
+
+ ima_type ima();
+ }
+}
Index: mln/core/pset_array.hh
--- mln/core/pset_array.hh (revision 1905)
+++ mln/core/pset_array.hh (working copy)
@@ -129,8 +129,8 @@
bool
pset_array<Pset>::has(const typename pset_array<Pset>::psite& ps) const
{
- mln_precondition(ps.to_index() < con_.size());
- return con_[ps.to_index()].has(ps.to_psite());
+ return ps.to_index() < con_.size() &&
+ con_[ps.to_index()].has(ps.to_psite());
}
template <typename Pset>
Index: mln/core/value_enc_image.hh
--- mln/core/value_enc_image.hh (revision 0)
+++ mln/core/value_enc_image.hh (revision 0)
@@ -0,0 +1,243 @@
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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_CORE_VALUE_ENC_IMAGE_CC_
+# define MLN_CORE_VALUE_ENC_IMAGE_CC_
+
+/*! \file mln/core/value_enc_image.hh
+ *
+ * \brief FIXME
+ */
+
+# include <mln/core/internal/image_primary.hh>
+
+# include <mln/core/pset_array.hh>
+# include <mln/core/pset_array_psite.hh>
+# include <mln/core/p_runs.hh>
+
+# include <vector>
+
+namespace mln
+{
+
+ // Fwd decl.
+ template <typename P, typename T> struct value_enc_image;
+
+
+ namespace internal
+ {
+
+ /// \internal Data structure for \c mln::rle_image<P,T>.
+ template <typename P, typename T>
+ struct data_< value_enc_image<P, T> >
+ {
+ data_();
+
+ /// Image values.
+ std::vector<T> values_;
+
+ /// domain of the image
+ pset_array< p_runs_<P> > domain_;
+ };
+
+ } // end of namespace mln::internal
+
+
+ namespace trait
+ {
+
+ template <typename P, typename T>
+ struct image_< value_enc_image<P,T> > :
+ default_image_< T, rle_image<P,T> >
+ {
+ typedef trait::image::category::primary category;
+
+ typedef trait::image::access::browsing access;
+
+ // FIXME: Put the right dimension.
+ typedef trait::image::space::two_d space;
+
+ typedef trait::image::size::regular size;
+ typedef trait::image::support::aligned support;
+
+ typedef trait::image::border::none border;
+ typedef trait::image::data::linear data;
+ typedef trait::image::io::read_only io;
+ typedef trait::image::speed::slow speed;
+ };
+
+ } // end of namespace mln::trait
+
+
+ /*! \brief Value encoded image.
+ * FIXME
+ */
+ template <typename P, typename T>
+ class value_enc_image :
+ public internal::image_primary_< pset_array_psite< runs_psite<P> >,
+ value_enc_image<P, T> >
+ {
+ public:
+
+ /// Value related typedefs
+ typedef T value;
+ typedef T& lvalue;
+ typedef const T rvalue;
+ typedef mln::value::set<T> vset;
+
+ /// Domain related typedefs
+ typedef pset_array_psite< runs_psite<P> > psite;
+ typedef pset_array< p_runs_<P> > pset;
+
+ /// Skeleton.
+ typedef value_enc_image< tag::psite_<P>, tag::value_<T> > skeleton;
+
+
+ value_enc_image();
+
+ /// Add a new range to the image.
+ void insert(const p_runs_<P>& pr, T value);
+
+ /*! \brief Tell if the image has the given point site.
+ *
+ * \return True if the image has the point site, else false.
+ */
+ bool has(const psite& ps) const;
+
+ /// Read-only access to the image value located at the site \site.
+ rvalue operator() (const psite& site) const;
+
+ /// Read-write access to the image value located at the site \site.
+ lvalue operator() (const psite& site);
+
+ /// Test if this image has been initialized.
+ bool has_data() const;
+
+ /// Give the set of values of the image.
+ const vset& values() const;
+
+ /// Give the definition domain.
+ const pset& domain() const;
+
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+
+ // internal::data_< value_enc_image<P, T> >
+
+ template <typename P, typename T>
+ inline
+ data_< value_enc_image<P,T> >::data_()
+ {
+ }
+
+ } // end of namespace mln::internal
+
+
+ template <typename P, typename T>
+ inline
+ value_enc_image<P, T>::value_enc_image()
+ {
+ this->data_ = new internal::data_< value_enc_image<P,T> >();
+ }
+
+ template <typename P, typename T>
+ inline
+ bool
+ value_enc_image<P, T>::has_data() const
+ {
+ return this->data_->values_.size() != 0;
+ }
+
+ template <typename P, typename T>
+ inline
+ const typename value_enc_image<P, T>::vset&
+ value_enc_image<P, T>::values() const
+ {
+ return vset::the();
+ }
+
+ template <typename P, typename T>
+ inline
+ void
+ value_enc_image<P, T>::insert(const p_runs_<P>& pr, T value)
+ {
+ if (!this->has_data())
+ this->data_ = new internal::data_< value_enc_image<P,T> >();
+
+ this->data_->domain_.insert(pr);
+ this->data_->values_.push_back(value);
+ }
+
+ template <typename P, typename T>
+ inline
+ bool
+ value_enc_image<P, T>::has(const typename value_enc_image<P, T>::psite& site) const
+ {
+ return this->data_.domain_.has(site);
+ }
+
+ template <typename P, typename T>
+ inline
+ typename value_enc_image<P, T>::rvalue
+ value_enc_image<P, T>::operator() (const typename value_enc_image<P, T>::psite& site)
+ const
+ {
+ mln_precondition(this->has(site));
+
+ return this->data_->values_[site.to_index()];
+ }
+
+ template <typename P, typename T>
+ inline
+ typename value_enc_image<P, T>::lvalue
+ value_enc_image<P, T>::operator() (const typename value_enc_image<P, T>::psite& site)
+ {
+ mln_precondition(this->has(site));
+
+ return this->data_->values_[site.to_index()];
+ }
+
+ template <typename P, typename T>
+ inline
+ const typename value_enc_image<P, T>::pset&
+ value_enc_image<P, T>::domain() const
+ {
+ return this->data_->domain_;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+} // end of namespace mln
+
+
+#endif // ! MLN_CORE_VALUE_ENC_IMAGE_CC_