Code covered by the BSD License  

Highlights from
Active Shape Model (ASM) and Active Appearance Model (AAM)

image thumbnail

Active Shape Model (ASM) and Active Appearance Model (AAM)


Dirk-Jan Kroon (view profile)


16 Feb 2010 (Updated )

Cootes 2D/3D Active Shape & Appearance Model for automatic image object segmentation and recognition

function [gt,dgt]=ASM_getProfileAndDerivatives3D(I,pV,nV,k)
% This function getProfileAndDerivatives, samples the image on lines
% perpendicular to the contour points, which are used to train the
% appearance model, and to find the best location for a contour point later
% on.
% [gt,dgt]=getProfileAndDerivatives(I,pV(:,1),pV(:,2),nV(:,1),nV(:,2),k)
% inputs,
%  I : The image color or greyscale
%  pV: The locations of the contour points
%  nV: The normals of the contour points
%  k : The length of the sampled line in one normal direction,
%      total length becomes k*2+1
% outputs,
%  gt : Columns with the sampled lines perpendicular to the contour
%  dgt : The first order derivatives of the sampled lines
% Function written by D.Kroon University of Twente (February 2010)


xi(xi<1)=1; xi(xi>size(I,1))=size(I,1);
yi(yi<1)=1; yi(yi>size(I,2))=size(I,2);
zi(zi<1)=1; zi(zi>size(I,3))=size(I,3);

% Sample on the normal lines
%gt= interp3(permute(I,[2 1 3]),xi,yi,zi,'cubic')';
gt= interpfast(I,xi,yi,zi,'cubic')';


% Get the derivatives

% Store the grey profiles and derivatives for the different color
% channels

% Normalize the derivatives

Contact us