Skip to main content
. 2018 Oct 10;18(10):3376. doi: 10.3390/s18103376
Algorithm 1 Feature vector V_location
Input: positioning point Po(xo,yo);
collection of all scene boundaries D={D1, D2, , Dn}.
Procedure: function GetSceneCategory(Po, D)
1: feature vector Vlocation{0}Ncategory+1
2: For each scene Di={T1, T2, } in collection D
3:  For each polygon Ti=[(x1,y1),(x2,y2),,(xn,yn),(x1,y1)] in Di
4:   For each pair of sequential points Pi,Pi+1 in Ti
5:    calculate the angle θi between PoPi and PoPi+1
6:    sum up angles θSumθSum+θi
7:   End For
8:   If Ti is the outer boundary and θSum equals 2π
9:    element Vk1 in feature vector Vlocation, where k represents the category of scene Di
10:   Else If Ti is the inner boundary and θSum equals 2π
11:    element Vk0 in feature vector Vlocation, where k is the category of scene Di
12:   End If
13:   End For
14: End For
15: If elements of feature vector Vlocation all equal to 0
16:  element V00 in feature vector Vlocation, means the point locates outside all the scenes
17: End If
Output: feature vector Vlocation