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
Hausdorff distance to return the pair of points that defines it #5178
Comments
Thank you @ogencoglu for this suggestion 😉 |
For example scipy hausdorff returns the indices respectively: https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.directed_hausdorff.html |
As one of the original authors of the hausdorff distance metric, I can try implementing this. |
Hi @clementkng and @ogencoglu! I think this would be a useful addition. The biggest issue with implementing it is that it becomes an API change. In general, we are also trying to move away from APIs like @scikit-image/core any ideas about the best way forward is here? tbh I'm inclined to make an exception and allow |
Here are the 2 options:
|
What about creating an extra function that returns the coordinates of the points? This way no need to modify |
@ogencoglu the above two options will cause user code to break for users that use 0.18.x. We don't do that in a single release except in case of bug fixes. @rfezzani yes that's the other alternative, but it seems ugly/clunky. I think we did settle for this as the approach for 1.0, with the new function called |
Having an additional function |
My suggestion was to add |
We already know that returning varying number / types of arguments is a problem for future typing, so I'd avoid creating additional headaches for ourselves knowingly. We need a SKIP for this, but for this PR that will come too late; as such, we have a few (non-headache inducing) options:
I'm more fond of option (2) than of two separate functions, but separate functions at least avoid the typing problem. |
@rfezzani my bad, I misunderstood your suggestion indeed. A separate, 'non_overlapping' function would certainly be more acceptable, even if not ideal. @stefanv ok, so we would modify the existing |
@mkcor Right, so it would take a deprecation cycle with an |
So if I'm reading the above conversation correctly, it seems that @mkcor and @stefanv are partially leaning in favor of
while @rfezzani and @jni are partially leaning in favor of
I have a slight preference for the |
I am in favor of any option that doesn't paint us into a corner, so housedorff peaks works too. |
|
I see in the description of the output of |
I think |
@ogencoglu can we close this issue now that #5207 is merged? |
Thank you @clementkng for the reminder 😉 and thank you @ogencoglu for your suggestion! |
Thanks a lot! |
Description
Thanks for the new metric of
hausdorff_distance
: https://scikit-image.org/docs/dev/api/skimage.metrics.html#skimage.metrics.hausdorff_distance . In many cases it is quite relevant to also get the pair of pixel coordinates that defined the Hausdorff distance, i.e., one coordinate fromimage0
and another fromimage1
that gave the maximum distance.The text was updated successfully, but these errors were encountered: