milena r3737: Fixed display_edge() function

URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2009-04-30 Fabien Freling <fabien.freling@lrde.epita.fr> Fixed display_edge() function. * mln/world/inter_pixel/display_edge.hh: Create an image displaying edges values (int_u8). --- display_edge.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: trunk/milena/mln/world/inter_pixel/display_edge.hh =================================================================== --- trunk/milena/mln/world/inter_pixel/display_edge.hh (revision 3736) +++ trunk/milena/mln/world/inter_pixel/display_edge.hh (revision 3737) @@ -48,12 +48,12 @@ { template <typename I> + inline I display_edge(const I& ima, mln_value(I) bg, unsigned zoom) { - unsigned nrows = ima.nrows() / 2 + 1; - unsigned ncols = ima.ncols() / 2 + 1; - I output(nrows * (zoom + 1) - 1, - ncols * (zoom + 1) - 1); + box2d b = ima.bbox(); + I output(make::box2d((b.pmin()[0] / 2) * (zoom + 1) + 1, (b.pmin()[1] / 2) * (zoom + 1) + 1, + (b.pmax()[0] / 2) * (zoom + 1) - 1, (b.pmax()[1] / 2) * (zoom + 1) - 1)); data::fill(output, bg); typedef image_if<const I, dim2::is_edge> edge_t; edge_t edge = ima | dim2::is_edge();
participants (1)
-
Fabien Freling