#include <snake.h>
Collaboration diagram for Snake:
Public Member Functions | |
Snake (QtCvWrapper *parent, IplImage *inImg) | |
constructor of the snake class | |
virtual | ~Snake (void) |
destructor | |
bool | setInImg (IplImage *inImg) |
sets the input image for the snake algorithm | |
IplImage * | getInImg () |
returns the actual input image for snake algorithm | |
IplImage * | getSnakeImage () |
returns actual snake image | |
void | initSnakeCurve () |
initializes a first version of the curve | |
void | initSnakeCurve (CvPoint *pt) |
initialize a special snake curve | |
IplImage * | iterateSnakeCurve (int numIterations, bool showIterations) |
tries to approximate the contour curve with numIterations | |
Private Attributes | |
QtCvWrapper * | m_parent |
parent that sets connection to the "outside" | |
IplImage * | m_inImg |
IplImage * | m_snakeImg |
input Image | |
CvTermCriteria | m_crit |
image with the snake included | |
CvPoint * | m_snakeCurve |
stopping criteria | |
float | m_alpha |
curve that represents the snake | |
float | m_beta |
Weight of continuity energy, single float or array of length floats, one per each contour point. | |
float | m_gamma |
Weight of curvature energy, similar to alpha. | |
CvSize | m_winSize |
Weight of image energy, similar to alpha. | |
int | m_numSegments |
Size of neighborhood of every point used to search the minimum (use odd numbers!). | |
int | m_numIteration |
number of segments the snake curve is divided |
The snake class implements the snake algorithm from the OpenCV library. cvSnakeImage is called within an iteration until the maximum number of iteration is reached or the error reaches a certain minimum.
parent | is just the connection to the application that makes use of the Snake class | |
inImg | represents the initial image for Snake segmentation |
alpha, beta and gamma could be vectors -> make it configurable
Definition at line 28 of file snake.h.
Snake::Snake | ( | QtCvWrapper * | parent, | |
IplImage * | inImg | |||
) |
constructor of the snake class
Definition at line 16 of file snake.cpp.
References m_crit, m_inImg, m_numIteration, m_numSegments, m_snakeCurve, m_snakeImg, and m_winSize.
Snake::~Snake | ( | void | ) | [virtual] |
IplImage* Snake::getInImg | ( | ) | [inline] |
IplImage* Snake::getSnakeImage | ( | ) | [inline] |
void Snake::initSnakeCurve | ( | CvPoint * | pt | ) |
initialize a special snake curve
Definition at line 58 of file snake.cpp.
References m_inImg, m_numSegments, m_snakeCurve, and m_snakeImg.
void Snake::initSnakeCurve | ( | ) |
initializes a first version of the curve
Definition at line 44 of file snake.cpp.
References m_inImg, m_numSegments, and m_snakeCurve.
Referenced by QtCvWrapper::slotTest().
IplImage * Snake::iterateSnakeCurve | ( | int | numIterations, | |
bool | showIterations | |||
) |
tries to approximate the contour curve with numIterations
Definition at line 78 of file snake.cpp.
References QtCvWrapper::iterate(), m_alpha, m_beta, m_crit, m_gamma, m_inImg, m_numSegments, m_parent, m_snakeCurve, m_snakeImg, m_winSize, and QtCvWrapper::step().
Referenced by QtCvWrapper::slotSnakeButtonPressed(), and QtCvWrapper::slotTest().
Here is the call graph for this function:
bool Snake::setInImg | ( | IplImage * | inImg | ) | [inline] |
float Snake::m_alpha [private] |
curve that represents the snake
Definition at line 66 of file snake.h.
Referenced by iterateSnakeCurve().
float Snake::m_beta [private] |
Weight of continuity energy, single float or array of length floats, one per each contour point.
Definition at line 67 of file snake.h.
Referenced by iterateSnakeCurve().
CvTermCriteria Snake::m_crit [private] |
image with the snake included
Definition at line 62 of file snake.h.
Referenced by iterateSnakeCurve(), and Snake().
float Snake::m_gamma [private] |
Weight of curvature energy, similar to alpha.
Definition at line 68 of file snake.h.
Referenced by iterateSnakeCurve().
IplImage* Snake::m_inImg [private] |
Definition at line 60 of file snake.h.
Referenced by getInImg(), initSnakeCurve(), iterateSnakeCurve(), setInImg(), and Snake().
int Snake::m_numIteration [private] |
int Snake::m_numSegments [private] |
Size of neighborhood of every point used to search the minimum (use odd numbers!).
Definition at line 70 of file snake.h.
Referenced by initSnakeCurve(), iterateSnakeCurve(), and Snake().
QtCvWrapper* Snake::m_parent [private] |
parent that sets connection to the "outside"
Definition at line 59 of file snake.h.
Referenced by iterateSnakeCurve().
CvPoint* Snake::m_snakeCurve [private] |
stopping criteria
Definition at line 63 of file snake.h.
Referenced by initSnakeCurve(), iterateSnakeCurve(), Snake(), and ~Snake().
IplImage* Snake::m_snakeImg [private] |
input Image
Definition at line 61 of file snake.h.
Referenced by getSnakeImage(), initSnakeCurve(), iterateSnakeCurve(), and Snake().
CvSize Snake::m_winSize [private] |
Weight of image energy, similar to alpha.
Definition at line 69 of file snake.h.
Referenced by iterateSnakeCurve(), and Snake().