You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wiener filter from scipy.signal is encountering divide by zero errors/warnings for images that have a patch of uniform colour. Any help in fixing this or working around it would be greatly appreciated!
Reproducing code example:
importnumpyasnpimportscipy.signalimage=np.random.randint(0, 256, size=(8, 8, 3))
image[2:6, 2:6, :] =137# can be any numberwiener_filtered=scipy.signal.wiener(image.astype('float32'), mysize=(3, 3, 1))
Error message:
/home/paperspace/anaconda3/lib/python3.6/site-packages/scipy/signal/signaltools.py:950: RuntimeWarning: divide by zero encountered in true_divide
res *= (1 - noise / lVar)
/home/paperspace/anaconda3/lib/python3.6/site-packages/scipy/signal/signaltools.py:950: RuntimeWarning: invalid value encountered in multiply
res *= (1 - noise / lVar)
The wiener filter from
scipy.signal
is encountering divide by zero errors/warnings for images that have a patch of uniform colour. Any help in fixing this or working around it would be greatly appreciated!Reproducing code example:
Error message:
Scipy/Numpy/Python version information:
Image of error and example problem image:
The text was updated successfully, but these errors were encountered: