canny简单易用
#已设置忽略 PEP8.E265 #canny边缘检测 import cv2 import numpy as np img = cv2.imread("../images/test1.jpeg", 0) cv2.imwrite("canny.jpg", cv2.Canny(img, 200, 300)) cv2.imshow("canny", cv2.imread("canny.jpg")) cv2.waitKey() cv2.destroyAllWindows()
原图
运行结果