-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathnorm255.m
More file actions
36 lines (31 loc) · 881 Bytes
/
norm255.m
File metadata and controls
36 lines (31 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function img = norm255(img)
% This function normalizes the image into between 0 and 255, and the output
% is stored in uint8
%
%
%
% Author: Mohammed Al-Rawi, al-rawi@ua.pt
%
% Date: Oct 22, 2016
%
%
%
% Project SWARMs http://www.swarms.eu/
%
% License:
%=====================================================================
% This is part of the UNDROIP toolbox, released under
% the GPL. https://github.com/rawi707/UNDROIP/blob/master/LICENSE
%
% The UNDROIP toolbox is available free and
% unsupported to those who might find it useful. We do not
% take any responsibility whatsoever for any problems that
% you have related to the use of the UNDROIP toolbox.
%
% ======================================================================
%%
mn = min(min(img));
mx = max(max((img)));
img = ceil(255*(img-mn)/(mx-mn));
img = uint8(img);
end