我有以下代码:
import cv2
import numpy as np
from PIL import Image
import skimage
my_image = cv2.imread('my_image.jpeg', 1)
gray = cv2.cvtColor(my_image, cv2.COLOR_BGR2GRAY)
b = skimage.filters.threshold_local(gray,19,offset=10)
b = Image.fromarray(b)
b = b.convert("L")
b.save('adaptive_output.png')
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
b = skimage.filters.threshold_local(gray,19,offset=10)
AttributeError: module 'skimage' has no attribute 'filters'
Run Code Online (Sandbox Code Playgroud)
我使用的是 Python 3.8,系统上的 scikit-image 版本是 0.18.1。我还在不同的 IDE 中尝试了代码,但到处都收到错误。我还检查了问题1、问题2和问题3,但他们的答案都不起作用。
| 归档时间: |
|
| 查看次数: |
6478 次 |
| 最近记录: |