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