diff --git a/skimage/exposure/_unwrap_2d.pyx b/skimage/exposure/_unwrap_2d.pyx index 88983287..6e889729 100644 --- a/skimage/exposure/_unwrap_2d.pyx +++ b/skimage/exposure/_unwrap_2d.pyx @@ -1,12 +1,12 @@ -cdef extern void unwrap2D(float* wrapped_image, - float* unwrapped_image, +cdef extern void unwrap2D(double* wrapped_image, + double* unwrapped_image, unsigned char* input_mask, int image_width, int image_height, int wrap_around_x, int wrap_around_y) -def unwrap_2d(float[:, ::1] image, +def unwrap_2d(double[:, ::1] image, unsigned char[:, ::1] mask, - float[:, ::1] unwrapped_image, + double[:, ::1] unwrapped_image, wrap_around): unwrap2D(&image[0, 0], &unwrapped_image[0, 0], diff --git a/skimage/exposure/unwrap.py b/skimage/exposure/unwrap.py index a2a8c42a..039ae911 100644 --- a/skimage/exposure/unwrap.py +++ b/skimage/exposure/unwrap.py @@ -92,6 +92,8 @@ def unwrap_phase(image, wrap_around=False): if image.ndim == 1: unwrap_1d(image_not_masked, image_unwrapped) elif image.ndim == 2: + image_not_masked = np.asarray(image, dtype=np.float64, order='C') + image_unwrapped = np.empty_like(image, dtype=np.float64, order='C') unwrap_2d(image_not_masked, mask, image_unwrapped, wrap_around) elif image.ndim == 3: