transform.radon: Use correct padding for rectangular images.

This commit is contained in:
Jostein Bø Fløystad
2013-06-23 12:48:13 +02:00
parent 28de2f978a
commit 380c916c92
+3 -3
View File
@@ -74,9 +74,9 @@ def radon(image, theta=None, circle=False):
out = np.zeros((min(padded_image.shape), len(theta)))
else:
height, width = image.shape
diagonal = np.sqrt(height**2 + width**2)
heightpad = np.ceil(diagonal - height)
widthpad = np.ceil(diagonal - width)
diagonal = np.sqrt(2) * max(image.shape)
heightpad = int(np.ceil(diagonal - height))
widthpad = int(np.ceil(diagonal - width))
padded_image = np.zeros((int(height + heightpad),
int(width + widthpad)))
y0 = int(np.ceil(heightpad / 2))