idamnjanovic@1: function y = imnormalize(x) idamnjanovic@1: %IMNORMALIZE Normalize image values. idamnjanovic@1: % Y = IMNORMALIZE(X) linearly transforms the intensity values of the image idamnjanovic@1: % X to tightly cover the range [0,1]. If X has more than one channel, the idamnjanovic@1: % channels are handled as one and normalized using the same transform. idamnjanovic@1: idamnjanovic@1: idamnjanovic@1: % Ron Rubinstein idamnjanovic@1: % Computer Science Department idamnjanovic@1: % Technion, Haifa 32000 Israel idamnjanovic@1: % ronrubin@cs idamnjanovic@1: % idamnjanovic@1: % May 2004 idamnjanovic@1: idamnjanovic@1: idamnjanovic@1: maxval = max(x(:)); idamnjanovic@1: minval = min(x(:)); idamnjanovic@1: idamnjanovic@1: y = (x-minval) / (maxval-minval);