comparison Problems/private/imnormalize.m @ 61:42fcbcfca132

(none)
author idamnjanovic
date Tue, 15 Mar 2011 12:21:31 +0000
parents 207a6ae9a76f
children
comparison
equal deleted inserted replaced
60:ad36f80e2ccf 61:42fcbcfca132
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);