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

order=0 ski.transform.warp does not utilize fast code path #7273

Open
stefanv opened this issue Dec 19, 2023 · 0 comments
Open

order=0 ski.transform.warp does not utilize fast code path #7273

stefanv opened this issue Dec 19, 2023 · 0 comments
Labels

Comments

@stefanv
Copy link
Member

stefanv commented Dec 19, 2023

Description:

To change to internal interpolation:

diff --git a/skimage/transform/_warps.py b/skimage/transform/_warps.py
index d7b38efdb..2fcfb7ed2 100644
--- a/skimage/transform/_warps.py
+++ b/skimage/transform/_warps.py
@@ -920,7 +920,7 @@ def warp(

     order = _validate_interpolation_order(image.dtype, order)

-    if order > 0:
+    if order >= 0:
         image = convert_to_float(image, preserve_range)
         if image.dtype == np.float16:
             image = image.astype(np.float32)
@@ -947,7 +947,7 @@ def warp(
             "to use bi-linear or bi-cubic interpolation instead."
         )

-    if order in (1, 3) and not map_args:
+    if order in (0, 1, 3) and not map_args:
         # use fast Cython version for specific interpolation orders and input

         matrix = None

Otherwise map_coordinates is used.

Way to reproduce:

No response

Version information:

No response

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

No branches or pull requests

1 participant