---
swilena/ChangeLog | 4 ++++
swilena/window2d.i | 49 +++++++++++++++++++++++--------------------------
2 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index 6dbc317..a3db9bc 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-15 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ window2d.i: restore the previous version of this file.
+
2008-08-13 Roland Levillain <roland(a)lrde.epita.fr>
Fix the use of int_u8 in image2d_int_u8.i.
diff --git a/swilena/window2d.i b/swilena/window2d.i
index d6145fc..182f6bb 100644
--- a/swilena/window2d.i
+++ b/swilena/window2d.i
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// -*- C++ -*-
+// Copyright (C) 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
@@ -21,40 +22,36 @@
// 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
+// License.
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/io/magick/magick.cc
-///
-/// Test on mln::io::magick::*.
+/// \file window2d.i
+/// \brief A wrapper of mln::window2d.
-#include <mln/core/image/image2d.hh>
-#include <mln/io/magick/load.hh>
-#include <mln/io/ppm/save.hh>
+%module window2d
-#include <mln/level/compare.hh>
+%import "dpoint2d.i"
-#include <mln/value/int_u8.hh>
-#include <mln/value/rgb8.hh>
+%{
+#include "mln/core/window2d.hh"
+%}
-#include "tests/data.hh"
+%include "mln/core/macros.hh"
-#include <mln/debug/println.hh>
+%include "mln/core/concept/window.hh"
+%include "mln/core/window.hh"
-int main()
-{
- using namespace mln;
+%include "mln/core/window2d.hh"
- {
- image2d<value::rgb8> lena_im;
- io::magick::load(lena_im, "lena.png");
+// Swig tries to wrap everything by default; prevent it from wrapping
+// invalid methods (1D and 3D insertions for a window2d).
+%ignore mln::window< mln::dpoint_<mln::grid::square, int > >::
+insert(const typename mln::dpoint_<mln::grid::square, int>::coord&);
+%ignore mln::window< mln::dpoint_<mln::grid::square, int > >::
+insert(const typename mln::dpoint_<mln::grid::square, int>::coord&,
+ const typename mln::dpoint_<mln::grid::square, int>::coord&,
+ const typename mln::dpoint_<mln::grid::square, int>::coord&);
- image2d<value::rgb8> lena_mln;
- io::ppm::load(lena_mln, "lena.ppm");
-
- mln_assertion(lena_im.domain() == lena_mln.domain());
- mln_assertion(lena_im == lena_mln);
- }
-}
+%template(window2d) mln::window< mln::dpoint_<mln::grid::square, int > >;
--
1.5.6.5
* doc/examples/Makefile.am,
* doc/examples/fill-subdomain.cc,
* doc/examples/labeling-compute.cc,
* doc/examples/tuto3/colorize.cc,
* doc/examples/tuto4/point2d.cc,
* doc/examples/tuto4_genericity_and_algorithms.cc: update examples.
* doc/outputs/site_set_create.txt,
* doc/outputs/colorize.txt,
* doc/outputs/println.txt,
* doc/outputs/trace.txt: rename as...
* doc/outputs/tuto4_site_set_create.txt,
* doc/outputs/tuto3_println.txt,
* doc/outputs/tuto3_colorize.txt,
* doc/outputs/tuto3_trace.txt: ... this.
* doc/outputs/tuto4_point2d.txt: new reference output file.
* doc/tools/split_sample.sh: add subdir names to example binary names.
* doc/tutorial/tutorial.tex: include correct code samples.
* mln/accu/bbox.hh: temporary disable a precondition.
* mln/accu/compute.hh: add a fixme.
* mln/core/image/tr_image.hh: require an image to be const in the constructor.
* mln/core/site_set/p_array.hh: fix invalid static_cast.
* mln/labeling/compute.hh: add more comments.
* mln/labeling/essential.hh: add missing include.
* mln/morpho/hit_or_miss.hh: avoid warnings.
---
milena/ChangeLog | 41 ++++++++++++++++++++
milena/doc/examples/Makefile.am | 18 +++++----
milena/doc/examples/fill-subdomain.cc | 4 +-
milena/doc/examples/labeling-compute.cc | 2 +-
milena/doc/examples/tuto3/colorize.cc | 4 +-
milena/doc/examples/tuto4/point2d.cc | 11 +++++
.../examples/tuto4_genericity_and_algorithms.cc | 4 +-
.../outputs/{colorize.txt => tuto3_colorize.txt} | 0
.../doc/outputs/{println.txt => tuto3_println.txt} | 0
milena/doc/outputs/{trace.txt => tuto3_trace.txt} | 0
milena/doc/outputs/tuto4_point2d.txt | 1 +
...te_set_create.txt => tuto4_site_set_create.txt} | 0
milena/doc/tools/split_sample.sh | 7 +++-
milena/doc/tutorial/tutorial.tex | 41 ++++++++++---------
milena/mln/accu/bbox.hh | 2 +-
milena/mln/accu/compute.hh | 1 +
milena/mln/core/image/tr_image.hh | 15 ++++---
milena/mln/core/site_set/p_array.hh | 10 +----
milena/mln/labeling/compute.hh | 10 ++++-
milena/mln/labeling/essential.hh | 1 +
milena/mln/morpho/hit_or_miss.hh | 10 ++--
21 files changed, 124 insertions(+), 58 deletions(-)
create mode 100644 milena/doc/examples/tuto4/point2d.cc
rename milena/doc/outputs/{colorize.txt => tuto3_colorize.txt} (100%)
rename milena/doc/outputs/{println.txt => tuto3_println.txt} (100%)
rename milena/doc/outputs/{trace.txt => tuto3_trace.txt} (100%)
create mode 100644 milena/doc/outputs/tuto4_point2d.txt
rename milena/doc/outputs/{site_set_create.txt => tuto4_site_set_create.txt} (100%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 7acb948..d334fc3 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,44 @@
+2009-05-15 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Small fixes (again)
+
+ * doc/examples/Makefile.am,
+ * doc/examples/fill-subdomain.cc,
+ * doc/examples/labeling-compute.cc,
+ * doc/examples/tuto3/colorize.cc,
+ * doc/examples/tuto4/point2d.cc,
+ * doc/examples/tuto4_genericity_and_algorithms.cc: update examples.
+
+ * doc/outputs/site_set_create.txt,
+ * doc/outputs/colorize.txt,
+ * doc/outputs/println.txt,
+ * doc/outputs/trace.txt: rename as...
+
+ * doc/outputs/tuto4_site_set_create.txt,
+ * doc/outputs/tuto3_println.txt,
+ * doc/outputs/tuto3_colorize.txt,
+ * doc/outputs/tuto3_trace.txt: ... this.
+
+ * doc/outputs/tuto4_point2d.txt: new reference output file.
+
+ * doc/tools/split_sample.sh: add subdir names to example binary names.
+
+ * doc/tutorial/tutorial.tex: include correct code samples.
+
+ * mln/accu/bbox.hh: temporary disable a precondition.
+
+ * mln/accu/compute.hh: add a fixme.
+
+ * mln/core/image/tr_image.hh: require an image to be const in the constructor.
+
+ * mln/core/site_set/p_array.hh: fix invalid static_cast.
+
+ * mln/labeling/compute.hh: add more comments.
+
+ * mln/labeling/essential.hh: add missing include.
+
+ * mln/morpho/hit_or_miss.hh: avoid warnings.
+
2009-05-12 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
Small fixes.
diff --git a/milena/doc/examples/Makefile.am b/milena/doc/examples/Makefile.am
index a7b4579..88e7639 100644
--- a/milena/doc/examples/Makefile.am
+++ b/milena/doc/examples/Makefile.am
@@ -53,13 +53,14 @@ tuto4_genericity_and_algorithms
# Tuto3
noinst_PROGRAMS += \
-colorize \
-println \
-trace
+tuto3_colorize \
+tuto3_println \
+tuto3_trace
# Tuto4
noinst_PROGRAMS += \
-site_set_create
+tuto4_point2d \
+tuto4_site_set_create
accu_right_instanciation_SOURCES = accu-right-instanciation.cc
borderthickness_SOURCES = borderthickness.cc
@@ -108,12 +109,13 @@ tuto3_rw_image_SOURCES = tuto3_rw_image.cc
tuto4_genericity_and_algorithms_SOURCES = tuto4_genericity_and_algorithms.cc
# Tuto 3
-colorize_SOURCES = tuto3/colorize.cc
-println_SOURCES = tuto3/println.cc
-trace_SOURCES = tuto3/trace.cc
+tuto3_colorize_SOURCES = tuto3/colorize.cc
+tuto3_println_SOURCES = tuto3/println.cc
+tuto3_trace_SOURCES = tuto3/trace.cc
# Tuto 4
-site_set_create_SOURCES = tuto4/site_set_create.cc
+tuto4_site_set_create_SOURCES = tuto4/site_set_create.cc
+tuto4_point2d_SOURCES = tuto4/point2d.cc
all: clean-figures
mkdir -p $(OUTPUTS_BUILDDIR)
diff --git a/milena/doc/examples/fill-subdomain.cc b/milena/doc/examples/fill-subdomain.cc
index a44d070..be94209 100644
--- a/milena/doc/examples/fill-subdomain.cc
+++ b/milena/doc/examples/fill-subdomain.cc
@@ -27,7 +27,7 @@ int main()
image2d<label_8> lbl = labeling::blobs(ima, c4(), nlabels);
// \}
- doc::ppmsave(debug::colorize(rgb8(), lbl, nlabels), "fill-subdomain");
+ doc::ppmsave(labeling::colorize(rgb8(), lbl, nlabels), "fill-subdomain");
// Create a new image from lbl's sites being part of component 2.
// \{
@@ -38,7 +38,7 @@ int main()
initialize(tmp, lbl);
data::fill(tmp, 0);
data::fill((tmp | lbl_2.domain()).rw(), 1);
- doc::ppmsave(debug::colorize(rgb8(), tmp, 1), "fill-subdomain");
+ doc::ppmsave(labeling::colorize(rgb8(), tmp, 1), "fill-subdomain");
// Create a black image from ima.
// Fill sites being part of component 2 with red.
diff --git a/milena/doc/examples/labeling-compute.cc b/milena/doc/examples/labeling-compute.cc
index a22b471..1a340d4 100644
--- a/milena/doc/examples/labeling-compute.cc
+++ b/milena/doc/examples/labeling-compute.cc
@@ -24,7 +24,7 @@ int main()
label_8 nlabels;
image2d<label_8> lbl = labeling::blobs(ima, c4(), nlabels);
// \}
- doc::ppmsave(debug::colorize(rgb8(), lbl, nlabels),
+ doc::ppmsave(labeling::colorize(rgb8(), lbl, nlabels),
"labeling-compute");
diff --git a/milena/doc/examples/tuto3/colorize.cc b/milena/doc/examples/tuto3/colorize.cc
index 59dba6f..f611908 100644
--- a/milena/doc/examples/tuto3/colorize.cc
+++ b/milena/doc/examples/tuto3/colorize.cc
@@ -1,7 +1,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/make/image2d.hh>
#include <mln/value/int_u8.hh>
-#include <mln/debug/colorize.hh>
+#include <mln/labeling/colorize.hh>
#include <doc/tools/sample_utils.hh>
int main()
@@ -17,7 +17,7 @@ int main()
65, 65, 65, 127, 127 };
image2d<int_u8> ima = make::image2d(vals);
- image2d<rgb8> ima_color = debug::colorize(rgb8(), ima, 230);
+ image2d<rgb8> ima_color = labeling::colorize(rgb8(), ima, 230);
// \}
doc::pgmsave(ima, "colorize");
diff --git a/milena/doc/examples/tuto4/point2d.cc b/milena/doc/examples/tuto4/point2d.cc
new file mode 100644
index 0000000..246ab2e
--- /dev/null
+++ b/milena/doc/examples/tuto4/point2d.cc
@@ -0,0 +1,11 @@
+#include <mln/core/alias/point2d.hh>
+
+int main()
+{
+ using namespace mln;
+
+ // \{
+ point2d p(3,3);
+ std::cout << p << std::endl;
+ // \}
+}
diff --git a/milena/doc/examples/tuto4_genericity_and_algorithms.cc b/milena/doc/examples/tuto4_genericity_and_algorithms.cc
index 296638e..cb091bb 100644
--- a/milena/doc/examples/tuto4_genericity_and_algorithms.cc
+++ b/milena/doc/examples/tuto4_genericity_and_algorithms.cc
@@ -1,6 +1,6 @@
#include <mln/essential/2d.hh>
#include <mln/binarization/threshold.hh>
-#include <mln/debug/colorize.hh>
+#include <mln/labeling/colorize.hh>
#include <tests/data.hh>
#include <doc/tools/sample_utils.hh>
@@ -80,7 +80,7 @@ int main()
value::label_8 nlabels;
image2d<value::label_8> label = labeling::blobs(lena_bw, c8(), nlabels);
// \}
- doc::ppmsave(debug::colorize(value::rgb8(), label, nlabels), "tuto4_genericity_and_algorithms");
+ doc::ppmsave(labeling::colorize(value::rgb8(), label, nlabels), "tuto4_genericity_and_algorithms");
// \{
data::fill((lena | (pw::value(label) == pw::cst(0u))).rw(), literal::blue);
diff --git a/milena/doc/outputs/colorize.txt b/milena/doc/outputs/tuto3_colorize.txt
similarity index 100%
rename from milena/doc/outputs/colorize.txt
rename to milena/doc/outputs/tuto3_colorize.txt
diff --git a/milena/doc/outputs/println.txt b/milena/doc/outputs/tuto3_println.txt
similarity index 100%
rename from milena/doc/outputs/println.txt
rename to milena/doc/outputs/tuto3_println.txt
diff --git a/milena/doc/outputs/trace.txt b/milena/doc/outputs/tuto3_trace.txt
similarity index 100%
rename from milena/doc/outputs/trace.txt
rename to milena/doc/outputs/tuto3_trace.txt
diff --git a/milena/doc/outputs/tuto4_point2d.txt b/milena/doc/outputs/tuto4_point2d.txt
new file mode 100644
index 0000000..c1e07e2
--- /dev/null
+++ b/milena/doc/outputs/tuto4_point2d.txt
@@ -0,0 +1 @@
+(3,3)
diff --git a/milena/doc/outputs/site_set_create.txt b/milena/doc/outputs/tuto4_site_set_create.txt
similarity index 100%
rename from milena/doc/outputs/site_set_create.txt
rename to milena/doc/outputs/tuto4_site_set_create.txt
diff --git a/milena/doc/tools/split_sample.sh b/milena/doc/tools/split_sample.sh
index 5c508fb..20cfc82 100755
--- a/milena/doc/tools/split_sample.sh
+++ b/milena/doc/tools/split_sample.sh
@@ -12,7 +12,12 @@ split=false
i=1
for begin in $begins; do
partend=$((`echo $ends | cut -d ' ' -f $i` - 1))
- head -n $partend $1 | tail -n $(($partend - $begin)) > $3/"`basename $1 .$2`-$i.$2"
+ subdir=`basename \`dirname $1\``
+ out_name="`basename $1 .$2`-$i.$2"
+ if [ "$subdir" != "examples" ] && [ "$subdir" != "outputs" ]; then
+ out_name="${subdir}_$out_name"
+ fi
+ head -n $partend $1 | tail -n $(($partend - $begin)) > "$3/$out_name"
i=$((i+1))
split=true
done
diff --git a/milena/doc/tutorial/tutorial.tex b/milena/doc/tutorial/tutorial.tex
index 509a002..9905e57 100644
--- a/milena/doc/tutorial/tutorial.tex
+++ b/milena/doc/tutorial/tutorial.tex
@@ -821,11 +821,11 @@ routines/tools than what this program actually does.
Here is the full example:
-\doxycode[1]{first_routine}
+\doxycode[1]{tuto3_first_routine}
Let's see the different parts of the algorithm.
-\doxycode[2]{first_routine}
+\doxycode[2]{tuto3_first_routine}
The prototype is restrictive enough, readable and still generic.
We use concepts to statically check that the generic type passed as
parameter is what the routine expects. The ``exact'' image type is \type{I}. For
@@ -837,12 +837,12 @@ The important point to remember is that a generic function should not return
\type{I} directly but \code{mln\_concrete(I)} instead.
-\doxycode[3]{first_routine}
+\doxycode[3]{tuto3_first_routine}
Like any Milena's routine, note that we use \code{trace}. This debugging tool
will be detailled in section \ref{tuto3debughints}.
-\doxycode[4]{first_routine}
+\doxycode[4]{tuto3_first_routine}
Since the function take some arguments thanks their concept, these object cannot
be used as such. Indeed, concepts are empty shells only used for dispatching and
concept checking, that's the reason why they are parameterized with their exact
@@ -852,7 +852,7 @@ Of course, it is always a good idea to add few preconditions to help during
debug.
-\doxycode[5]{first_routine}
+\doxycode[5]{tuto3_first_routine}
In this portion of code, the image is labeled and the number of site per label
is computed. This code does not depend on the image type at all. Again, a macro
\code{mln\_ch\_value} (``mln change value'') helps us. \code{labeling::blobs} is a routine returning an
@@ -862,7 +862,7 @@ image of the same kind as the input image but with a different value.
different value type.
-\doxycode[6]{first_routine}
+\doxycode[6]{tuto3_first_routine}
The output image is declared here. Like any variable, it must be initialized at
some point. To do so, \code{initialize()} is provided. It is a generic routine
which can initialize the geometry any kind of image with another image of the
@@ -873,14 +873,14 @@ Note that the value passed to \code{data::fill} is also generic. The library
includes few generic common values from which any value type can convert to.
-\doxycode[7]{first_routine}
+\doxycode[7]{tuto3_first_routine}
In this part, every region from the labeled image, of which cardinality is lower
than 10 sites, is set to \val{literal::zero} in \var{output}.
Once again, a generic value is used in order to avoid a constraints on the image
value type.
-\doxycode[8]{first_routine}
+\doxycode[8]{tuto3_first_routine}
Don't forget to close the trace before exiting the function. Then return the
result.
@@ -1024,9 +1024,9 @@ Since it's a global variable, at anytime in the source code, the trace can be
enabled/disabled.
Traces are enabled:
-\doxycode[1]{trace}
+\doxycode[1]{tuto3_trace}
\code{labeleling::blobs} is run and the debug is then disabled.
-\doxycode[2]{trace}
+\doxycode[2]{tuto3_trace}
The previous code will produce the following trace:
@@ -1055,21 +1055,21 @@ been disabled just before it is called.
Milena also provides a lot of debug tools. Here is a small list of the tools:
\begin{itemize}
\item mln::debug::println, print an image in the console.
- \doxycode[1]{println}
- \doxymoutput[1]{println}
+ \doxycode[1]{tuto3_println}
+ \doxymoutput[1]{tuto3_println}
\item mln::debug::println\_with\_border, print an image in the console withs
its border.
- \doxycode[2]{println}
- \doxymoutput[2]{println}
+ \doxycode[2]{tuto3_println}
+ \doxymoutput[2]{tuto3_println}
- \item mln::debug::colorize, colorize a label image with random colors.
- \doxycode[1]{colorize}
+ \item mln::labeling::colorize, colorize a label image with random colors.
+ \doxycode[1]{tuto3_colorize}
\begin{center}
\begin{tabular}{c c c}
- \doxyfigure[1]{colorize}{3cm} & ~\huge{$\rightarrow$}~ &
- \doxyfigure[2]{colorize}{3cm} \\
+ \doxyfigure[1]{tuto3_colorize}{3cm} & ~\huge{$\rightarrow$}~ &
+ \doxyfigure[2]{tuto3_colorize}{3cm} \\
\end{tabular}
\end{center}
\end{itemize}
@@ -1090,7 +1090,7 @@ compilation time w.r.t compilation options (O1, DNDEBUG).
This chapter aims at explaining how images are stored and which objects compose
an image in Milena. We will start to talk about the localization of a pixel and
-then the image itself which includes the values.
+then the image itself which stores the values.
%**************************
@@ -1103,9 +1103,12 @@ A site can be any kind of localization element.
For instance, in an image defined on a 2D regular grid, it is a 2D point with
\var{row} and \var{col} coordinates.
+\doxycode{tuto4_point2d}
+
The site type in an image is defined by its underlying site set.
+
%**************************
\doxysection{tuto4images}{Site sets}
diff --git a/milena/mln/accu/bbox.hh b/milena/mln/accu/bbox.hh
index 35ecd4d..97dde49 100644
--- a/milena/mln/accu/bbox.hh
+++ b/milena/mln/accu/bbox.hh
@@ -202,7 +202,7 @@ namespace mln
const box<P>&
bbox<P>::to_result() const
{
- mln_precondition(is_valid_);
+// mln_precondition(is_valid_);
return b_;
}
diff --git a/milena/mln/accu/compute.hh b/milena/mln/accu/compute.hh
index f78c6ec..fa07d1b 100644
--- a/milena/mln/accu/compute.hh
+++ b/milena/mln/accu/compute.hh
@@ -150,6 +150,7 @@ namespace mln
mln_precondition(exact(input).is_valid());
+ //FIXME: why adding util::pix here?
typedef mln_accu_with(A, util::pix<I>) A_;
util::pix<I>* pix_; // So we can pass a pixel below (pixel has
// no ctor without arg).
diff --git a/milena/mln/core/image/tr_image.hh b/milena/mln/core/image/tr_image.hh
index b73654c..7021e96 100644
--- a/milena/mln/core/image/tr_image.hh
+++ b/milena/mln/core/image/tr_image.hh
@@ -53,7 +53,7 @@ namespace mln
template <typename S, typename I, typename T>
struct data< tr_image<S,I,T> >
{
- data(const S& s, I& ima, const T& tr);
+ data(const S& s, const I& ima, const T& tr);
I ima_;
T tr_;
@@ -107,7 +107,7 @@ namespace mln
/// Constructors.
- tr_image(const S& s, I& ima, const T& tr);
+ tr_image(const S& s, const I& ima, const T& tr);
/* FIXME: What's the purpose of this ctor? AFAIK, morphers
objects (and images in general) cannot have their structure /
core data altered after they're built. Here, there's a
@@ -117,7 +117,7 @@ namespace mln
tr_image();
/// Initialize an empty image.
- void init_(const S& s, I& ima, const T& tr);
+ void init_(const S& s, const I& ima, const T& tr);
/// Test if this image has been initialized.
bool is_valid() const;
@@ -149,7 +149,7 @@ namespace mln
template <typename S, typename I, typename T>
inline
- data< tr_image<S,I,T> >::data(const S& s, I& ima, const T& tr)
+ data< tr_image<S,I,T> >::data(const S& s, const I& ima, const T& tr)
: ima_(ima),
tr_(tr),
s_(s)
@@ -160,7 +160,7 @@ namespace mln
template <typename S, typename I, typename T>
inline
- tr_image<S,I,T>::tr_image(const S& s, I& ima, const T& tr)
+ tr_image<S,I,T>::tr_image(const S& s, const I& ima, const T& tr)
{
init_(s, ima, tr);
}
@@ -168,7 +168,7 @@ namespace mln
template <typename S, typename I, typename T>
inline
void
- tr_image<S,I,T>::init_(const S& s, I& ima, const T& tr)
+ tr_image<S,I,T>::init_(const S& s, const I& ima, const T& tr)
{
mln_precondition(ima.is_valid());
this->data_ = new internal::data< tr_image<S,I,T> >(s, ima, tr);
@@ -225,7 +225,8 @@ namespace mln
template <typename S, typename I, typename T>
inline
tr_image<S,I,T>
- transposed_image(const Site_Set<S>& s, Image<I>& ima, const Function_x2x<T>& t)
+ transposed_image(const Site_Set<S>& s, const Image<I>& ima,
+ const Function_x2x<T>& t)
{
tr_image<S,I,T> tmp(exact(s), exact(ima), exact(t));
return tmp;
diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh
index b4a4b0f..bc0c58a 100644
--- a/milena/mln/core/site_set/p_array.hh
+++ b/milena/mln/core/site_set/p_array.hh
@@ -208,7 +208,6 @@ namespace mln
bool is_valid() const;
- operator mln_element(S)() const; // Does it cause ambiguities with "operator int" ?
operator util::index() const;
operator int() const; // To interoperate, e.g., with fun::i2v expecting an int.
operator unsigned() const; // To avoid ambiguity when an unsigned is expected.
@@ -360,7 +359,7 @@ namespace mln
if (! has(p.index()))
return false;
// The type of rhs below is mln_site(p_array<P>).
- mln_invariant(static_cast<P>(p) == static_cast<P>((*this)[p.index()]));
+ mln_invariant(p == static_cast<P>((*this)[p.index()]));
return true;
}
@@ -587,13 +586,6 @@ namespace mln
template <typename S>
inline
- p_indexed_psite<S>::operator mln_element(S)() const
- {
- return p_;
- }
-
- template <typename S>
- inline
p_indexed_psite<S>::operator util::index() const
{
return i_;
diff --git a/milena/mln/labeling/compute.hh b/milena/mln/labeling/compute.hh
index 9b99c2f..03ed1e5 100644
--- a/milena/mln/labeling/compute.hh
+++ b/milena/mln/labeling/compute.hh
@@ -36,8 +36,16 @@
///
/// \todo write fastest version.
///
-/// \todo Move versions without 'input' as arg into mln::set
+///
+/// TODO: Move versions without 'input' as arg into mln::set
/// and change 'input' from Image to Site_Set!
+/// ==> NO, see below. (Z)
+///
+/// The overload not taking 'input' as argument works on sites and would be a good
+/// candidate for set::compute. However, the fact that this version of compute
+/// is in the namespace 'labeling' means that it produces several results at the
+/// same time for each labels which is not the case of other implementations of
+/// compute.
# include <mln/core/concept/image.hh>
# include <mln/core/concept/accumulator.hh>
diff --git a/milena/mln/labeling/essential.hh b/milena/mln/labeling/essential.hh
index 3a5544d..3ed2d7e 100644
--- a/milena/mln/labeling/essential.hh
+++ b/milena/mln/labeling/essential.hh
@@ -33,6 +33,7 @@
/// File that includes essential labeling routines.
# include <mln/labeling/blobs.hh>
+# include <mln/labeling/colorize.hh>
# include <mln/labeling/compute.hh>
# include <mln/labeling/relabel.hh>
diff --git a/milena/mln/morpho/hit_or_miss.hh b/milena/mln/morpho/hit_or_miss.hh
index 044db91..99415e1 100644
--- a/milena/mln/morpho/hit_or_miss.hh
+++ b/milena/mln/morpho/hit_or_miss.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 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
@@ -126,9 +126,9 @@ namespace mln
mln_precondition((win_hit && win_miss).is_empty());
// Avoid warnings.
- (void) input_;
- (void) win_hit_;
- (void) win_miss_;
+ (void) input;
+ (void) win_hit;
+ (void) win_miss;
}
} // end of namespace mln::morpho::internal
--
1.5.6.5
#162: Implement windows, neighborhoods, and corresponding iterators for complex-
based images
----------------------+-----------------------------------------------------
Reporter: levill_r | Owner: levill_r
Type: task | Status: new
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Keywords: |
----------------------+-----------------------------------------------------
For a given (fixed) dimension ''n'' and a psite ''p'' on a ''n''-face,
implement windows/neighborhoods (and corresponding iterators) returning
* the set of (''n''-1)-faces adjacent to ''p'' (using ``mln::p_faces``
and ``mln::faces_psite``?);
* the set of (''n''+1)-faces adjacent to ''p'' (using ``mln::p_faces``
and ``mln::faces_psite``?);
* the set of ''n''-faces sharing a (''n''-1)-face with ''p'';
* the set of ''n''-faces sharing a (''n''-1)-face or (''n''-2)-face (by
transitivity) with ''p'' (is it useful?);
* the set of the faces in the ``cell'' including ''p'' (named
``''p''-hat'' in
couprie.08.pami), i.e., the set of all ''m''-faces adjacent to ''p'',
where ''m'' is in [0, ''n''-1].[[BR]]
In that definition, ''p'' is said adjacent to an ''m''-face ''q'' if
there is a sequence (''m,,1,,'', ''m,,2,,'', ..., ''m,,k,,'') of faces so
that
* ''m,,1,,'' is an (''n''-1)-face adjacent to ''p'' ;
* ''m,,2,,'' is an (''n''-2)-face adjacent to ''m,,1,,'' ;
* ... (and so on)
* ''m,,k,,'' is an (''m''+1)-face adjacent to ''q''.
* what else?
As in #139, we might want to factor things using implementation classes:
* ``mln::internal::complex_vicinity``
* ``mln::internal::complex_vicinity_piter``
We might even be able to factor them with graph-based ones.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/162>
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.