将识别改为旋转后数据识别
修改了指关节识别
This commit is contained in:
parent
76fe23b4f2
commit
cc18db847b
7
demo.py
7
demo.py
@ -204,9 +204,14 @@ class HandDetector:
|
|||||||
else:
|
else:
|
||||||
knuckles.append(0)
|
knuckles.append(0)
|
||||||
# 12 knuckles
|
# 12 knuckles
|
||||||
|
distan = 0.22
|
||||||
for i in range(1, 5):
|
for i in range(1, 5):
|
||||||
for j in range(4):
|
for j in range(4):
|
||||||
if self.lmList[self.tipIds[i]-j][1] < self.lmList[self.tipIds[i]-j - 1][1]:
|
xx = self.lmList[self.tipIds[i]-j][1]
|
||||||
|
yy = self.lmList[self.tipIds[i]-j - 1][1]
|
||||||
|
if -distan < xx - yy < distan:
|
||||||
|
knuckles.append(2)
|
||||||
|
elif xx < yy:
|
||||||
knuckles.append(1)
|
knuckles.append(1)
|
||||||
else:
|
else:
|
||||||
knuckles.append(0)
|
knuckles.append(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user