candy边缘检测

from imutils import *
image = imread('image/school.jpg')
show(image)

def edge_detection(image,minVal=100,maxVal=200):
    image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
    edges = cv2.Canny(image,minVal,maxVal)

    plt.imshow(edges,'gray')
    plt.axis('off')
    plt.show()

edge_detection(image)

 

posted @ 2020-08-30 09:22  yunshangyue  阅读(289)  评论(0编辑  收藏  举报