https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
Update final_qk.
Final_qk didn't use correct points.
* jardonnet/test/icp.cc: .
* jardonnet/registration/final_qk.hh: .
* jardonnet/registration/icp.hh: .
* jardonnet/test/no_final.ppm: New.
registration/final_qk.hh | 6 +++---
registration/icp.hh | 11 ++++-------
test/icp.cc | 2 +-
3 files changed, 8 insertions(+), 11 deletions(-)
Index: jardonnet/test/no_final.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: jardonnet/test/no_final.ppm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Index: jardonnet/test/icp.cc
--- jardonnet/test/icp.cc (revision 1963)
+++ jardonnet/test/icp.cc (working copy)
@@ -78,9 +78,9 @@
for (size_t i = 0; i < c.npoints(); i++)
length[i] = norm::l2(algebra::vec<3,int> (c[i] - map(c[i])));
-
// final transform
quat7<3> fqk = registration::final_qk(c, map, 2 * stddev);
+ std::cout << fqk << std::endl;
fqk.apply_on(c, c, c.npoints());
//to 2d : projection (FIXME:if 3d)
Index: jardonnet/registration/final_qk.hh
--- jardonnet/registration/final_qk.hh (revision 1963)
+++ jardonnet/registration/final_qk.hh (working copy)
@@ -46,10 +46,10 @@
for (size_t i = 0; i < c.npoints(); ++i)
{
- algebra::vec<3,float> xki = map(c[i]);
algebra::vec<3,float> ci = c[i];
+ algebra::vec<3,float> xki = map(c[i]);
- if (norm::l2(ci - xki) > nstddev)
+ if (norm::l2(ci - xki) < nstddev)
{
newc.append(c[i]);
mu_newc += ci;
@@ -59,7 +59,7 @@
quat7<P::dim> qk = match(newc, mu_newc, newc, map, newc.npoints());
- qk._qT = - qk._qT; // FIXME : why?
+ //qk._qT = - qk._qT; // FIXME : why?
return qk;
}
Index: jardonnet/registration/icp.hh
--- jardonnet/registration/icp.hh (revision 1963)
+++ jardonnet/registration/icp.hh (working copy)
@@ -133,12 +133,10 @@
//update qk
- /*
if (k > 3)
qk = update_qk(buf_qk, buf_dk);
qk._qR.set_unit();
buf_qk[0] = qk;
- */
//Ck+1 = qk(C)
qk.apply_on(C, Ck, c_length);
@@ -180,7 +178,7 @@
template <typename P, typename M>
inline
quat7<P::dim>
- icp(p_array<P> cloud, //here reference implies low efficiency
(FIXME:check again)
+ icp(p_array<P> cloud, // More efficient without reference
const M& map,
const float q,
const unsigned nb_it,
@@ -199,7 +197,7 @@
#ifndef NDEBUG // FIXME: theo
- image2d<value::rgb8> tmp(500,800);
+ image2d<value::rgb8> tmp(500,500); // FIXME :
level::fill(tmp, literal::black);
//write X
mln_piter(p_array<P>) p(x);
@@ -207,7 +205,7 @@
{
point2d qp = make::point2d(p[0], p[1]);
if (tmp.has(qp))
- tmp(qp) = literal::white;
+ tmp(qp) = literal::green;
}
#endif
@@ -224,7 +222,7 @@
{
value::rgb8 c;
switch (e) {
- case 2: c = literal::green; break;
+ case 2: c = literal::white; break;
case 1: c = literal::blue; break;
case 0: c = literal::red; break;
}
@@ -236,7 +234,6 @@
if (tmp.has(qp))
tmp(qp) = c;
}
- //if (e == 0)
io::ppm::save(tmp, "tmp.ppm");
}
#endif