3DSelfie  Hansjoerg Hofer (1026632), Sebastian Metzler (0927550)
Snake Class Reference

Snake script. More...

Inheritance diagram for Snake:

Public Member Functions

Vector3[] GetSnakeWorldPoints ()
 Gets the resulting contour in world coordinates. More...
 
Vector3[] GetStartWorldPoints ()
 Gets the start contour in world coordinates. More...
 
void SetControlPoints (Vector3[] controlPoints)
 Sets the contour. More...
 
void DisplayImagePlane (bool display)
 Renders the snake image plane. More...
 
void ShowContour ()
 Renders the current contour state on the image plane. More...
 
void UpdateSnake (int iterations, bool drawSteps)
 Executes the snake algorithm. More...
 
void InitSnake (bool expanding=false)
 Initializes the snake with the given contour. More...
 

Public Attributes

Texture2D _dIdx
 
Texture2D _dIdy
 
float _alpha = 0.01f
 
float _beta = 0.001f
 
float _gamma = 1.5f
 
float _kappa = 0.9f
 

Detailed Description

Snake script.

The active contour model (snake) algorithm

Definition at line 10 of file Snake.cs.

Member Function Documentation

void Snake.DisplayImagePlane ( bool  display)

Renders the snake image plane.

Parameters
[in]displaytrue if it should be rendered

Definition at line 133 of file Snake.cs.

Vector3 [] Snake.GetSnakeWorldPoints ( )

Gets the resulting contour in world coordinates.

Returns
an array of vectors

Transforms the resulting contour to world points and returns them.

Definition at line 65 of file Snake.cs.

Vector3 [] Snake.GetStartWorldPoints ( )

Gets the start contour in world coordinates.

Returns
an array of vectors

Transforms the start contour to world points and returns them.

Definition at line 82 of file Snake.cs.

void Snake.InitSnake ( bool  expanding = false)

Initializes the snake with the given contour.

Parameters
[in]expandingif the snake is expanding or contracting

calculates the internal energie of the snake and saves it in a matrix representation.

Definition at line 300 of file Snake.cs.

void Snake.SetControlPoints ( Vector3[]  controlPoints)

Sets the contour.

Parameters
[in]controlPointsan array of points in world coordinates in the correct order for the contour

Transforms the control points to screen coordinates an sets them as the snake contour

Definition at line 101 of file Snake.cs.

void Snake.ShowContour ( )

Renders the current contour state on the image plane.

Definition at line 140 of file Snake.cs.

void Snake.UpdateSnake ( int  iterations,
bool  drawSteps 
)

Executes the snake algorithm.

Parameters
[in]iterationsthe number of iterations
[in]drawStepsif the contour steps should be drawn

Calculates the extern snake energie term and applies the weighted extern and intern energie to the coordinates

Definition at line 218 of file Snake.cs.

Member Data Documentation

float Snake._alpha = 0.01f

Definition at line 24 of file Snake.cs.

float Snake._beta = 0.001f

Definition at line 25 of file Snake.cs.

Texture2D Snake._dIdx

Definition at line 15 of file Snake.cs.

Texture2D Snake._dIdy

Definition at line 16 of file Snake.cs.

float Snake._gamma = 1.5f

Definition at line 26 of file Snake.cs.

float Snake._kappa = 0.9f

Definition at line 27 of file Snake.cs.


The documentation for this class was generated from the following file: