Fingerprint matching algorithm using shape context and orientation descriptors
04 Nov 2010
08 Aug 2011)
Fingerprint matching code using a hybrid descriptor. EER < 1% (approx. 0.75%) on FVC2002 Db1_A.
function n2 = dist2(x, c)
%DIST2 Calculates squared distance between two sets of points.
% D = DIST2(X, C) takes two matrices of vectors and calculates the
% squared Euclidean distance between them. Both matrices must be of
% the same column dimension. If X has M rows and N columns, and C has
% L rows and N columns, then the result has M rows and L columns. The
% I, Jth entry is the squared distance from the Ith row of X to the
% Jth row of C.
% See also
% GMMACTIV, KMEANS, RBFFWD
% Copyright (c) Christopher M Bishop, Ian T Nabney (1996, 1997)
[ndata, dimx] = size(x);
[ncentres, dimc] = size(c);
if dimx ~= dimc
error('Data dimension does not match dimension of centres')
n2 = (ones(ncentres, 1) * sum((x.^2)', 1))' + ...
ones(ndata, 1) * sum((c.^2)',1) - ...