mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-10 12:40:08 +08:00
Add test for 3D images
This commit is contained in:
@@ -61,6 +61,19 @@ def test_hessian_matrix():
|
|||||||
[0, 0, 2, 0, 0]]))
|
[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():
|
def test_structure_tensor_eigvals():
|
||||||
square = np.zeros((5, 5))
|
square = np.zeros((5, 5))
|
||||||
square[2, 2] = 1
|
square[2, 2] = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user