错误:图像尺寸和邻域尺寸不匹配

Error: Image dimensions and neighborhood dimensions do not match

提问人:Made 提问时间:9/28/2023 更新时间:9/28/2023 访问量:35

问:

当我尝试编译以下代码时,我遇到了下面的错误,但我不明白我应该怎么做。你有什么想法吗?

错误:

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

法典

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)
Python

评论


答: 暂无答案