mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-19 11:27:45 +08:00
Merge pull request #171 from emmanuelle/modif_radon
BUG: Division by zero for small arrays in iradon.
This commit is contained in:
@@ -135,7 +135,7 @@ def iradon(radon_image, theta=None, output_size=None,
|
||||
img = radon_image.copy()
|
||||
# resize image to next power of two for fourier analysis
|
||||
# speeds up fourier and lessens artifacts
|
||||
order = max(64, 2 ** np.ceil(np.log(2 * n) / np.log(2)))
|
||||
order = max(64., 2 ** np.ceil(np.log(2 * n) / np.log(2)))
|
||||
# zero pad input image
|
||||
img.resize((order, img.shape[1]))
|
||||
# construct the fourier filter
|
||||
|
||||
@@ -30,6 +30,9 @@ def test_radon_iradon():
|
||||
reconstructed = iradon(radon(image), filter="ramp", interpolation="nearest")
|
||||
delta = np.mean(abs(image - reconstructed))
|
||||
assert delta < 0.05
|
||||
size = 20
|
||||
image = np.tri(size) + np.tri(size)[::-1]
|
||||
reconstructed = iradon(radon(image), filter="ramp", interpolation="nearest")
|
||||
|
||||
def test_iradon_angles():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user