BoundaryExtraction.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:SummerProject_MacularDegenerationDetection 作者: WDongYuan 项目源码 文件源码
def EdgeDetection(img):
    img = cv2.fastNlMeansDenoising(img,None,3,7,21)
    _,img = cv2.threshold(img,30,255,cv2.THRESH_TOZERO)
    denoise_img = img
    laplacian = cv2.Laplacian(img,cv2.CV_64F)
    sobelx = cv2.Sobel(img,cv2.CV_64F,1,0,ksize=5)  # x
    sobely = cv2.Sobel(img,cv2.CV_64F,0,1,ksize=3)  # y
    canny = cv2.Canny(img,100,200)
    contour_image, contours, hierarchy = cv2.findContours(img, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

    return {"denoise":denoise_img,"laplacian":laplacian,"canny":canny,"sobely":sobely,"sobelx":sobelx,"contour":contour_image}

# GrayScale Image Convertor
# https://extr3metech.wordpress.com
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号