r3520: HistoRGB out image size correction

URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox ChangeLog: 2009-03-13 Etienne FOLIO <folio@lrde.epita.fr> HistoRGB out image size correction. * folio/histo/compute_histo_rgb.hh: Computes now the right dimensions of the histogram. --- compute_histo_rgb.hh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) Index: trunk/milena/sandbox/folio/histo/compute_histo_rgb.hh =================================================================== --- trunk/milena/sandbox/folio/histo/compute_histo_rgb.hh (revision 3519) +++ trunk/milena/sandbox/folio/histo/compute_histo_rgb.hh (revision 3520) @@ -7,7 +7,7 @@ #include <mln/core/image/image3d.hh> #include <mln/value/int_u8.hh> #include <mln/value/rgb8.hh> - +#include <iostream> namespace mln { namespace histo @@ -17,9 +17,10 @@ image3d<C> compute_histo_rgb(image2d<T> ima) { // out - image3d<C> out(mln_max(C), - mln_max(C), - mln_max(C)); + typedef value::int_u8::enc enc; + image3d<C> out(mln_max(enc) + abs(mln_min(enc)) + 1, + mln_max(enc) + abs(mln_min(enc)) + 1, + mln_max(enc) + abs(mln_min(enc)) + 1); data::fill(out, mln_min(C)); // count
participants (1)
-
Etienne FOLIO