import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('test.png',0)
edges = cv2.Canny(img,150,200)
plt.subplot(121),plt.imshow(img,cmap = 'gray')
plt.title('Original Image'), plt.xticks([]), plt.yticks([])
plt.subplot(122),plt.imshow(edges,cmap = 'gray')
plt.title('Edge Image'), plt.xticks([]), plt.yticks([])
plt.show()
opencv——canny算子提取图像边缘
最新推荐文章于 2024-06-23 01:34:07 发布