mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-13 15:03:54 +08:00
Fix fast warping of images
This commit is contained in:
@@ -954,9 +954,10 @@ def warp(image, inverse_map=None, map_args={}, output_shape=None, order=1,
|
||||
# use fast Cython version for specific interpolation orders
|
||||
if order in range(4) and not map_args:
|
||||
matrix = None
|
||||
if isinstance(inverse_map, HOMOGRAPHY_TRANSFORMS):
|
||||
if inverse_map in HOMOGRAPHY_TRANSFORMS:
|
||||
matrix = inverse_map._matrix
|
||||
elif inverse_map.__name__ == 'inverse' \
|
||||
elif hasattr(inverse_map, '__name__') \
|
||||
and inverse_map.__name__ == 'inverse' \
|
||||
and inverse_map.im_class in HOMOGRAPHY_TRANSFORMS:
|
||||
matrix = np.linalg.inv(inverse_map.im_self._matrix)
|
||||
if matrix is not None:
|
||||
|
||||
Reference in New Issue
Block a user