-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Denoise throws ValueError #3449
Copy link
Copy link
Labels
⚠️ PriorityThis issue or PR should be given priorityThis issue or PR should be given priority
Milestone
Description
Description
_denoise_cy.pyx throws a ValueError saying a double was expected but a float was received.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/aether/programs/anaconda3/envs/cellprofiler/lib/python2.7/site-packages/skimage/restoration/_denoise.py", line 117, in denoise_bilateral
bins, mode, cval)
File "skimage/restoration/_denoise_cy.pyx", line 114, in skimage.restoration._denoise_cy._denoise_bilateral
ValueError: Buffer dtype mismatch, expected 'double' but got 'float'
Way to reproduce
- Code example
import numpy as np
import skimage.restoration
sigma = 16.0
sigma_range = .2
np.random.seed(0)
image = np.random.uniform(size=(100, 100)).astype(np.float32)
mask = np.ones(image.shape, bool)
mask[40:60, 45:65] = False
expected = skimage.restoration.denoise_bilateral(
image=image,
multichannel=False,
sigma_color=sigma_range,
sigma_spatial=sigma,
)
- Relevant images (if any)
- Operating system and version: Ubuntu 16.04
- Python version
>>> print(sys.version)
2.7.14 |Anaconda, Inc.| (default, Dec 7 2017, 17:05:42)
[GCC 7.2.0]
- scikit-image version (run
skimage.__version__)
>>> skimage.__version__
'0.14.1'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
⚠️ PriorityThis issue or PR should be given priorityThis issue or PR should be given priority