---
milena/mln/inpainting/fast_isotropic_diffusion.hh | 3 --
milena/mln/inpainting/inpaint.hh | 22 ++++++++++++--------
milena/mln/inpainting/lpde.hh | 2 -
milena/mln/inpainting/tv.hh | 10 +++-----
4 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/milena/mln/inpainting/fast_isotropic_diffusion.hh
b/milena/mln/inpainting/fast_isotropic_diffusion.hh
index fad9fac..e28d787 100644
--- a/milena/mln/inpainting/fast_isotropic_diffusion.hh
+++ b/milena/mln/inpainting/fast_isotropic_diffusion.hh
@@ -79,9 +79,6 @@ namespace mln
std::swap(u_, u_next_);
}
-
- std::cout << iterations << "\t";
-
}
} /* mln::inpainting */
diff --git a/milena/mln/inpainting/inpaint.hh b/milena/mln/inpainting/inpaint.hh
index ff58e75..fb99a96 100644
--- a/milena/mln/inpainting/inpaint.hh
+++ b/milena/mln/inpainting/inpaint.hh
@@ -127,9 +127,13 @@ namespace mln
for_all_2(p, p_new)
{
- output(p).comp(0) = p_new.val()[0] * range;
- output(p).comp(1) = p_new.val()[1] * range;
- output(p).comp(2) = p_new.val()[2] * range;
+ algebra::vec<3u, int> v = p_new.val() * range;
+
+ internal::interval(v, 0, 255);
+
+ output(p).comp(0) = v[0];
+ output(p).comp(1) = v[1];
+ output(p).comp(2) = v[2];
}
}
@@ -142,12 +146,12 @@ namespace mln
new_mask);
if (out_error)
- *out_error = color_error;
-
- std::cout << std::setprecision(6) << std::fixed
- << t << "\t\t"
- << (1 - color_error) * 100 << "\t\t"
- << (1 - gradient_error) * 100 << "\t";
+ *out_error = (1 - color_error) * 100;
+ else
+ std::cout << std::setprecision(6) << std::fixed
+ << t << "\t\t"
+ << (1 - color_error) * 100 << "\t\t"
+ << (1 - gradient_error) * 100 << "\t";
return output;
}
diff --git a/milena/mln/inpainting/lpde.hh b/milena/mln/inpainting/lpde.hh
index 2eeca78..a293450 100644
--- a/milena/mln/inpainting/lpde.hh
+++ b/milena/mln/inpainting/lpde.hh
@@ -253,8 +253,6 @@ namespace mln
++t;
}
-
- std::cout << t << "\t";
}
void lpde::set(const std::vector<float_type>& w)
diff --git a/milena/mln/inpainting/tv.hh b/milena/mln/inpainting/tv.hh
index 44bf24b..3b38270 100644
--- a/milena/mln/inpainting/tv.hh
+++ b/milena/mln/inpainting/tv.hh
@@ -36,14 +36,14 @@ namespace mln
namespace internal
{
- template <typename T>
+ template <typename T, typename V>
inline
void interval(T& v,
- tv::float_type min,
- tv::float_type max)
+ const V& min,
+ const V& max)
{
for (unsigned i = 0; i < mln_dim(T); ++i)
- v[i] = std::max(std::min(v[i], max), min);
+ v[i] = std::max(std::min((V) v[i], max), min);
}
template <typename T>
@@ -236,8 +236,6 @@ namespace mln
++iterations;
}
- std::cout << iterations << "\t";
-
data::paste(u, src);
}
--
1.7.2.5