mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-07 01:56:59 +08:00
unwrap: Change 1D unwrapper from float to double.
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
from libc.math cimport M_PI
|
||||
|
||||
|
||||
def unwrap_1d(float[::1] image, float[::1] unwrapped_image):
|
||||
def unwrap_1d(double[::1] image, double[::1] unwrapped_image):
|
||||
'''Phase unwrapping using the naive approach.'''
|
||||
cdef:
|
||||
Py_ssize_t i
|
||||
float difference
|
||||
double difference
|
||||
long periods = 0
|
||||
unwrapped_image[0] = image[0]
|
||||
for i in range(1, image.shape[0]):
|
||||
|
||||
@@ -90,6 +90,8 @@ def unwrap_phase(image, wrap_around=False):
|
||||
image_unwrapped = np.empty_like(image, dtype=np.float32, order='C')
|
||||
|
||||
if image.ndim == 1:
|
||||
image_not_masked = np.asarray(image, dtype=np.float64, order='C')
|
||||
image_unwrapped = np.empty_like(image, dtype=np.float64, order='C')
|
||||
unwrap_1d(image_not_masked, image_unwrapped)
|
||||
elif image.ndim == 2:
|
||||
image_not_masked = np.asarray(image, dtype=np.float64, order='C')
|
||||
|
||||
Reference in New Issue
Block a user