mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-19 12:40:22 +08:00
BUG: Adapthist interpolation grids could be improperly spaces
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user