Python`过滤器.sobel()`inpu

2024-05-19 01:13:09 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试在Python中使用filter.sobel()函数。在

from PIL import Image
from skimage import data, io, filter
#...

image = Image.open('ME.jpg')
#right below is what it would normally be. I tried to substitute the code above for this
#image = data.coins()
edges = filter.sobel(image)
io.imshow(image)
io.show()
io.imshow(edges)
io.show()

开/关:

^{pr2}$

如何将图像转换为data.coins()中的数组?在


Tags: 函数fromioimageimportdatapilshow
1条回答
网友
1楼 · 发布于 2024-05-19 01:13:09

为什么不使用scikit image中的图像阅读器? 或者,只需使用黑白版本来运行算法。 要做到这一点,只需将参数“as_grey”传递给imread(我正在使用scikit image):

image = skimage.io.imread(image_path,as_grey=True)

此参考资料可帮助您:

http://scikit-image.org/docs/dev/api/skimage.io.html#imread

相关问题 更多 >

    热门问题