find error in autolevel and percentile autolevel (16bit)

This commit is contained in:
Olivier Debeir
2012-10-15 16:56:36 +02:00
parent a13d1bb4ac
commit 0e7271bfb4
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -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()
+1 -1
View File
@@ -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)