mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-01 01:27:01 +08:00
test_radon_transform: Change test criterion for sinogram_circle.
This commit is contained in:
@@ -241,11 +241,17 @@ def check_sinogram_circle_to_square(size):
|
||||
image = _random_circle((size, size))
|
||||
theta = np.linspace(0., 180., size, False)
|
||||
sinogram_circle = radon(image, theta, circle=True)
|
||||
argmax_shape = lambda a: np.unravel_index(np.argmax(a), a.shape)
|
||||
print('\n\targmax of circle:', argmax_shape(sinogram_circle))
|
||||
sinogram_square = radon(image, theta, circle=False)
|
||||
print('\targmax of square:', argmax_shape(sinogram_square))
|
||||
sinogram_circle_to_square = _sinogram_circle_to_square(sinogram_circle)
|
||||
print('\targmax of circle to square:',
|
||||
argmax_shape(sinogram_circle_to_square))
|
||||
error = abs(sinogram_square - sinogram_circle_to_square)
|
||||
print(np.mean(error), np.max(error))
|
||||
assert np.allclose(sinogram_square, sinogram_circle_to_square)
|
||||
assert (argmax_shape(sinogram_square)
|
||||
== argmax_shape(sinogram_circle_to_square))
|
||||
|
||||
|
||||
def test_sinogram_circle_to_square():
|
||||
|
||||
Reference in New Issue
Block a user