edge_detection.py 文件源码

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

项目:DAVIS-2016-Chanllege-Solution 作者: tangyuhao 项目源码 文件源码
def get_edges(img_path):
    '''
    input: the image path
    output: a numpy ndarray of the edges in this image 
    '''

    img = cv2.imread(img_path)
    RGB_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
    gray_image = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

    # kernel = np.ones((5,5),np.float32)/25
    # dst = cv2.filter2D(img,-1,kernel)


    edges = cv2.Canny(gray_image,100,200)
    return edges
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号