-
Notifications
You must be signed in to change notification settings - Fork 4
/
gle_0.m
35 lines (31 loc) · 873 Bytes
/
gle_0.m
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
function oneglglm = gle_0(si,NL)
% RLE image gray level Gap Length matrix for 0 degree
%
% Author:
% ---------------------------------------------
% (C)Xunkai Wei <[email protected]>
% Beijing Aeronautical Technology Research Center
% Beijing %9203-12,10076
% History:
% -------
% Creation: beta Date: 01/11/2007
% Revision: 1.0 Date: 10/11/2007
% Assure row number is exactly the gray level
[m,n]=size(si);
oneglglm=zeros(NL,n);
for i=1:m
x=si(i,:);
% run length Encode of each vector
for j = 1:max(x(:))
index = find(x == j);
if ~isempty(index) && length(index)~=1
for k = 1:length(index)-1
for l = k+1:length(index)
gap = index(l)-index(k);
oneglglm(j,gap) = oneglglm(j,gap) +1;
end
end
else
end
end
end