Mercurial > hg > smallbox
comparison Problems/private/imnormalize.m @ 10:207a6ae9a76f version1.0
(none)
author | idamnjanovic |
---|---|
date | Mon, 22 Mar 2010 15:06:25 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9:28f2b5fe3483 | 10:207a6ae9a76f |
---|---|
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); |