| Algorithm 1. Ttransition Point Detection. | |
| Input: | Samples of WiFi RSSI |
| Output: | TP’s postion |
| Begin: | minimum distance equals infinite, nearest TP equals TP1 |
| 1: | for every TP fingerprint in database do |
| 2: | while n < number of APs scanned do |
| 3: | compare mac address of every AP with TP fingerprint |
| 4: | if mac address is matched |
| 5: | number of matched APs ++ |
| 6: | end if |
| 7: | end while |
| 8: | if number of matched APs > 3 |
| 9: | compute signal distance between samples and TP |
| 10: | if distance < minimum distance |
| 11: | update the minimum distance |
| 12: | update nearest TP |
| 13: | end if |
| 14: | end if |
| 15: | end for |
| 16: | compare scene label of nearest TP to current scene |
| 17: | if not matched |
| 18: | return ture |
| 19: | else return flase |
| 20: | end if |