mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 19:00:47 +08:00
Special-case 2D images to maintain x/y instead of r/c
This commit is contained in:
@@ -158,6 +158,10 @@ def hessian_matrix(image, sigma=1, mode='constant', cval=0):
|
||||
H_elems = [np.gradient(gradients[ax0], axis=ax1)
|
||||
for ax0, ax1 in combinations_with_replacement(axes, 2)]
|
||||
|
||||
if image.ndim == 2:
|
||||
# The legacy 2D code followed (x, y) convention, so we swap the axis
|
||||
# order to maintain compatibility with old code
|
||||
H_elems.reverse()
|
||||
return H_elems
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user