|
Input: |
|
I: layout image created from CAD layers (Fig. 5) |
|
rL: room points list |
|
dL: door points list |
|
Output: (Fig. 6) |
|
h: global 2D traversable grid map |
|
g: semantic topology graph, context-aware layers |
1: |
procedure Semantic Construction(I, rL, dL) |
|
▹ create G as adjacency list from I
|
2: |
GV,E ← ad jList(I), g ← empty
|
3: |
h ← image (I. width, I.height) as WHITE
|
4: |
for each s in rL, then in dL
do
|
5: |
g.vertex. add(s)
|
▹ add it as source vertex |
6: |
Va ← Gblack, Va[s] ← WHITE
|
▹ vertex visited array |
7: |
Pq ← INFINITY
|
▹ priority queue initial value |
8: |
Q ← s
|
▹ priority queue |
9: |
Ad ← NULL
|
▹ adjacency list |
10: |
while (Q! = empty) do
|
▹ Prim’s MST algorithm |
11: |
m ← minimum_weight (Pq)
|
12: |
for
v in neighbor_of (m)
do
|
13: |
update Q, Va, Pq, Ad
|
14: |
g ← edge(room, door)
|
15: |
h[s.i, s.j] ← GREEN
|
▹ room areas |
16: |
if
door_no(gs.vertex) > DOOR_MIN
then
|
17: |
h[s.i, s. j] ← DARK_BLUE
|
▹ hallway areas |
18: |
else if
gs .vertex not in rL
then
|
19: |
h[s.i, s.j] ← RED
|
▹ unknown areas |
20: |
return
(g, h)
|