Python对图片垂直方向边缘检测(scharr算子)
1、需要winPython中包含有skimage和matplotlib库;
打开Python shell 也就IDLE
载入五霸级相关的工具箱:
from skimage import io,data,filters,color
import matplotlib.pyplot as plt

2、读入我们的图片,并将其海暗灰度化处理:
img=color.rgb2gray(data.coffee())

3、采用下面指令获得垂牺驼直的纹理:
edge=filters.scharr_v(img)

4、查看我们的结果图片:
plt.imshow(edge,plt.cm.gray)
plt.show()

5、我们的结果如下图。

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:24
阅读量:78
阅读量:175
阅读量:87
阅读量:45