unwrap: Change 2D wrapper code from float to double.

This commit is contained in:
Jostein Bø Fløystad
2013-11-22 10:45:07 +01:00
parent 9bacb0d54a
commit 9091d2759a
2 changed files with 6 additions and 4 deletions
+4 -4
View File
@@ -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],
+2
View File
@@ -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: