Contents

% Copyright (c) 2020
% Authors:
% F. Pierre, M. Amendola, C. Bigeard, T. Ruel
% and P.-F. Villard
%
% This program is free software: you can redistribute it and/or
% modify it under the terms of the GNU Affero General Public
% License as published by the Free Software Foundation, either
% version 3 of the License, or (at your option) any later
% version.
%
% This program is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied
% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
% PURPOSE. See the GNU Affero General Public License for more
% details.
%
% You should have received a copy of the GNU Affero General
% Public License along with this program. If not,
% see <http://www.gnu.org/licenses/>.

EvolutionSnake2D

Compute the evolution of a Snake Model.

Syntax.

V = EvolutionSnake2D(image, V_init);
V = EvolutionSnake2D(image, V_init, ...);

Description.

V = EvolutionSnake2D(image, V_init); returns a polygon provided by the snake evolution model on the image initialized with V_init.

Example.

Loading path.

if exist('OCTAVE_VERSION', 'builtin')
    pkg load image;
end
addpath('functions')

% Image choice.
image='shamrock.png';

% Reading of initial image and transformation into gray values.
I_init = double(rgb2gray(imread(image)));

% Subdivision parameter of initial contour.
k=3;
% Drawing and subdivision of the initial polygon.
V_init = subdivision( selectPoints(I_init), k );

% Snake computation
V_final= EvolutionSnake2D(I_init, V_init, ...
	'Alpha', 2500, ...
	'Beta', 1000, ...
	'Sigma', 1, ...
	'Gamma', 0.0005, ...
	'BalloonCoefficient', -100, ...
	'BalloonSmoothing', 70, ...
	'MaxIteration', 1500, ...
	'CubicSplineRefinement', 'on', ...
	'Verbose', 'off');

% Display.
figure, displayImageAndSnake(I_init,V_final); title('Snake Segmentation')
Left click to select a position
Right click to stop

Input arguments.