Commit 1e7c979f authored by Roland Levillain's avatar Roland Levillain
Browse files

apps/bench: More comparisons on dilation (static win + single pixter).

	* apps/bench/dilation-lena.cc (faster_static::dilation):
	New function.
	Exercise it...
	(main): ...here.
	* apps/bench/Makefile.am (MOSTLYCLEANFILES): Update.
parent ccb4093b
2010-12-14 Roland Levillain <roland@lrde.epita.fr>
apps/bench: More comparisons on dilation (static win + single pixter).
* apps/bench/dilation-lena.cc (faster_static::dilation):
New function.
Exercise it...
(main): ...here.
* apps/bench/Makefile.am (MOSTLYCLEANFILES): Update.
2010-12-14 Roland Levillain <roland@lrde.epita.fr>
 
apps/bench: More comparisons on dilation (variants without accu).
......@@ -38,6 +38,7 @@ MOSTLYCLEANFILES = \
dilation-lena-out-faster.pgm \
dilation-lena-out-faster_noaccu.pgm \
dilation-lena-out-fast_static.pgm \
dilation-lena-out-faster_static.pgm \
gradient-lena-out.pgm \
gradient-spe-lena-out-0.pgm \
gradient-spe-lena-out-1.pgm \
......
......@@ -216,6 +216,32 @@ namespace fast_static
}
}
namespace faster_static
{
using namespace mln;
template <typename I, typename W>
mln_concrete(I) dilation(const I& input, const W& win)
{
typedef mln_concrete(I) O;
O output; initialize(output, input); // Initialize output.
mln_pixter(const I) p(input); // Iterator on the pixels of `input'.
typedef mln::static_dpoints_fwd_pixter<const I, W::Size> mln_static_qixter;
mln_static_qixter q(p, win);
for_all(p)
{
// FIXME: Cheat: replace the accu::supremum by a maximum.
mln::accu::stat::max<mln_value(I)> sup; // Accumulator computing the supremum.
for_all(q)
sup.take(q.val());
*(output.buffer() + p.offset()) = sup.to_result();
}
return output;
}
}
int main()
{
......@@ -279,4 +305,10 @@ int main()
t.stop();
std::cout << t.read() << std::endl;
io::pgm::save(d, "dilation-lena-out-fast_static.pgm");
t.start();
d = faster_static::dilation(lena, static_win_c4p);
t.stop();
std::cout << t.read() << std::endl;
io::pgm::save(d, "dilation-lena-out-faster_static.pgm");
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment