Input: Binary mask dataset of A, B. |
Output:
PSD(S(A), S(B)) |
1 |
S(A) = {a1, a2, …, an} ← Edge extraction of A; |
2 |
S(B) = {b1, b2, …, bm} ← Edge extraction of B; |
3 |
Compute one-sided PSD from A to B
|
4 |
for each Point a in S (A) do
|
5 |
d(a, S(B)) ← The minimum distance from a to S(B); |
6 |
if
a ∈ B
then
|
7 |
α ← +1; //Overestimation of PSM |
8 |
else
a ∉ B
then
|
9 |
α ← −1; //Underestimation of PSM |
10 |
end if
|
11 |
dg(a, S(B)) ← α ⋅ d(a, S(B)); |
12 |
end for
|
13 |
|
14 |
Compute one-sided PSD from B to A
|
15 |
for each Point b in S(B) do
|
16 |
d(b, S(A)) ← The minimum distance from b to S(A); |
17 |
if
b ∉ A then
|
18 |
β ← +1; //Overestimation of PSM |
19 |
else
b ∈ A then
|
20 |
β ← −1; //Underestimation of PSM |
21 |
end if
|
22 |
dg(b, S(A)) ← β ⋅ d(b, S(A)); |
23 |
end for
|
24 |
|
25 |
Compute two-sided PSD index of A and B
|
26 |
PSD(S(A), S(B)) ← 0.5 {g(S(A), S(B)) + (S(B), S(A))} |
27 |
Return
PSD(S(A), S(B)); |