Mercurial > hg > smallbox
annotate DL/RLS-DLA/private/imnormalize.m @ 63:e08af264ef93
(none)
author | idamnjanovic |
---|---|
date | Tue, 15 Mar 2011 12:23:35 +0000 |
parents | ad36f80e2ccf |
children |
rev | line source |
---|---|
idamnjanovic@60 | 1 function y = imnormalize(x) |
idamnjanovic@60 | 2 %IMNORMALIZE Normalize image values. |
idamnjanovic@60 | 3 % Y = IMNORMALIZE(X) linearly transforms the intensity values of the image |
idamnjanovic@60 | 4 % X to tightly cover the range [0,1]. If X has more than one channel, the |
idamnjanovic@60 | 5 % channels are handled as one and normalized using the same transform. |
idamnjanovic@60 | 6 |
idamnjanovic@60 | 7 |
idamnjanovic@60 | 8 % Ron Rubinstein |
idamnjanovic@60 | 9 % Computer Science Department |
idamnjanovic@60 | 10 % Technion, Haifa 32000 Israel |
idamnjanovic@60 | 11 % ronrubin@cs |
idamnjanovic@60 | 12 % |
idamnjanovic@60 | 13 % May 2004 |
idamnjanovic@60 | 14 |
idamnjanovic@60 | 15 |
idamnjanovic@60 | 16 maxval = max(x(:)); |
idamnjanovic@60 | 17 minval = min(x(:)); |
idamnjanovic@60 | 18 |
idamnjanovic@60 | 19 y = (x-minval) / (maxval-minval); |