mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-02 13:58:01 +08:00
Fix bug in warp which caused 1 pixel images not to be clipped
This commit is contained in:
committed by
Stefan van der Walt
parent
11b742ca28
commit
e2dec8339c
@@ -1015,7 +1015,8 @@ def warp(image, inverse_map=None, map_args={}, output_shape=None, order=1,
|
||||
if mode == 'constant' and not (0 <= cval <= 1):
|
||||
clipped[out == cval] = cval
|
||||
|
||||
if clipped.shape[0] == 1 or clipped.shape[1] == 1:
|
||||
if clipped.ndim == 3 and orig_ndim == 2:
|
||||
# remove singleton dim introduced by atleast_3d
|
||||
return clipped[..., 0]
|
||||
else:
|
||||
return clipped
|
||||
else: # remove singleton dim introduced by atleast_3d
|
||||
return clipped.squeeze()
|
||||
|
||||
Reference in New Issue
Block a user