Updates snake in order to minimize its total energy that is a sum of internal energy that depends on contour shape (the smoother contour is, the smaller internal energy is) and external energy that depends on the energy field and reaches minimum at the local energy extremums that correspond to the image edges in case of image gradient.

Namespace: Emgu.CV
Assembly: Emgu.CV (in Emgu.CV.dll) Version: (


public static void cvSnakeImage(
	IntPtr image,
	Point[] points,
	int length,
	float[] alpha,
	float[] beta,
	float[] gamma,
	int coeffUsage,
	Size win,
	MCvTermCriteria criteria,
	int calcGradient
Visual Basic
Public Shared Sub cvSnakeImage ( _
	image As IntPtr, _
	<OutAttribute> points As Point(), _
	length As Integer, _
	alpha As Single(), _
	beta As Single(), _
	gamma As Single(), _
	coeffUsage As Integer, _
	win As Size, _
	criteria As MCvTermCriteria, _
	calcGradient As Integer _
Visual C++
static void cvSnakeImage(
	IntPtr image, 
	[InAttribute] [OutAttribute] array<Point>^ points, 
	int length, 
	array<float>^ alpha, 
	array<float>^ beta, 
	array<float>^ gamma, 
	int coeffUsage, 
	Size win, 
	MCvTermCriteria criteria, 
	int calcGradient


Type: System..::..IntPtr
The source image or external energy field
Type: array<System.Drawing..::..Point>[]()[][]
Seq points (snake).
Type: System..::..Int32
Number of points in the contour
Type: array<System..::..Single>[]()[][]
Weight[s] of continuity energy, single float or array of length floats, one per each contour point
Type: array<System..::..Single>[]()[][]
Weight[s] of curvature energy, similar to alpha
Type: array<System..::..Single>[]()[][]
Weight[s] of image energy, similar to alpha
Type: System..::..Int32
Variant of usage of the previous three parameters: CV_VALUE indicates that each of alpha, beta, gamma is a pointer to a single value to be used for all points; CV_ARRAY indicates that each of alpha, beta, gamma is a pointer to an array of coefficients different for all the points of the snake. All the arrays must have the size equal to the contour size.
Type: System.Drawing..::..Size
Size of neighborhood of every point used to search the minimum, both win.width and win.height must be odd
Type: Emgu.CV.Structure..::..MCvTermCriteria
Termination criteria
Type: System..::..Int32
Gradient flag. If != 0, the function calculates gradient magnitude for every image pixel and consideres it as the energy field, otherwise the input image itself is considered

See Also