Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you compute the second nearest distance? #200

Open
windson87 opened this issue Feb 4, 2019 · 4 comments
Open

How do you compute the second nearest distance? #200

windson87 opened this issue Feb 4, 2019 · 4 comments

Comments

@windson87
Copy link

Hi, I have some issue understanding your code.
I saw you use the scipy.morphology transform_distance_edt to calculate the nearest distance
but where do you calculate the second nearest one ? since the weights will depending on the second nearest and the first nearest distance, if I understand it correctly.

In the code, the second nearest one is directly taken from the distance matrix dim 1 by calling
image

Could anyone help me out with this? Thanks in advance

@lunaalvarez
Copy link

Hi,
I was looking into the the same part now. My opinion is that they used the second closest object distances to see if these pixels count into the predefined border width of the buildings. This was probably done because, at first, they tried eroding the ground truth masks and this was probably a reconstruction method for small chunks separated from the gt masks after erosion.

crop

like this code snippet. In the winning configuration, they didn't use it as quoted under what didn't work in their poster:

× What didn't Work

  • Ground truth masks are prepared by first eroding them per mask creating non
    overlapping masks and only after that the distances are calculated.

I have no idea why they didnt use the closest distance or total distance though:) Did you figure this part out?

@jakubczakon
Copy link
Collaborator

Hi @lunaalvarez, in reality, we wanted to be close to what people did in the original U-Net paper.
And then as we were experimenting added new things.

I think an alternative simple distance calculation was used and worked really well (and was easier/faster) here https://spark-in.me/post/a-small-case-for-search-of-structure-within-your-data.

I hope this helps.

@lunaalvarez
Copy link

Hi,
Thank you for your quick reply. The gitter discussion was actually very helpful all around. Thanks again!

@jakubczakon
Copy link
Collaborator

You are welcome, for some reason I was unwatched from this repo for many months and because of that I was silent, sorry @windson87 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants