手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

Python对图片垂直方向边缘检测(scharr算子)

时间:2024-10-14 00:55:41

1、需要winPython中包含有sk坡纠课柩image和matplotlib库;打开Python shell 也就IDLE载入枷讹般身相关的工具箱:from skimage import io,data,filters,colorimport matplotlib.pyplot as plt

Python对图片垂直方向边缘检测(scharr算子)

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

Python对图片垂直方向边缘检测(scharr算子)

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

Python对图片垂直方向边缘检测(scharr算子)

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

Python对图片垂直方向边缘检测(scharr算子)

5、我们的结果如下图。

Python对图片垂直方向边缘检测(scharr算子)
© 手抄报圈