#include <energies.hh>
Inheritance diagram for oln::snakes::curvature_energy< I >:
Public Types | |
typedef I | image_type |
Public Member Functions | |
curvature_energy (void *) | |
Static Public Member Functions | |
static ntg::float_s | compute (const I &, const node< I > &prev, const node< I > ¤t, const node< I > &next) |
The snake is supposed to be applied on object that have smooth edge (example: an egg). The more the prev current next nodes are aligned, the less the energy is.
Definition at line 112 of file energies.hh.
ntg::float_s oln::snakes::curvature_energy< I >::compute | ( | const I & | , | |
const node< I > & | prev, | |||
const node< I > & | current, | |||
const node< I > & | next | |||
) | [inline, static] |
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 51 of file energies.hxx.
00055 { 00056 typename I::point_type twice_current; 00057 00058 twice_current.row() = 2 * current.row(); 00059 twice_current.col() = 2 * current.col(); 00060 return (next + (prev - twice_current) - 00061 typename I::point_type(0,0)).norm2(); 00062 }