Code covered by the BSD License  

Highlights from
Morphological Shared-Weight Neural Network for Face Recognition

image thumbnail

Morphological Shared-Weight Neural Network for Face Recognition

by

 

31 Dec 2004 (Updated )

MSNN has the ability to learn feature extraction and perform classification at the same time.

maxposition(I, n, range)
function [mvalue, y, x] = maxposition(I, n, range)
% This function retrieves the max n position


[height, width] = size(I);

mvalue(1:n) = range(1)-1;
y(1:n) = 0;
x(1:n) = 0;

for i=1:height
   for j=1:width
      val = I(i,j);
      k = 1;
      while( (k<=n) & (val<=mvalue(k)) )
         k = k+1;
      end
      if( k <= n ) 
         for m=n-1:-1:k
            mvalue(m+1) = mvalue(m);
            y(m+1) = y(m);
            x(m+1) = x(m);
         end
         mvalue(k) = val;
         y(k) = i;
         x(k) = j;
      end
   end
end

Contact us