0

I'm attempting to implement the Shih-Wu distance transform algorithm, as described on page 5 of the pdf. It looks fairly simple but I'm hampered by my limited math (or possibly my reading comprehension ability).

I think I have it all except for one question:

In the algorithm, how is R(p) used? It is meticulously calculated using h(p,q) and G(p,q), and then appears not to be used anywhere.

I'm sure it's explained somewhere in the proof, but the math is opaque to me, and I don't see R mentioned in the lead-in to the algorithm.

1 Answer 1

1

In the definitions on page 4 it says:

R(p): The relative-coordinates vector R(p) = (Rx, Ry) of pixel p, which records the horizontal and vertical pixel-distances between p and the closest background pixel. It is initialized as all (0,0). Note that, Rx(p) and Ry(p) indicate the horizontal and vertical pixel-distances, respectively.

At every pixel, the algorithm calculates h() using the R values already saved in the neighboring pixels, and then saves the R value for that pixel so that it can be used in the calculations for the next pixel.

2
  • It sure does - but then what is done with it? The algorithm doesn't seem to address how it's used once it's calculated.
    – meetar
    Commented Jun 12, 2013 at 17:04
  • Ahh, so R(q) is actually the value of R(p) under the location of q in the kernel? (Wasn't my downvote, btw)
    – meetar
    Commented Jun 12, 2013 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.