Active contours, also called snakes, adapt to edges in an image. Instructions are given below the applet.
To initialize a contour, click on the image and drag to form an oval. Releasing the mouse button stamps the contour in red on the image, and the points that are used in the contour are shown in green. Press any key on your keyboard to move the contour (snake) one iteration. Holding any button down will repeatedly iterate the snake. Pressing the 'return' key will iterate the snake 100 iterations. When the snake reaches steady state and no more points are moved on an iteration, the points turn yellow and the program no longer refreshes the contour. The three parameters above the image (continuity, curvature, and gradient) can be changed from zero to 'very high'. Each of these affects the behavior of the snake in a particular way. After changing one or more of the parameters, the contour is reset to the initial oval when the mouse pointer is moved back onto the image. The contour may then once again be iterated using the new parameters by pressing any key on the keyboard. This allows you to see the effect of changing the parameters using the same initial contour. Note that it is the values of these weights relative to each other that is important; setting all three values to "High" will give exactly the same results as setting them all "Low".
Suggestion
The snake will be more likely to be attracted to the cell boundaries if you draw the initial contour
outside the cell. This is because the interiors of the cells are noisy and therefore the
image gradient does not attract the snake as strongly toward the cell boundaries as it does when the
snake is initialized outside the cells.
Contours are initialized with a distance between adjacent snake points ('snaxels') of approximately 3 pixels. Each snaxel moves under the influence of internal and external constraints:
Several other internal and external constraints may be defined for snakes, but only these three have been implemented in this example. The numerical weights used for these three parameters corresponding to the descriptions are:
Description | Continuity | Curvature | Gradient |
---|---|---|---|
None | 0 | 0 | 0 |
Low | 0.5 | 0.5 | 0.6 |
Medium | 1.0 | 1.0 | 1.2 |
High | 1.5 | 1.5 | 1.8 |
Very High | 2.0 | 2.0 | 2.4 |
See also: