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