ENH: Implement fast coordinate transformations.

This commit is contained in:
Stefan van der Walt
2012-05-02 21:31:23 -07:00
parent 12669d62e6
commit 7df3707c33
7 changed files with 268 additions and 8 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import numpy as np
from numpy.testing import assert_array_almost_equal
from skimage.transform.project import _stackcopy
from skimage.transform._warp import _stackcopy
from skimage.transform import homography, fast_homography
from skimage import data
from skimage.color import rgb2gray
+18
View File
@@ -0,0 +1,18 @@
import numpy as np
from numpy.testing import assert_array_almost_equal
from skimage import transform as tf, data, img_as_float
def test_roundtrip():
image = img_as_float(data.checkerboard())
swirl_params = {'radius': 80, 'rotation': 0, 'order': 2, 'mode': 'reflect'}
unswirled = tf.swirl(
tf.swirl(image, strength=10, **swirl_params),
strength=-10, **swirl_params
)
assert np.mean(np.abs(image - unswirled)) < 0.01
if __name__ == "__main__":
np.testing.run_module_suite()