
Index: olena/ChangeLog from Niels Van Vliet <niels@lrde.epita.fr> * olena/oln/snakes/snakes_base.hh: Add comments * olena/oln/snakes/energies.hh: Add comments * olena/oln/snakes/greedy.hh: Add comments * olena/oln/snakes/node.hh: Add comments * olena/oln/snakes/segment.hh: Add comments * olena/oln/snakes/snakes_base.hh: Add comments * olena/oln/morpho/attribute_closing_opening.hh: Fix bug in doc * olena/oln/morpho/attribute_closing_opening_map.hh: Fix bug in doc Index: olena/oln/morpho/attribute_closing_opening.hh --- olena/oln/morpho/attribute_closing_opening.hh Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/q/49_attribute_ 1.17 640) +++ olena/oln/morpho/attribute_closing_opening.hh Thu, 11 Mar 2004 15:14:01 +0100 van-vl_n (oln/q/49_attribute_ 1.17 640) @@ -327,7 +327,7 @@ ** ** im_type im1(oln::load(IMG_IN "lena128.pgm")); ** im1 = oln::morpho::fast::maxvalue_closing(im1, oln::neighb_c4(), 5); - ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_closing.png.ppm"); + ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_closing.ppm"); ** return 0; ** } ** \endcode Index: olena/oln/snakes/snakes_base.hh --- olena/oln/snakes/snakes_base.hh Wed, 21 Jan 2004 05:11:16 +0100 astrid (oln/f/50_snakes_bas 1.1 644) +++ olena/oln/snakes/snakes_base.hh Wed, 10 Mar 2004 18:51:37 +0100 van-vl_n (oln/f/50_snakes_bas 1.1 644) @@ -32,8 +32,15 @@ namespace oln { + /*! \namespace oln::snakes + ** Namespace snakes. + */ namespace snakes { - + /*! Snake algorithm. + ** + ** \attention FIXME: Do not work due to the function node::energy. + ** \todo FIXME: Add doc & test. + */ template <class algorithm> class snake { @@ -57,6 +64,7 @@ ntg::float_s energy(void) const; ///< Return the snake energy. This is not algorithm-dependant. + ///< \attention FIXME: Do not work due to the function node::energy public: int Index: olena/oln/snakes/energies.hh --- olena/oln/snakes/energies.hh Wed, 21 Jan 2004 05:11:16 +0100 astrid (oln/j/22_energies.h 1.1 644) +++ olena/oln/snakes/energies.hh Wed, 10 Mar 2004 18:51:37 +0100 van-vl_n (oln/j/22_energies.h 1.1 644) @@ -32,6 +32,8 @@ namespace snakes { + /*! Base class for energy. + */ template <class I> class energy { @@ -40,6 +42,11 @@ energy(void *) {} public: + /*! Return the energy. + ** + ** The first arg is the gradient of the image; + ** the 3 nodes are the previous, the current and the next node. + */ ntg::float_s compute(const I&, const node<I>&, const node<I>&, const node<I>&) { @@ -52,6 +59,7 @@ } public: + //! FIXME: What is that? static void* cookie() { return 0; }; private: @@ -59,6 +67,14 @@ }; + /*! Energy of continuity. + ** + ** The goal of this energy is to avoid pack of nodes an lack + ** of nodes in some part of the snake. The average distance + ** between two consecutive points is \a average_dist. The + ** more the distance between \a prev and \a current is + ** far from \a average_dist, the higher the energy is. + */ template <class I> class continuity_energy : public energy<I> { @@ -82,6 +98,13 @@ }; + /*! Energy of curvature. + ** + ** The snake is supposed to be applied on object that + ** have smooth edge (example: an egg). The more the + ** \a prev \a current \a next nodes are aligned, the + ** less the energy is. + */ template <class I> class curvature_energy : public energy<I> { @@ -101,6 +124,11 @@ }; + /*! Energy of the gradient. + ** + ** The snake should follow the edge of the object. + ** The higher the gradient is, the less the energy is. + */ template <class I> class image_energy : public energy<I> { @@ -120,7 +148,10 @@ }; - // This macro allows the user to define his own external energy. + /*! This macro allows the user to define his own external energy. + ** + ** \see dummy_energy + */ #define oln_snakes_define_external_energy(Energy, Gradient, PrevNode, CurrentNode, NextNode) \ \ template<class I> \ @@ -148,7 +179,7 @@ const ::oln::snakes::node<I>& NextNode) - // Default external energy. + //! Default external energy. oln_snakes_define_external_energy(dummy_energy,,,,) { return 0; Index: olena/oln/snakes/greedy.hh --- olena/oln/snakes/greedy.hh Wed, 21 Jan 2004 05:11:16 +0100 astrid (oln/j/25_greedy.hh 1.1 644) +++ olena/oln/snakes/greedy.hh Wed, 10 Mar 2004 18:51:37 +0100 van-vl_n (oln/j/25_greedy.hh 1.1 644) @@ -36,7 +36,13 @@ namespace snakes { - /// N is the size of the neighborhood. + /*! This class can be use as the algorithm of snake. + ** + ** \param N is the size of the neighborhood. + ** \pre N must be odd. + ** \see snake + */ + template <int N, class I, template<typename> class external_energy = dummy_energy> class greedy { Index: olena/oln/snakes/node.hh --- olena/oln/snakes/node.hh Wed, 21 Jan 2004 05:11:16 +0100 astrid (oln/j/32_node.hh 1.1 644) +++ olena/oln/snakes/node.hh Wed, 10 Mar 2004 18:51:37 +0100 van-vl_n (oln/j/32_node.hh 1.1 644) @@ -34,6 +34,10 @@ namespace snakes { + /*! A node is a point used in ring. + ** + ** \attention FIXME: Do not work due to the function energy. + */ template<class I> class node : public I::point_type { @@ -48,6 +52,10 @@ } public: + /*! Return the energy + ** + ** FIXME: not implemented, do not work + */ inline ntg::float_s energy(const I& gradient, point_type prev, point_type next) const; @@ -61,7 +69,7 @@ } // end oln - +//! Print the position of a node \a n template <class I> std::ostream& operator<<(std::ostream& os, const oln::snakes::node<I>& n) { Index: olena/oln/snakes/segment.hh --- olena/oln/snakes/segment.hh Wed, 21 Jan 2004 05:11:16 +0100 astrid (oln/j/34_segment.hh 1.1 644) +++ olena/oln/snakes/segment.hh Wed, 10 Mar 2004 18:51:37 +0100 van-vl_n (oln/j/34_segment.hh 1.1 644) @@ -37,6 +37,10 @@ namespace snakes { + /*! A segment is a list of node. + ** + ** \attention FIXME: Do not work due to the function node::energy. + */ template <class I> class segment { @@ -53,6 +57,9 @@ ntg::float_s energy(const I& gradient) const; ///< Just iterate through the vector and sums up point energies. + ///< + ///< \attention FIXME: Do not work due to the function node::energy. + public: std::list<point_type> Index: olena/oln/morpho/attribute_closing_opening_map.hh --- olena/oln/morpho/attribute_closing_opening_map.hh Wed, 10 Mar 2004 16:20:23 +0100 palma_g (oln/j/49_attribute_ 1.4 600) +++ olena/oln/morpho/attribute_closing_opening_map.hh Thu, 11 Mar 2004 15:13:57 +0100 van-vl_n (oln/j/49_attribute_ 1.4 600) @@ -423,7 +423,7 @@ ** ** im_type im1(oln::load(IMG_IN "lena128.pgm")); ** im1 = oln::morpho::slow::maxvalue_closing(im1, oln::neighb_c4(), 5); - ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_closing.png.ppm"); + ** oln::save(im1, IMG_OUT "oln_morpho_fast_maxvalue_closing.ppm"); ** return 0; ** } ** \endcode
participants (1)
-
Niels Van Vliet