Mercurial > hg > smallbox
comparison examples/private/imnormalize.m @ 1:7750624e0c73 version0.5
(none)
author | idamnjanovic |
---|---|
date | Thu, 05 Nov 2009 16:36:01 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:5181bee80bc1 | 1:7750624e0c73 |
---|---|
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); |