surf.detectAndCompute()提取keypoint中关键点坐标

该博客介绍了`keypointToPoint`函数的实现,该函数将`surf.detectAndCompute()`返回的关键点信息转换为二维浮点数数组。每个关键点的位置通过.pt属性获取,并按顺序存储在新数组中,最后reshape为(-1, 2)的形状。这个函数在计算机视觉处理中用于处理关键点坐标数据。
摘要由CSDN通过智能技术生成
def keypointToPoint(keypoint):
    point = np.zeros(len(keypoint) * 2, np.float32)
    for i in range(len(keypoint)):
        point[i * 2] = keypoint[i].pt[0]
        point[i * 2 + 1] = keypoint[i].pt[1]
    point = point.reshape(-1, 2)
    return point

参数说明:

        keypoint为surf.detectAndCompute()函数的返回值,其中包含关键点位置信息

运行结果:

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值