Code covered by the BSD License  

Highlights from
Morphological Shared-Weight Neural Network for Face Recognition

image thumbnail
from Morphological Shared-Weight Neural Network for Face Recognition by Ethan Png
MSNN has the ability to learn feature extraction and perform classification at the same time.

prescale(x)
function [p] = prescale(x)

% USAGE: prescales image function x to "0 to 1" or "-1 to +1" domain range


x=double(x);

maxp=max(max(x));
maxp=max(maxp');
minp=min(min(x));
minp=min(minp');

% converts image to "0 to 1" range
p = (x-minp)/(maxp-minp);

% converts image to "-1 to +1" range
% p = 2*(x-minp)/(maxp-minp)-1;



Contact us at files@mathworks.com