BUG: Adapthist interpolation grids could be improperly spaces

This commit is contained in:
Steven Silvester
2012-12-28 18:37:15 -06:00
parent 1af3d69cde
commit f48f94f0be
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -158,11 +158,11 @@ def _clahe(image, ntiles_x, ntiles_y, clip_limit, nbins=128):
for y in range(ntiles_y + 1):
xstart = 0
if y == 0: # special case: top row
ystep = int(y_size / 2)
ystep = y_size / 2.
yU = 0
yB = 0
elif y == ntiles_y: # special case: bottom row
ystep = int(y_size / 2)
ystep = y_size / 2.
yU = ntiles_y - 1
yB = yU
else: # default values
@@ -172,11 +172,11 @@ def _clahe(image, ntiles_x, ntiles_y, clip_limit, nbins=128):
for x in range(ntiles_x + 1):
if x == 0: # special case: left column
xstep = int(x_size / 2)
xstep = x_size / 2.
xL = 0
xR = 0
elif x == ntiles_x: # special case: right column
xstep = int(x_size / 2)
xstep = x_size / 2.
xL = ntiles_x - 1
xR = xL
else: # default values
+2 -2
View File
@@ -103,8 +103,8 @@ def test_adapthist_grayscale():
nbins=128)
assert_almost_equal = np.testing.assert_almost_equal
assert img.shape == adapted.shape
assert_almost_equal(peak_snr(img, adapted), 97.949, 3)
assert_almost_equal(norm_brightness_err(img, adapted), 0.03077, 3)
assert_almost_equal(peak_snr(img, adapted), 97.531, 3)
assert_almost_equal(norm_brightness_err(img, adapted), 0.0313, 3)
return data, adapted