Code covered by the BSD License  

Highlights from
Active Contour Toolbox

image thumbnail

Active Contour Toolbox


Eric Debreuve (view profile)


05 Jul 2006 (Updated )

This toolbox provides some functions to segment an image or a video using active contours

function acarea = ac_area(acontour)
%ac_area: signed area of an active contour
%   r = ac_area(a) computes the signed area, r, of an active contour, a, using
%   the Green's theorem. If a is oriented counterclockwise, r is positive.
%See also po_orientation, acontour.
%Active Contour Toolbox by Eric Debreuve
%Last update: June 20, 2006

acarea = 0;

for subac_idx = 1:length(acontour)
   [breaks, coefs, interval] = ppbrk(acontour(subac_idx), 'breaks', 'coefs', 'interval');

   %/!\ this might not be valid if the ppform structure changes
   first_coordinate  = mkpp(breaks, coefs(1:2:end,:));
   second_coordinate = mkpp(breaks, coefs(2:2:end,:));

   acarea = acarea + 0.5 * fnval(fnint(...
         fncmb(first_coordinate,  '*', fnder(second_coordinate)), ...
         '-', ...
         fncmb(second_coordinate, '*', fnder(first_coordinate))...
      )), interval(2));

Contact us