mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-16 11:27:48 +08:00
Prevent infinite loop in adapthist for low clip_limit
Prevent infinite loop in adapthist Add a test that exposed the infinite loop Use better check to prevent endless loop
This commit is contained in:
@@ -213,7 +213,7 @@ def test_adapthist_grayscale():
|
||||
img = np.dstack((img, img, img))
|
||||
with expected_warnings(['precision loss|non-contiguous input',
|
||||
'deprecated']):
|
||||
adapted_old = exposure.equalize_adapthist(img, 10, 9, clip_limit=0.01,
|
||||
adapted_old = exposure.equalize_adapthist(img, 10, 9, clip_limit=0.001,
|
||||
nbins=128)
|
||||
adapted = exposure.equalize_adapthist(img, kernel_size=(57, 51), clip_limit=0.01, nbins=128)
|
||||
assert img.shape == adapted.shape
|
||||
|
||||
Reference in New Issue
Block a user