|
Algorithm 2:
|
Input: The derived by Algorithm 1, the length L of the ROI, and the height H of the ROI.
Output: The designated locations of nodes.
-
1:
; ; ; ;
-
2:
for to
do //row 1, row 2, …, row
-
3:
if (i is odd) then
-
4:
output the location ( for each to ;
-
5:
else //i is even
-
6:
output the location (; //location of the first node in this row
-
7:
output the location ( for each to ;
-
8:
end if
-
9:
output the location (; //location of the last node in this row
-
10:
end for
-
11:
//row ℓ (i.e., the last row)
-
12:
if (ℓ is odd) then
-
13:
output the location ( for each to ;
-
14:
else //ℓ is even
-
15:
output the location (; //location of the first node in row ℓ
-
16:
output the location ( for each to ;
-
17:
end if
-
18:
output the location (; //location of the last node in row ℓ
|