spfunctions.py 文件源码

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

项目:spfeas 作者: jgrss 项目源码 文件源码
def get_mag_ang(img):

    """
    Gets image gradient (magnitude) and orientation (angle)

    Args:
        img

    Returns:
        Gradient, orientation
    """

    img = np.sqrt(img)

    gx = cv2.Sobel(np.float32(img), cv2.CV_32F, 1, 0)
    gy = cv2.Sobel(np.float32(img), cv2.CV_32F, 0, 1)

    mag, ang = cv2.cartToPolar(gx, gy)

    return mag, ang, gx, gy
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号