Error: Image dimensions and neighborhood dimensions do not match

68 Views Asked by At

When I tried to compile the following code, I encountered the error below, but I didn't understand what I should do. Do you have any idea, please?

Error:

Traceback (most recent call last):
  File "<tmp 1>", line 8, in <module>
    entimg=entropy(img,disk(10))
  File "c:\users\pro\anaconda3\Lib\site-packages\skimage\filters\rank\generic.py", line 1284, in entropy
    return _apply_scalar_per_pixel_3D(generic_cy._entropy_3D, image,
  File "c:\users\pro\anaconda3\Lib\site-packages\skimage\filters\rank\generic.py", line 282, in _apply_scalar_per_pixel_3D
    image, footprint, out, mask, n_bins = _handle_input_3D(
  File "c:\users\pro\anaconda3\Lib\site-packages\skimage\filters\rank\generic.py", line 204, in _handle_input_3D
    raise ValueError('Image dimensions and neighborhood dimensions'
ValueError: Image dimensions and neighborhood dimensionsdo not match

Code

from skimage.filters.rank import entropy
from skimage.morphology import disk
from skimage import io
import matplotlib.pyplot as plt
import numpy as np
img = io.imread("image.jpg")
entimg=entropy(img,disk(10))
plt.imshow(entimg)
0

There are 0 best solutions below