* green/mln/clustering/kmean3d.hh
(build_all_dbg, build_mean_dbg): Fix bad behaviour.
---
trunk/milena/sandbox/ChangeLog | 9 +++++++++
.../milena/sandbox/green/mln/clustering/kmean3d.hh | 8 +++++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/trunk/milena/sandbox/ChangeLog b/trunk/milena/sandbox/ChangeLog
index ee9ccee..1d68213 100644
--- a/trunk/milena/sandbox/ChangeLog
+++ b/trunk/milena/sandbox/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-08 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
+
+ Correct bad behaviour in kmean3d (see usage of zero label).
+
+ * green/mln/clustering/kmean3d.hh
+ (build_all_dbg, build_mean_dbg): Fix bad behaviour.
+
+
2009-10-07 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Alternate representation of tree (some tries...).
@@ -54,6 +62,7 @@
* edwin/mln/util/ctree/node.hh:
Materials for the new tree representation.
+
2009-10-07 Yann Jacquelet <jacquelet(a)lrde.epita.fr>
Update the demo for debugging purpose.
diff --git a/trunk/milena/sandbox/green/mln/clustering/kmean3d.hh
b/trunk/milena/sandbox/green/mln/clustering/kmean3d.hh
index 81b4f37..6aebefc 100644
--- a/trunk/milena/sandbox/green/mln/clustering/kmean3d.hh
+++ b/trunk/milena/sandbox/green/mln/clustering/kmean3d.hh
@@ -60,6 +60,7 @@
#include <mln/debug/println.hh>
#include <mln/data/fill.hh>
#include <mln/literal/zero.hh>
+#include <mln/literal/one.hh>
#include <mln/labeling/colorize.hh>
#include <mln/labeling/mean_values.hh>
@@ -1117,7 +1118,8 @@ namespace mln
t_value val = _point(pi);
t_label grp = _group(point3d(val.blue(), val.red(), val.green()));
- _label_dbg(po) = grp;
+ // As label zero has got a particular semantic, the first label is one
+ _label_dbg(po) = ++grp;
}
trace::exiting("mln::clustering::kmean3d::build_label_dbg");
@@ -1148,8 +1150,8 @@ namespace mln
{
trace::entering("mln::clustering::kmean3d::build_all_dbg");
build_label_dbg();
- build_mean_dbg();
- //_mean_dbg = labeling::mean_values(_point, _label_dbg, _k_center);
+ //build_mean_dbg();
+ _mean_dbg = labeling::mean_values(_point, _label_dbg, _k_center);
_color_dbg = labeling::colorize(value::rgb8(), _label_dbg);
trace::exiting("mln::clustering::kmean3d::build_all_dbg");
--
1.5.6.5
Show replies by date