
Index: olena/ChangeLog from Niels Van Vliet <niels@lrde.epita.fr> * olena/oln/morpho/laplacian.inc (laplacian): Remove slarger_t. Add the parameter DestValue. Fix doc. * olena/tests/morpho/tests/md5_morpho_laplacian_inc1: Change the test. * olena/oln/morpho/watershed.hh: Change the two examples. Index: olena/oln/morpho/laplacian.inc --- olena/oln/morpho/laplacian.inc Sun, 14 Mar 2004 18:21:09 +0100 palma_g (oln/41_laplacian. 1.15 640) +++ olena/oln/morpho/laplacian.inc Fri, 02 Apr 2004 17:08:37 +0200 van-vl_n (oln/41_laplacian. 1.15 640) @@ -38,7 +38,7 @@ ** \code ** #include <oln/basics2d.hh> ** #include <oln/morpho/laplacian.hh> -** #include <oln/level/compare.hh> +** #include <oln/convert/stretch.hh> ** #include <ntg/all.hh> ** int main() ** { @@ -46,11 +46,13 @@ ** ** im_type im1(oln::load(IMG_IN "lena256.pgm")); ** -** oln::save(oln::morpho::fast::laplacian(oln::convert::bound<ntg::int_u8>(), +** oln::image2d<ntg::int_s<10> > i10 = +** oln::morpho::fast::laplacian(oln::convert::bound<ntg::int_s<10> >(), ** im1, -** oln::win_c8p()), -** IMG_OUT "oln_morpho_fast_laplacian.pbm"); -** return 0; +** oln::win_c8p()); +** +** oln::save(apply(oln::convert::stretch<ntg::int_u8>(), i10), +** IMG_OUT "oln_morpho_fast_laplacian.pgm"); ** } ** \endcode ** @@ -82,7 +84,7 @@ ** \code ** #include <oln/basics2d.hh> ** #include <oln/morpho/laplacian.hh> -** #include <oln/level/compare.hh> +** #include <oln/convert/stretch.hh> ** #include <ntg/all.hh> ** int main() ** { @@ -90,9 +92,17 @@ ** ** im_type im1(oln::load(IMG_IN "lena256.pgm")); ** -** oln::save(oln::morpho::fast::laplacian(oln::convert::bound<ntg::int_u8>(), im1, oln::win_c8p()), -** IMG_OUT "oln_morpho_fast_laplacian_overload.pbm"); -** return 0; +** oln::image2d<ntg::int_s<10> > i10 = +** oln::morpho::fast::laplacian(oln::convert::bound<ntg::int_s<10> >(), +** im1, +** oln::win_c8p()); +** +** oln::image2d<ntg::int_s<10> > f10 = +** oln::morpho::fast::laplacian<ntg::int_s<10> >(im1, +** oln::win_c8p()); +** +** oln::save(apply(oln::convert::stretch<ntg::int_u8>(),(f10)), +** IMG_OUT "oln_morpho_fast_laplacian_overload.pgm"); ** } ** \endcode ** @@ -101,13 +111,13 @@ ** => ** \image html oln_morpho_fast_laplacian_overload.png ** \image latex oln_morpho_fast_laplacian_overload.png -** -** \todo FIXME: Call the good laplacian, and correct slarger_t type. */ -template<class I, class E> -typename mute<I,oln_value_type(I)::slarger_t>::ret +template<class DestValue, class I, class E> +typename mute<I, DestValue>::ret laplacian(const abstract::non_vectorial_image<I>& input, const abstract::struct_elt<E>& se) { - return laplacian(convert::force<oln_value_type(I)::slarger_t>(), input, se); + return + laplacian(convert::force<DestValue>(), + input, se); } Index: olena/oln/morpho/watershed.hh --- olena/oln/morpho/watershed.hh Sun, 14 Mar 2004 18:21:09 +0100 palma_g (oln/48_watershed. 1.13 640) +++ olena/oln/morpho/watershed.hh Fri, 02 Apr 2004 16:18:49 +0200 van-vl_n (oln/48_watershed. 1.13 640) @@ -65,28 +65,44 @@ ** \code ** #include <oln/basics2d.hh> ** #include <oln/morpho/watershed.hh> - ** #include <oln/level/compare.hh> ** #include <ntg/all.hh> + ** + ** #include <oln/morpho/attribute_closing_opening.hh> + ** #include <oln/morpho/gradient.hh> + ** #include <oln/convert/stretch.hh> ** int main() ** { ** typedef oln::image2d<ntg::int_u8> im_type; ** ** im_type im1(oln::load(IMG_IN "lena256.pgm")); ** - ** oln::save(oln::morpho::watershed_seg<ntg::int_u16>(im1, - ** oln::neighb_c4()), - ** IMG_OUT "oln_morpho_watershed_seg.pbm"); - ** return 0; + ** // Gradient of the image + ** im1 = oln::morpho::beucher_gradient(im1, oln::win_c8p()); + ** + ** // Remove local minima smaller than 200 pixels + ** im1 = oln::morpho::fast::card_closing(im1, oln::neighb_c8(), + ** 200); + ** + ** oln::save(im1, IMG_OUT "oln_morpho_watershed_seg_tmp.pgm"); + ** + ** // Use the watershed to segment the image + ** im_type w = oln::morpho::watershed_seg<ntg::int_u8>(im1, + ** oln::neighb_c8()); + ** + ** oln::save(oln::convert::stretch_balance<ntg::int_u8>(w), + ** IMG_OUT "oln_morpho_watershed_seg.pgm"); ** } ** \endcode ** ** \image html lena256_pgm.png ** \image latex lena256_pgm.png ** => + ** \image html oln_morpho_watershed_seg_tmp.png + ** \image latex oln_morpho_watershed_seg_tmp.png + ** => ** \image html oln_morpho_watershed_seg.png ** \image latex oln_morpho_watershed_seg.png ** - ** \todo Find a more pertinent example. */ template<class DestValue, class I, class N> typename mute<I, DestValue>::ret @@ -127,28 +143,43 @@ ** \code ** #include <oln/basics2d.hh> ** #include <oln/morpho/watershed.hh> - ** #include <oln/level/compare.hh> ** #include <ntg/all.hh> + ** + ** #include <oln/morpho/attribute_closing_opening.hh> + ** #include <oln/morpho/gradient.hh> + ** #include <oln/convert/stretch.hh> ** int main() ** { ** typedef oln::image2d<ntg::int_u8> im_type; ** ** im_type im1(oln::load(IMG_IN "lena256.pgm")); ** - ** oln::save(oln::morpho::watershed_con<ntg::int_u16>(im1, - ** oln::neighb_c4()), - ** IMG_OUT "oln_morpho_watershed_con.pbm"); - ** return 0; + ** // Gradient of the image + ** im1 = oln::morpho::beucher_gradient(im1, oln::win_c8p()); + ** + ** // Remove local minima smaller than 200 pixels + ** im1 = oln::morpho::fast::card_closing(im1, oln::neighb_c8(), + ** 200); + ** + ** oln::save(im1, IMG_OUT "oln_morpho_watershed_con_tmp.pgm"); + ** + ** // Use the watershed to conment the image + ** im_type w = oln::morpho::watershed_con<ntg::int_u8>(im1, + ** oln::neighb_c8()); + ** + ** oln::save(oln::convert::stretch_balance<ntg::int_u8>(w), + ** IMG_OUT "oln_morpho_watershed_con.pgm"); ** } ** \endcode ** ** \image html lena256_pgm.png ** \image latex lena256_pgm.png ** => + ** \image html oln_morpho_watershed_con_tmp.png + ** \image latex oln_morpho_watershed_con_tmp.png + ** => ** \image html oln_morpho_watershed_con.png ** \image latex oln_morpho_watershed_con.png - ** - ** \todo Find a more pertinent example. */ template<class DestValue, class I, class N> typename mute<I, DestValue>::ret Index: olena/tests/morpho/tests/md5_morpho_laplacian_inc1 --- olena/tests/morpho/tests/md5_morpho_laplacian_inc1 Tue, 23 Mar 2004 14:36:33 +0100 palma_g (oln/k/48_md5_morpho 1.1 644) +++ olena/tests/morpho/tests/md5_morpho_laplacian_inc1 Fri, 02 Apr 2004 17:20:19 +0200 van-vl_n (oln/k/48_md5_morpho 1.1 644) @@ -10,20 +10,21 @@ int main() { -oln::utils::key::value_type data_key[16] = {0x1b, 0x83, 0x53, 0x90, 0xbf, 0xb6, 0x68, 0xad, 0xb3, 0xae, 0xfa, 0xfc, 0xfc, 0x6a, 0x1e, 0x27}; + oln::utils::key::value_type data_key[16] = {0xbd, 0x5a, 0x43, 0x38, 0x1b, + 0xd3, 0xc1, 0x76, 0x52, 0x8b, + 0x43, 0xcc, 0xf4, 0x12, 0x6c, + 0xa3}; oln::utils::key key(data_key); - typedef oln::image2d<ntg:: -int_u8> im_type; + typedef oln::image2d<ntg::int_u8> im_type; im_type im1(oln::load(rdata("lena256.pgm"))); - if (oln::utils::md5(oln::morpho::fast::laplacian(oln::convert::bound<ntg:: -int_u8>(), im1, oln::win_c8p())) == key) + if (oln::utils::md5(oln::morpho::fast::laplacian<ntg::int_s<10> > + (im1, oln::win_c8p())) == key) std::cout << "OK" << std::endl; else { std::cout << "FAIL" << std::endl; return true; } - return 0; }
participants (1)
-
Niels Van Vliet