4441: Make some test on 14 bits grayscale image.

* green/mln/accu/stat/histo1d/histo1d.hh : Improve documentation. * green/tests/accu/stat/histo1d/histo1d.cc (test_14bits_classifying) : Test gausian filtering. * green/mln/io/plot/save_histo_sh.hh : Test new gnuplot style. --- trunk/milena/sandbox/ChangeLog | 10 ++++++++++ .../milena/sandbox/green/mln/accu/stat/histo1d.hh | 15 ++++++++------- .../sandbox/green/mln/io/plot/save_histo_sh.hh | 3 ++- .../green/tests/accu/stat/histo1d/histo1d.cc | 13 +++++++------ 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/trunk/milena/sandbox/ChangeLog b/trunk/milena/sandbox/ChangeLog index b29bcef..584044a 100644 --- a/trunk/milena/sandbox/ChangeLog +++ b/trunk/milena/sandbox/ChangeLog @@ -1,5 +1,15 @@ 2009-09-07 Yann Jacquelet <jacquelet@lrde.epita.fr> + Make some test on 14 bits grayscale image. + + * green/mln/accu/stat/histo1d/histo1d.hh : Improve documentation. + * green/tests/accu/stat/histo1d/histo1d.cc + (test_14bits_classifying) : Test gausian filtering. + * green/mln/io/plot/save_histo_sh.hh : Test new gnuplot style. + + +2009-09-07 Yann Jacquelet <jacquelet@lrde.epita.fr> + Improve histo1d testing with 14 bits grayscale image. * green/mln/fun : New directory. diff --git a/trunk/milena/sandbox/green/mln/accu/stat/histo1d.hh b/trunk/milena/sandbox/green/mln/accu/stat/histo1d.hh index 4cd07fa..541b749 100644 --- a/trunk/milena/sandbox/green/mln/accu/stat/histo1d.hh +++ b/trunk/milena/sandbox/green/mln/accu/stat/histo1d.hh @@ -34,7 +34,7 @@ /// /// This source implements the discrete histogram version. The number of beans /// is infer from the number of greylevels. A typical int_u8 image has got -/// 256 bins. An int_u16 image has got 65535 bins. +/// 256 bins. An int_u<14> image has got 16384 bins. /// The following sample is a typical use of the histogram. /// /// #include <mln/value/int_u8.hh> @@ -124,10 +124,10 @@ namespace mln /// /// Param V defines the space in which we count the values. /// For instance, this histogram works image2d<int_u8> or - /// image1d<int_u16>. The histogram count the occurrence of each value. + /// image1d<int_u<14> >. The histogram count the occurrence of each value. /// The number of bins depends of the greyscale values, for 8 bits there - /// is 256 bins, for 16 bits there is 65536 bins. Note that over - /// quantification works too. + /// is 256 bins, for 14 bits there is 16384 bins. Note that over + /// quantification works too (up to 14 bits). /// /// \ingroup modaccuvalues @@ -159,7 +159,7 @@ namespace mln void init(); - /// \brief Update the histogram with the RGB pixel t. + /// \brief Update the histogram with the greylevel of the pixel t. /// \param[in] t a greylevel pixel of type V. /// /// The end user shouldn't call this method. In place of it, he can @@ -216,6 +216,9 @@ namespace mln // mln_min(comp) --> 0 // mln_max(comp) --> 2^(n-1) [127 for n=7][255 for n=8] ... + count_.init_(box1d(point1d(mln_min(comp)), + point1d(mln_max(comp)))); + // std::cout << "min : " << mln_min(comp) << std::endl; // std::cout << "max : " << mln_max(comp) << std::endl; @@ -226,8 +229,6 @@ namespace mln // v_point1d(mln_max(comp)))); // this does not work as image1d is friendly close to box1d - count_.init_(box1d(point1d(mln_min(comp)), - point1d(mln_max(comp)))); trace::exiting("mln::accu::stat::histo1d<V>::histo1d"); } diff --git a/trunk/milena/sandbox/green/mln/io/plot/save_histo_sh.hh b/trunk/milena/sandbox/green/mln/io/plot/save_histo_sh.hh index 6bf1fbf..e2d26e1 100644 --- a/trunk/milena/sandbox/green/mln/io/plot/save_histo_sh.hh +++ b/trunk/milena/sandbox/green/mln/io/plot/save_histo_sh.hh @@ -100,7 +100,8 @@ namespace mln out << std::endl; out << "gnuplot <<EOF" << std::endl; out << "set terminal x11 persist 1" << std::endl; - out << "plot '-' with points pointtype 20" << std::endl; + out << "plot '-' with impulses" << std::endl; + //out << "plot '-' with points pointtype 20" << std::endl; //out << "plot '-' with points pointtype 0" << std::endl; //out << "plot '-' with histograms" << std::endl; //out << "plot '-' smooth unique" << std::endl; diff --git a/trunk/milena/sandbox/green/tests/accu/stat/histo1d/histo1d.cc b/trunk/milena/sandbox/green/tests/accu/stat/histo1d/histo1d.cc index b09fab8..e959cbd 100644 --- a/trunk/milena/sandbox/green/tests/accu/stat/histo1d/histo1d.cc +++ b/trunk/milena/sandbox/green/tests/accu/stat/histo1d/histo1d.cc @@ -631,8 +631,8 @@ void test_14bits_classifying() std::cout << "(14 bits) SMOOTHING HISTOGRAM" << std::endl; - double ws[41]; - gaussian_filter(ws, 41, 6.0); + double ws[401]; + gaussian_filter(ws, 401, 50.0); img_smooth = mln::linear::convolve(img_res, mln::make::w_window1d(ws)); mln::io::plot::save_histo_sh(img_smooth, "histo1_14bits.sh"); @@ -678,25 +678,26 @@ void test_14bits_classifying() int main() { + /* test_8bits_instantiation_without_argument(); test_8bits_initialization(); test_8bits_take_argument(); test_8bits_take_other(); test_8bits_operator_equal(); test_8bits_integration(); - - //test_8bits_classifying(); + */ + test_8bits_classifying(); // PROBLEME AVEC LES COORDONNEES PAR DEFAUT QUI SONT EN SIGNED SHORT // SEE mln/core/def/coord.hh - + /* test_14bits_instantiation_without_argument(); test_14bits_initialization(); test_14bits_take_argument(); test_14bits_take_other(); test_14bits_operator_equal(); test_14bits_integration(); - + */ test_14bits_classifying(); return 0; -- 1.5.6.5
participants (1)
-
Yann Jacquelet