Skip to content

Commit

Permalink
Merge pull request soft-matter#38 from danielballan/master
Browse files Browse the repository at this point in the history
TST: Add test specifically checking that whole-pixel shift have correct ...
  • Loading branch information
danielballan committed Jan 7, 2014
2 parents 9e71b9e + e886bc3 commit 2ad7c64
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mr/tests/test_feature.py
Expand Up @@ -281,3 +281,16 @@ def test_eccentricity(self):
expected = ECC
assert_allclose(actual, expected, atol=0.02)


def test_whole_pixel_shifts(self):
L = 21
dims = (L, L + 2) # avoid square images in tests
pos = np.array([7, 13])
guess = np.array([6, 13])
cols = ['x', 'y']
expected = pos

image = np.ones(dims, dtype='uint8')
draw_gaussian_spot(image, pos[::-1], 2)
actual = mr.feature.refine(image, image, 6, guess, characterize=False)
assert_allclose(actual, expected, atol=0.1)

0 comments on commit 2ad7c64

Please sign in to comment.