diff --git a/skimage/feature/tests/test_corner.py b/skimage/feature/tests/test_corner.py index 3535ab1a..261b8e92 100644 --- a/skimage/feature/tests/test_corner.py +++ b/skimage/feature/tests/test_corner.py @@ -61,6 +61,19 @@ def test_hessian_matrix(): [0, 0, 2, 0, 0]])) +def test_hessian_matrix_3d(): + cube = np.zeros((5, 5, 5)) + cube[2, 2, 2] = 4 + Hs = hessian_matrix(cube, sigma=0.1) + assert len(Hs) == 6, ("incorrect number of Hessian images (%i) for 3D" % + len(Hs)) + assert_almost_equal(Hs[2][:, 2, :], np.array([[0, 0, 0, 0, 0], + [0, 1, 0, -1, 0], + [0, 0, 0, 0, 0], + [0, -1, 0, 1, 0], + [0, 0, 0, 0, 0]])) + + def test_structure_tensor_eigvals(): square = np.zeros((5, 5)) square[2, 2] = 1