annotate examples/private/imnormalize.m @ 1:7750624e0c73 version0.5

(none)
author idamnjanovic
date Thu, 05 Nov 2009 16:36:01 +0000
parents
children
rev   line source
idamnjanovic@1 1 function y = imnormalize(x)
idamnjanovic@1 2 %IMNORMALIZE Normalize image values.
idamnjanovic@1 3 % Y = IMNORMALIZE(X) linearly transforms the intensity values of the image
idamnjanovic@1 4 % X to tightly cover the range [0,1]. If X has more than one channel, the
idamnjanovic@1 5 % channels are handled as one and normalized using the same transform.
idamnjanovic@1 6
idamnjanovic@1 7
idamnjanovic@1 8 % Ron Rubinstein
idamnjanovic@1 9 % Computer Science Department
idamnjanovic@1 10 % Technion, Haifa 32000 Israel
idamnjanovic@1 11 % ronrubin@cs
idamnjanovic@1 12 %
idamnjanovic@1 13 % May 2004
idamnjanovic@1 14
idamnjanovic@1 15
idamnjanovic@1 16 maxval = max(x(:));
idamnjanovic@1 17 minval = min(x(:));
idamnjanovic@1 18
idamnjanovic@1 19 y = (x-minval) / (maxval-minval);