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

support single precision in skimage.color #5443

Merged
merged 8 commits into from
Jul 19, 2021

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Jun 25, 2021

Description

This PR preserves float32 dtype in the color conversion functions (I had forgotten this one when I opened all of the other single-precision PRs awhile back).

I did find that I had to keep internal computations in the get_DH2 helper in double precision to pass the existing test_delta_e.py tests, though.

The output remains np.float64 as it was prior to this PR for all integer-type inputs.

Checklist

For reviewers

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    doc/release/release_dev.rst.

make sure np.float16 gets promoted to np.float32
These functions seem sensitive to floating point error, so use higher precision
it seems only get_DH2 needs to be in double precision for accuracy
remove reliance on unittest.TestCase in test_colorconv.py
@grlee77 grlee77 added ⏩ type: Enhancement Improve existing features 📜 type: API Involves API change(s) labels Jun 25, 2021
@grlee77 grlee77 added this to the 0.19 milestone Jul 8, 2021
skimage/color/colorconv.py Outdated Show resolved Hide resolved
Co-authored-by: Marianne Corvellec <marianne.corvellec@ens-lyon.org>
@rfezzani
Copy link
Member

Thank you @grlee77, merging 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⏩ type: Enhancement Improve existing features 📜 type: API Involves API change(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants