#include <SnakesEnergy.hpp>
Public Member Functions | |
template<class const_accessort_t> | |
SnakesEnergy (const const_accessort_t &edge_map, const shape_t &initial_shape, float_t beta, std::size_t n_integration_points) | |
ublas::vector< float_t > & | current_argument () |
const shape_t & | current_shape () const |
float_t | current_energy () const |
std::size_t | dimension () const |
void | set_argument () |
This class template implements the Snakes functional for shapes of the type shape_t. The template parameter shape_t must implement ShapeInterface.
The Snakes functional reads as follows:
Usually is chosen as
for an image . Thus, contains the edges of .
Upon construction a SnakesEnergy object is initialized to an Image and an initial shape .
Then, the SnakesEnergy objects maps a vector to the corresponding energy as follows:
imaging::SnakesEnergy< shape_t >::SnakesEnergy | ( | const const_accessort_t & | edge_map, | |
const shape_t & | initial_shape, | |||
float_t | beta, | |||
std::size_t | n_integration_points | |||
) | [inline] |
Constructs a SnakesEnergy object. The first three arguments are explained in the class description. The parameter n_integration_points refers to the number of integration points when integrating along the shape boundary.
ublas::vector<float_t>& imaging::SnakesEnergy< shape_t >::current_argument | ( | ) | [inline, virtual] |
Access the current argument of the energy. In general the user should not resize the current argument!
Implements imaging::EnergyInterface.
const shape_t& imaging::SnakesEnergy< shape_t >::current_shape | ( | ) | const [inline, virtual] |
Returns the current shape. This function should not actually compute the current shape but return the cached result of the last call to set_argument()!
Implements imaging::ShapeEnergyInterface< shape_t >.
float_t imaging::SnakesEnergy< shape_t >::current_energy | ( | ) | const [inline, virtual] |
Returns the current energy. This function should not actually compute the current energy but return the cached result of the last call to set_argument()!
Implements imaging::EnergyInterface.
std::size_t imaging::SnakesEnergy< shape_t >::dimension | ( | ) | const [inline, virtual] |
Returns the dimension the class expects as input data. The function current_argument() will return a vector of this dimension and the user should not change the size of this vector!
Implements imaging::EnergyInterface.
void imaging::SnakesEnergy< shape_t >::set_argument | ( | ) | [inline, virtual] |
Compute the energy value corresponding to the current argument. This is where the main work of the energy evaluation should be done.
Implements imaging::EnergyInterface.