alignment.py 文件源码

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

项目:car-detection 作者: mmetcalfe 项目源码 文件源码
def get_gradient(im):
    # Calculate the x and y gradients using Sobel operator
    grad_x = cv2.Sobel(im,cv2.CV_32F,1,0,ksize=3)
    grad_y = cv2.Sobel(im,cv2.CV_32F,0,1,ksize=3)

    # Combine the two gradients
    grad = cv2.addWeighted(np.absolute(grad_x), 0.5, np.absolute(grad_y), 0.5, 0)
    # print grad.dtype
    # print grad.shape
    return grad

# Based on: http://www.learnopencv.com/image-alignment-ecc-in-opencv-c-python/
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号