From 3e7e43e06da4c25165f041c11b32a912e61ed91e Mon Sep 17 00:00:00 2001 From: Lounes Kouache Date: Sun, 12 Feb 2023 12:53:33 +0100 Subject: [PATCH] =?UTF-8?q?amelioration=20du=20code=20la=20prochaine=20?= =?UTF-8?q?=C3=A9tape=20est=20de=20rajouter=20des=20jauges=20d'acceptation?= =?UTF-8?q?=20pour=20un=20resultat=20plus=20precis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/Interface_Lounes/reconnaissancePouce.py | 23 +++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/code/Interface_Lounes/reconnaissancePouce.py b/code/Interface_Lounes/reconnaissancePouce.py index 60cdcfc..80d3894 100644 --- a/code/Interface_Lounes/reconnaissancePouce.py +++ b/code/Interface_Lounes/reconnaissancePouce.py @@ -15,20 +15,17 @@ def reconnaissancePouce(handLandmarks): for cpt in range (0,4): V1=[handLandmarks[(4*cpt)+6][0]-handLandmarks[(4*cpt)+5][0],handLandmarks[(4*cpt)+6][1]-handLandmarks[(4*cpt)+5][1]] V2=[handLandmarks[(4*cpt)+8][0]-handLandmarks[(4*cpt)+6][0],handLandmarks[(4*cpt)+8][1]-handLandmarks[(4*cpt)+6][1]] - j=j+np.dot(V1,V2) + j=np.dot(V1,V2) + if (j>0): + return etatDuPouce[0] + V1=[handLandmarks[4][0]-handLandmarks[1][0],handLandmarks[4][1]-handLandmarks[1][1]] + V2=[handLandmarks[2][0]-handLandmarks[1][0],handLandmarks[2][1]-handLandmarks[1][1]] + if((np.dot(V1,V2))>0 and (handLandmarks[4][1]>handLandmarks[2][1])): + i=1 + elif(np.dot(V1,V2)>0 and handLandmarks[4][1]