mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-29 16:32:32 +08:00
find error in autolevel and percentile autolevel (16bit)
This commit is contained in:
@@ -9,11 +9,12 @@ import skimage.rank as rank
|
||||
|
||||
if __name__ == '__main__':
|
||||
a8 = data.camera()
|
||||
a16 = data.camera().astype(np.uint16)
|
||||
a16 = data.camera().astype(np.uint16)*4
|
||||
selem = disk(10)
|
||||
|
||||
f8= rank.percentile_autolevel(a8,selem,p0=.0,p1=1.)
|
||||
f16= rank.autolevel(a16,selem)
|
||||
f16p= rank.percentile_autolevel(a16,selem,p0=.0,p1=1.)
|
||||
|
||||
print f8==f16
|
||||
|
||||
@@ -21,7 +22,7 @@ if __name__ == '__main__':
|
||||
plt.subplot(1,2,1)
|
||||
plt.imshow(f16)
|
||||
plt.subplot(1,2,2)
|
||||
plt.imshow(f8)
|
||||
plt.imshow(f16p-f16)
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
assert (loc_autolevel==loc_perc_autolevel).all()
|
||||
|
||||
def test_compare_autolevels_16bit(self):
|
||||
image = data.camera().astype(np.uint16)
|
||||
image = data.camera().astype(np.uint16)*4
|
||||
|
||||
selem = disk(20)
|
||||
loc_autolevel = rank.autolevel(image,selem=selem)
|
||||
|
||||
Reference in New Issue
Block a user