songtaohe / Sat2Graph

Sat2Graph: Road Graph Extraction through Graph-Tensor Encoding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interested in pseudo code of decoder

Dicksonchin93 opened this issue · comments

Great work you have done here, I wanted to see how you handled the distance computation for the two vertexes connected to the same edge (whether you computed distance for one edge or on both edge) but the paper didn't emphasize a lot on the implementation of the decoder, code looks rather complicated and wonder if there is some decoder pseudocode to look at?

Great work you have done here, I wanted to see how you handled the distance computation for the two vertexes connected to the same edge (whether you computed distance for one edge or on both edge) but the paper didn't emphasize a lot on the implementation of the decoder, code looks rather complicated and wonder if there is some decoder pseudocode to look at?

For your first half of the question, the answer is that we only compute the distance for one edge. In this case, even when one edge is missing, we can still connect the two vertices.

Indeed, the implementation of the decoder is complicated. I added some comments to the code and here is the outline of the decoder algorithm.

Step-1 Find vertices (lines)

  • (a) Find vertices through local minima detection (lines) .
  • (b) Find vertices at the edge endpoints. For example, we have links a<-->b and b<-->c but b is missing. In this case, we use the edges a-->b and (or) b<--c to recover b. (lines).
  • (c) Create RTree index to speed up vertex query (lines).

Step-2 Connect the vertices to build a graph. (lines)
We connect vertices through three passes. Here, we use d(a-->b) to represent the distance metric for edge a-->b.

  • Pass-1 For a link a<-->b, we connect them only if d(a-->b) + d(a<--b) <= snap_dist. (lines)
  • Pass-2 (relaxed) For a link a<-->b, we connect them only if 2d(a-->b) <= snap_dist or 2d(a<--b) <= snap_dist. (lines)
  • Pass-3 (more relaxed) For a link a<-->b, we connect them only if d(a-->b) <= snap_dist or d(a<--b) <= snap_dist. (lines)

Step-3 Some common graph post-processing passes. We apply them to all methods in our evaluation.

for step1(b) it feels more like it is using either one of a-->b or b<--c to find b but not both as the values get overrided here

edgeEndpointMap[x1,y1] = imagegraph[x,y,2+4*j] * imagegraph[x,y,0]

thanks for all the explanations! especially on step 2

for step1(b) it feels more like it is using either one of a-->b or b<--c to find b but not both as the values get overrided here

edgeEndpointMap[x1,y1] = imagegraph[x,y,2+4*j] * imagegraph[x,y,0]

thanks for all the explanations! especially on step 2

Yeah, you are right. In step1(b), I should write 'In this case, we use the edges a-->b OR b<--c to recover b'.