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
Different behavior of skimage.transform.resize across operating systems. #2629
Comments
Hi @mcquin ! This looks very suspicious... |
@soupault I see the same results on OS X and Ubuntu 16.04 using scikit-image==0.14dev |
Revisiting the above with numpy/scipy from the conda-forge defaults channel changes the Python 2.7 result to match the 3.5 result. So, it seems to be related to floating point precision. There are tiny floating point differences in the If you change the order to 1, I think you will see a very similar result for all platforms/versions. I think it is a matter of floating point rounding errors causing which is the "nearest" neighbor to go one way or the other. I am not sure what a good solution to that is yet. |
perhaps the |
I suspect rounding differences as well. I can give your suggestion a try
first thing tomorrow morning (US Eastern).
…On Apr 20, 2017 18:05, "Gregory R. Lee" ***@***.***> wrote:
perhaps the dest_corners coordinates in resize need to have a small
additional shift on the order of machine epsilon to avoid this corner case.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2629 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEgMW0prPxiB_6gvUv6z-7v4EV7rnMR5ks5rx9a1gaJpZM4NDenY>
.
|
I'm still just starting to look into this, and I have tried adjusting I wonder if it is scikit-image's responsibility to adjust for these machine-level differences. |
For what it's worth, |
@soupault This is beyond my understanding of scikit-image internals and roundoff errors. Do you (or someone on the team) have time to take this on? I have a workaround with |
@mcquin. I just revisited this and had success when adjusting |
…error As reported in scikit-imagegh-2629, which neighbor is judged to be nearest is currently dependent on whether numpy was built with MKL or OpenBLAS. By shifting coordinates by ~100 times machine epsilon when order=0, this inconsistency can be avoided.
Great! Thanks for the update!
…On May 3, 2017 9:33 PM, "Gregory R. Lee" ***@***.***> wrote:
@mcquin <https://github.com/mcquin>. I just revisited this and had
success when adjusting dst_corners, but I had to use a shift of
approximately 40 times machine epsilon for it to take effect. E.g. using
negative shift of 100*(machine epsilon) gives a result consistent with
scipy's ndimage.map_coordinates across both OpenBLAS and MKL-based numpy.
will make a PR for this shortly
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2629 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEgMW-YMdU_fbUs2CWxqZrGSVZoNyUJcks5r2SrngaJpZM4NDenY>
.
|
Hey @rfezzani, I think this issue was submitted back on scikit-image 0.13 or so when there was no anti-aliasing prefilter in resize. If you modify the example to set |
🤦 your right @grlee77, thank you! |
skimage.transform.resize
appears to have different behavior between operating systems. Specifically, Ubuntu 14.04/16.04 and OS X 10.11.6 (I haven't tested on Windows, yet, but I am curious).Steps to reproduce:
I've created a Jupyter notebook with the code to reproduce the error.
Here is the input image:
Here is the output on OS X:
Here is the output on Ubuntu:
Version information (I have checked that is consistent across platforms):
My Python version is 2.7.12 on OS X. I've used on 2.7.3 and 2.7.9 on Ubuntu 12.04 and 14.04 (via Travis), and 2.7.12 on Ubuntu 16.04 (my own box, at work).
The text was updated successfully, but these errors were encountered: