-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocationMap.m
More file actions
46 lines (39 loc) · 933 Bytes
/
Copy pathLocationMap.m
File metadata and controls
46 lines (39 loc) · 933 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
37
38
39
40
41
42
43
44
45
46
function [I,LM] = LocationMap(I,layer)
[A,B] = size(I);
LM = zeros(1,A*B);
index = 0;
for i = 2:A-1
for j = 2:B-1
if mod(i+j,2) == layer
if I(i,j) == 0
index = index + 1;
I(i,j) = 1;
LM(index) = 1;
end
if I(i,j) == 255
index = index + 1;
I(i,j) = 254;
LM(index) = 1;
end
if I(i,j) == 1
index = index +1;
LM(index) = 0;
end
if I(i,j) == 254
index = index +1;
LM(index) = 0;
end
end
end
end
if index == 0
LM = [];
AuxLM = 1;
else
LM = LM(1:index);
% xC = cell(1,1);
% xC{1} = LM;
% data = arith07(xC);
% AuxLM = 1 + 8*length(data);
end
end