| Algorithm 1 BIB algorithm. |
|
Input: Region R, threshold T, the four coordinates , , , and , and the four sensor values , , , and of all , the heights and the widths of all
|
|
Output:
|
| 1: |
fordo
|
| 2: |
. |
| 3: |
Calculate , , , and with reference to S. |
| 4: |
if
then
|
| 5: |
|
| 6: |
|
| 7: |
|
| 8: |
|
| 9: |
Calculate , , , . |
| 10: |
. |
| 11: |
if
then
|
| 12: |
|
| 13: |
else
|
| 14: |
|
| 15: |
end if
|
| 16: |
else
|
| 17: |
|
| 18: |
for
do
|
| 19: |
if
j in
then
|
| 20: |
if
then
|
| 21: |
Add j to U. |
| 22: |
end if
|
| 23: |
end if
|
| 24: |
if
j in
then
|
| 25: |
if
j is intersected with the line
then
|
| 26: |
Add the intersection to the ordered set U. |
| 27: |
end if
|
| 28: |
end if
|
| 29: |
end for
|
| 30: |
if
,
then
|
| 31: |
|
| 32: |
else
|
| 33: |
is equal to the area of the polygon of which the vertexes are listed in set U. |
| 34: |
end if
|
| 35: |
end if
|
| 36: |
|
| 37: |
end for |
| 38: |
|