尝试在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()
中的数组?在
为什么不使用scikit image中的图像阅读器? 或者,只需使用黑白版本来运行算法。 要做到这一点,只需将参数“as_grey”传递给imread(我正在使用scikit image):
此参考资料可帮助您:
http://scikit-image.org/docs/dev/api/skimage.io.html#imread
相关问题 更多 >
编程相关推荐