The main idea is that a contour may be placed near some image feature, for example, an edge. The initial placement may be performed manually by the user, or it may be fully or partially automated. An energy functional, which involves the shape of the contour and its location in the image, is defined to be at its minimum when the contour perfectly fits the image feature. The contour then self-adjusts by minimizing the functional to better fit the image feature. The total energy is defined as a combination of internal energy, which is determined by the properties of the contour itself, external energy, which is derived from the image data, and constraint energy, which represents constraints, that are explicitly imposed by the user.
Internal energy places restrictions on the shape of the contour.
For example, it may force a tendency for it to be smooth, or a tendency to be similar to some predefined shape. Originally, it was defined by Kass et al. The external energy, E image , is determined by the image features. For example, it may guide the contour toward features of interest, for example, an edge, or toward areas with high intensity values. Since snakes are most often used to track edges, the external energy is typically defined as the negative of the image gradient.