#include <energies.hh>
Inheritance diagram for oln::snakes::continuity_energy< I >:
Public Types | |
typedef I | image_type |
Public Member Functions | |
continuity_energy (ntg::float_s *average_dist) | |
ntg::float_s | compute (const I &, const node< I > &prev, const node< I > ¤t, const node< I > &) |
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 average_dist. The more the distance between prev and current is far from average_dist, the higher the energy is.
Definition at line 82 of file energies.hh.
ntg::float_s oln::snakes::continuity_energy< I >::compute | ( | const I & | , | |
const node< I > & | prev, | |||
const node< I > & | current, | |||
const node< I > & | ||||
) | [inline] |
Return the energy.
The first arg is the gradient of the image; the 3 nodes are the previous, the current and the next node.
Reimplemented from oln::snakes::energy< I >.
Definition at line 39 of file energies.hxx.
00043 { 00044 ntg::float_s d = *average_dist - (current - prev).norm2(); 00045 return d > 0 ? d : -d; 00046 }