如何进行手势识别系列-3:手掌张开识别

手掌张开

特征:

  • 手指关节点远离手掌根部,手指之间的距离较大。

算法:

  1. 计算每根手指(包括拇指)的指尖(T4、I4、M4、R4、P4)与手腕(Wrist)之间的距离。
  2. 如果所有这些距离都大于一个阈值,则判断为手掌张开。

def is_open_hand(hand_landmarks, wrist_idx=0, threshold=100):
    wrist = hand_landmarks[wrist_idx]
    is_open = True
    for i in [4, 8, 12, 16, 20]:  # Thumb, Index, Middle, Ring, Pinky finger tips
        fingertip = hand_landmarks[i]
        distance = np.linalg.norm(np.array(fingertip) - np.array(wrist))
        if distance < threshold:
            is_open = False
            break
    return is_open

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值