Add function for image rotation

This commit is contained in:
Johannes Schönberger
2012-08-27 13:31:33 +02:00
parent a0649791ae
commit 6f4c2ad268
2 changed files with 70 additions and 1 deletions
+8 -1
View File
@@ -2,7 +2,7 @@ from numpy.testing import assert_array_almost_equal, run_module_suite
import numpy as np
from scipy.ndimage import map_coordinates
from skimage.transform import (warp, warp_coords,
from skimage.transform import (warp, warp_coords, rotate,
AffineTransform,
ProjectiveTransform,
SimilarityTransform)
@@ -74,6 +74,13 @@ def test_fast_homography():
assert d < 0.001
def test_rotate():
x = np.zeros((5, 5), dtype=np.double)
x[1, 1] = 1
x90 = rotate(x, 90)
assert_array_almost_equal(x90, np.rot90(x))
def test_swirl():
image = img_as_float(data.checkerboard())