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