mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-13 00:26:15 +08:00
unwrap: Simplify code after completing float->double.
This commit is contained in:
@@ -86,21 +86,15 @@ def unwrap_phase(image, wrap_around=False):
|
||||
mask = np.require(image.mask, np.uint8, ['C'])
|
||||
else:
|
||||
mask = np.zeros_like(image, dtype=np.uint8, order='C')
|
||||
image_not_masked = np.asarray(image, dtype=np.float32, order='C')
|
||||
image_unwrapped = np.empty_like(image, dtype=np.float32, order='C')
|
||||
image_not_masked = np.asarray(image, dtype=np.float64, order='C')
|
||||
image_unwrapped = np.empty_like(image, dtype=np.float64, 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')
|
||||
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:
|
||||
image_not_masked = np.asarray(image, dtype=np.float64, order='C')
|
||||
image_unwrapped = np.empty_like(image, dtype=np.float64, order='C')
|
||||
unwrap_3d(image_not_masked, mask, image_unwrapped,
|
||||
wrap_around)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user