From 78ade849df46352a19fd664782320520acd97c85 Mon Sep 17 00:00:00 2001 From: Dinger <2542905616@qq.com> Date: Sat, 14 May 2022 14:29:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E7=BB=88=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __pycache__/detect.cpython-37.pyc | Bin 10908 -> 0 bytes __pycache__/identify.cpython-37.pyc | Bin 11514 -> 0 bytes __pycache__/identify.cpython-38.pyc | Bin 7506 -> 0 bytes __pycache__/util.cpython-37.pyc | Bin 1361 -> 0 bytes __pycache__/util.cpython-38.pyc | Bin 1142 -> 0 bytes control.py | 0 detect.py | 9 +- identify.py | 189 ++++++++++++++++------------ main.py | 122 +++++++++--------- test.py | 25 ++-- 10 files changed, 181 insertions(+), 164 deletions(-) delete mode 100644 __pycache__/detect.cpython-37.pyc delete mode 100644 __pycache__/identify.cpython-37.pyc delete mode 100644 __pycache__/identify.cpython-38.pyc delete mode 100644 __pycache__/util.cpython-37.pyc delete mode 100644 __pycache__/util.cpython-38.pyc delete mode 100644 control.py diff --git a/__pycache__/detect.cpython-37.pyc b/__pycache__/detect.cpython-37.pyc deleted file mode 100644 index d5e516fd3f3af3f58baa5d01638d9aa420714621..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10908 zcmb7KON<-IdG6|Nb~m5%)QIy~ZCjSK;#wN7#_P2$%UZ1@%U(y~8q%y4wx z+2m9=H4iiaC$qML1Oq5YfWWcW;cOoE9%AH>O8_GWpOYZ)vEf7FBsS)jAUQ1pINx7Q z_B_0cz$Ci5x~lrGzv_Sg)i?9`jDp|eU%c|XQky@o3u-FE%;pxb-2*%j-L z+OF?+y+;jE<^5{V?0S`+=(gNiaHQ$-xQV*~dX{_J?`N*Hn|@I1c6!$*2{W4BP<9rp zeL$}AG?s`tGSWZ^a3=o^@#Nju@wdYMdk=ho>4bsNyf9;wr=uj>aUgx zQOfW4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}CPVUJ}EA*byD#$av3DhPz z#k!fj)F8#Pl#JrJP;X5E1K>7~4;DTJ(Z$iQx%IcfG(O;9I0O12;sp!YWMw#WbS%Vc zycT%vG6rL9Fcmhe`esb5zp#vJ5u3MEAnf={)SQ~^|rl>yaa zWuQOO2YJfg4kkkr{&hai&Ni?^OnJsO&OTH&ehR-=LyVx}#0tB>3%e>*#P_J)nr|(5 zhO8|NruYP(d|L^pq)M9JDkqrTJj4un-?=ci3#$O%dJ1{(>F?_AXoDHRSVRt(g)`yw zcm%!&nAuB7JbnxuOo;w0orrxF%n=JdWqxDzPj;6$SW*6^dqc|D9gL*2Z-}rwrrbk4 zQg)2WOVUC8s^9cP_eRMQdRsWbBxnuA3DeT%-+$K zSL$$U{+e*6trtI{l`M%K)#*@J5(l}^IN5P* zPtoIfBK!)VD5;`$fo0TbxYu-YnbD@TqNYQU>TsB^t8?sSxE=-^kOJC@?CjJ|?kJ<+ z%Mm&Q5FbZT7B5lt3JN;2WP&&z8MUua>q8W)cUH%3hcDf^BRNxkD^)I!%-EefrHK=t zjl^Gz(7|hb8u&S?^{AjgN=9cf)yP4M$wXT(enQ3JCL9XDWpsQ3mrs;~4>0;?a+x_~ zOihJlY^!LcsXg;m%gjt<@`BzWOlRW!?eF8!v1E9+?0NDSJ5mu*ego||DJPzj%qhN% z1}T<~i9?`eT++D8@7=^{>dd2XGWX>7Q+Meo{XD@ix=-i}Mmg^XEh4h6#V6_4VapVs TJd&7>RL1|DmNBO%W+(p-KlH79 diff --git a/__pycache__/identify.cpython-37.pyc b/__pycache__/identify.cpython-37.pyc deleted file mode 100644 index 8b2d2ed8a4b5face6652a9bffb6ae3f7bcd5fb85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11514 zcmc&)TWlLwdY%~$$st8i7t6MMi9^edV>*uGIJe!@n>exKByA$Qwi0Kj&JwiFNFq&< z(wUKUDYebUN!m^8Y`R$VA$^hZ(Az@_v<2Et3ls$wMS-?2`>-emeF(O768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%^)%nzbS_I=;rx1Utxx!LCyA@Kt90!dm?tqd59RQsJ)sF!ZsBDsKGO!G+ zl~Chzu;|fHItvi6m(%m-o3SCx5R*W;*Fxf`i^ zrQvHGg_WA}WZR2_C=@Lf-SMk&U+8Q%)Q0X%x7O1mYcL^Fq9lbm3mc^;@FqM@vyXu- zQ->D7a=I~wjh#NUtcve|f)<~{G&&ChY;>K#Gqc6cDe%oriZr#&amLGF2$JbwpoNZ= z7t~f_tU?u1^w(0A`VK;0W@5(KJ$V zSgI_5B2zY)ln+~3H?Q-_&%pHn7g(aCgr2`6@|KC0w zfu{~a(aWE}i(xwnJx50lXmDuSB5*n{MCdhrA<}{n%}BO^z#<(IVzuoxvWyyrjnoLj zQH0|N$nZWuI;d`Q&C$Td(Y%$nOtfgHR&}kE4m5okc&(u2r>xmBoiq8qoy^9DUHJ=H OJ+sJCjjS;YxBdWiG%Sq( diff --git a/__pycache__/util.cpython-38.pyc b/__pycache__/util.cpython-38.pyc deleted file mode 100644 index 635acec221332c0f1f62d9cda525a656f8718579..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1142 zcmZ8g&1(}u6rY)$-K1%YsRr8GOAj7g!9sHIAfkm9^b`;&>Jk{%%$lxAcGHy976-i1x=$A@;(EW#%aVU=+t=Zf1V1OLpyi}Z#lP7RK`eu+}?8T zqKMo(3D`#@#v%64n@g7)D>4wWu^dLNKs1&E*-qkKV?7q_MkkOmjv6iD z^S+;iaWvl(@q?h5JoP7l3rQ;HDa0xVu zH!Hfm3nvaX^-GLM>-telyNjUccDE5cHmMKKgKg?@v9isj#>!v<7S(ttnM{NqwpNoF za7Z&sc(ZIS&Mp2oV|tSVY%W~@MNd#RXW4Ykz^uW%z|_wo@Bn6>X_yxM2h>eV1%;!+ z0&t12K`1KMMB)<9>BV7`RR74@$*d<@LBe<_6F+JOb8v8!_LNCGzgl-4Rb(vky8&aW z#8@}xeP}dO6O66({Z6(bCUq)h4W~8eA;^J#D>15C>e8WMQ$@@8Tw7VqK~0Ty10MRl fuoo!O?U{nidM=I$YaYIMB}?S0Zr~^)E?U0 0.5: - print("identify is left") self.left_hand_flag = True self.is_identify = True @@ -317,7 +333,6 @@ class Identify: # self.mp_drawing.draw_landmarks( # self.image, self.identify_results.multi_hand_landmarks[i], self.mp_hands.HAND_CONNECTIONS) if self.identify_results.multi_handedness[i].classification[0].score > 0.5: - print("identify is right") self.right_hand_flag = True self.is_identify = True @@ -325,11 +340,8 @@ class Identify: if self.is_identify: if self.left_hand_flag: self.left_angle_list = hand_angle(hand_=self.left_hand_points) - # print("(((((((((((((((((((") for i in range(5): self.is_left_finger_straight[i] = util.Util.is_straight(self.left_angle_list[i]) - # print(self.is_left_finger_straight[i]) - # print(")))))))))))))))))))") if self.right_hand_flag: self.right_angle_list = hand_angle(hand_=self.right_hand_points) for i in range(5): @@ -339,9 +351,9 @@ class Identify: if self.left_hand_flag: self.position_x = self.left_hand_points[8][0] self.position_y = self.left_hand_points[8][1] - elif self.right_hand_flag: - self.position_x = self.right_hand_points[8][0] - self.position_y = self.right_hand_points[8][1] + # elif self.right_hand_flag: + # self.position_x = self.right_hand_points[8][0] + # self.position_y = self.right_hand_points[8][1] return is_finger_straight[1] and not is_finger_straight[2] and \ not is_finger_straight[3] and not is_finger_straight[4] @@ -394,22 +406,25 @@ class Identify: if self.step_up == 0: self.lase_time = time.time() if self.step_up == 0 and self.judge_step_three(): - self.step_up = 4 - if self.step_up == 4 and self.judge_step_one(False): self.step_up = 1 - elif self.step_up == 1 and self.judge_step_two(False): + if self.step_up == 1 and self.judge_step_one(False): + self.step_up = 2 + elif self.step_up == 2 and self.judge_step_two(False): self.step_up = 3 - elif self.step_up == 2 and judge_zero(self.is_right_finger_straight): - self.step_up = 3 - elif self.step_up == 3: + # elif self.step_up == 2 and judge_zero(self.is_right_finger_straight): + # self.step_up = 3 + # elif self.step_up == 3: + # self.step_up = 0 + now_time = time.time() + if now_time - self.lase_time > 3: + self.lase_time = now_time self.step_up = 0 - now_time = time.time() - if now_time - self.lase_time < 3: + return False + else: + if self.step_up == 3: self.lase_time = now_time + self.step_up = 0 return True - else: - self.lase_time = now_time - return False return False def judge_page_down(self): @@ -418,25 +433,24 @@ class Identify: if self.step_down == 0: self.lase_time = time.time() if self.step_down == 0 and self.judge_step_three(): - self.step_down = 4 - print("step = 1") - if self.step_down == 4 and self.judge_step_one(True): self.step_down = 1 - print("step = 2") - elif self.step_down == 1 and self.judge_step_two(True): + # print("step = 1") + if self.step_down == 1 and self.judge_step_one(True): + self.step_down = 2 + # print("step = 2") + elif self.step_down == 2 and self.judge_step_two(True): self.step_down = 3 - print("step = 3") - elif self.step_down == 2 and judge_zero(self.is_left_finger_straight): - self.step_down = 3 - elif self.step_down == 3: + # print("step = 3") + now_time = time.time() + if now_time - self.lase_time > 3: + self.lase_time = now_time self.step_down = 0 - now_time = time.time() - if now_time - self.lase_time < 3: + return False + else: + if self.step_down == 3: self.lase_time = now_time + self.step_down = 0 return True - else: - self.lase_time = now_time - return False return False def judge_end(self): @@ -444,36 +458,47 @@ class Identify: return True return False + def judge_system_over(self): + if not self.judge_one(self.is_left_finger_straight): + return False + if not self.judge_one(self.is_right_finger_straight): + return False + standard_distance = util.Util.get_distance(self.left_hand_points[7], self.right_hand_points[8]) + # print(util.Util.get_distance(self.left_hand_points[8], self.right_hand_points[8]) / standard_distance) + if util.Util.get_distance(self.left_hand_points[8], self.right_hand_points[8]) / standard_distance < 1: + return True + return False + def judge_control(self): - # print("left_flag = " + str(self.left_hand_flag)) - # print("right_flag = " + str(self.right_hand_flag)) - # print("1111111111111111111111") - # for i in range(5): - # print(self.is_left_finger_straight[i]) - # print("2222222222222222222222") if self.is_identify: + # print("len = " + str(len(self.identify_results.multi_handedness))) + # print("left is " + str(self.left_hand_flag)) + # print("right is " + str(self.right_hand_flag)) if judge_two(self.is_left_finger_straight): - print("1") + # print("1") return 1 elif self.judge_page_up(): - print("2") + # print("2") return 2 elif self.judge_page_down(): - print("3") - # print("down!down!down!down!down!down!down!down!down!down!down!down!down!down!down!down!down!down!") + # print("3") return 3 - elif self.judge_one(self.is_left_finger_straight): - print("4") + elif self.judge_one(self.is_left_finger_straight) and not self.right_hand_flag: + # print("4") return 4 - elif self.left_hand_flag and judge_zero(self.is_left_finger_straight): - print("5") - # for i in range(5): - # print(self.is_left_finger_straight[i]) + elif self.judge_one(self.is_left_finger_straight) and judge_zero(self.is_right_finger_straight): + # print("5") return 5 - else: - print("other") - else: - print("no_hand_points") + elif self.left_hand_flag and judge_zero(self.is_left_finger_straight): + # print("6") + return 6 + elif self.judge_system_over(): + # print("7") + return 7 + # else: + # # print("other") + # else: + # print("no_hand_points") return 0 # diff --git a/main.py b/main.py index 80feaa5..5a88a55 100644 --- a/main.py +++ b/main.py @@ -1,27 +1,15 @@ import multiprocessing +import sys import tkinter from identify import * from tkinter.filedialog import * +from tkinter import messagebox from win32com.client import Dispatch import win32con import win32api import time import os -control_flag = 0 -x = 0 -y = 0 - - -def show(): - win32api.keybd_event(116, 0, 0, 0) # 代表按下f键 - time.sleep(0.02) - win32api.keybd_event(116, 0, win32con.KEYEVENTF_KEYUP, 0) # 释放f键 - time.sleep(2) - win32api.keybd_event(34, 0, 0, 0) # 代表按下f键 - time.sleep(0.02) - win32api.keybd_event(34, 0, win32con.KEYEVENTF_KEYUP, 0) # 释放f键 - def control_page_up(): win32api.keybd_event(38, 0, 0, 0) # 代表按下f键 @@ -61,39 +49,29 @@ def control_writing(m, position_x, position_y): m.move(position_x, position_y) -def control_draw(): - global x, y - - # m = pymouse.PyMouse() - # m.move(x, y) - # win32api.keybd_event(40, 0, 0, 0) # 代表按下f键 - # time.sleep(0.02) - # win32api.keybd_event(40, 0, win32con.KEYEVENTF_KEYUP, 0) # 释放f键 - - # class Control: - # def __init__(self, control_flag): - # self.control_flag = control_flag - # - - -def control_thread(value, array): +def control_thread(control_number, array, over_flag): last_time = 0.0 step = 0 mouse = PyMouse() - + test_time1 = time.time() + count = 0 while 1: + count += 1 # print("step = " + str(step)) # print("control_thread") now_time = time.time() - # time.sleep(0.1) - # print(end - start) - # print("***********array************") - # print(array) - # print("***********array************") - control_flag = value.value + control_flag = control_number.value + # os._exit(0) + if control_flag == 7: + # test_time2 = time.time() + # fps = count / (test_time2 - test_time1) + # print("count2 = " + str(count)) + # print("time = " + str(test_time2 - test_time1)) + # print("fps_control = " + str(fps)) + over_flag.value = 1 + sys.exit(0) if step == 2: if control_flag == 4: - # print("inininininininininininininininininininininininin") position_x = int(mouse.screen_size()[0] / array[2] * array[0]) position_y = int(mouse.screen_size()[1] / array[3] * array[1]) control_writing(mouse, position_x, position_y) @@ -101,22 +79,16 @@ def control_thread(value, array): step = 1 control_ppt_end() last_time = now_time - # print("step to 11111111111111111") continue if now_time - last_time < 1: continue last_time = now_time - # if control_flag in range(1, 2, 3, 4, 5): - # time.sleep(2) - # elif control_flag == 6: - # time.sleep(0.05) - # start = time.time() - print("control_flag = " + str(control_flag)) - # print("main.step = " + str(step)) - if step == 0 and control_flag == 1: - control_ppt_begin() - # print("control_flag == 1") - step = 1 + # print("control_flag2 = " + str(control_flag)) + # # print("main.step = " + str(step)) + if step == 0: + if control_flag == 1: + control_ppt_begin() + step = 1 elif step == 1: if control_flag == 2: control_page_up() @@ -127,38 +99,37 @@ def control_thread(value, array): elif control_flag == 4: control_open_pencil() step = 2 - elif control_flag == 5: + elif control_flag == 6: control_ppt_end() - # print("end!end!end!end!end!end!end!end!end!end!end!") - # print("control_flag == 4") step = 0 + # if control_flag == 5: # control_open_pencil() # if control_flag == 6: # control_draw() -def identify_thread(value, array): - identify = Identify(value, array) - identify.begin() - - -def show_thread(value, array): - return 0 +def identify_thread(control_number, array, over_flag): + identify = Identify(control_number, array) + identify.begin(over_flag) def open_file(): file_path = askopenfilename(title=u'选择文件') # file_path = askopenfilename(title=u'选择文件', initialdir=(os.path.expanduser('H:/'))) - open_ppt(file_path) - value = multiprocessing.Value('i', 0) + if not open_ppt(file_path): + return False + control_number = multiprocessing.Value('i', 0) array = multiprocessing.Array('i', 4) + over_flag = multiprocessing.Value('i', 0) # array2 = multiprocessing.Array() - p1 = multiprocessing.Process(target=identify_thread, args=(value, array)) - p2 = multiprocessing.Process(target=control_thread, args=(value, array)) + p1 = multiprocessing.Process(target=identify_thread, args=(control_number, array, over_flag)) + p2 = multiprocessing.Process(target=control_thread, args=(control_number, array, over_flag)) # p3 = multiprocessing.Process(target=show_thread, args=(value, array)) p1.start() + # p1.terminate() p2.start() + return True # p3.start() # identify_t = threading.Thread(target=identify_thread) # print("control_flag1 = " + str(control_flag)) @@ -170,11 +141,32 @@ def open_file(): # control_t.start() +def judge_ppt(file_path): + string = file_path + string = string.split('.') + if len(string) <= 0: + return False + string = string[len(string) - 1] + if string.find('ppt') != -1: + return True + return False + + def open_ppt(file_path): + if not len(file_path): + messagebox.showinfo("选择失败", "您尚未选择ppt文件,请重新选择") + return False + if not judge_ppt(file_path): + messagebox.showinfo("选择失败", "该文件非ppt文件,请重新选择") + return False ppt = Dispatch('PowerPoint.Application') ppt.Visible = 1 # 后台运行 ppt.DisplayAlerts = 0 # 不显示,不警告 ppt.Presentations.Open(file_path) + return True + + +# def make_button(window): if __name__ == '__main__': @@ -183,4 +175,6 @@ if __name__ == '__main__': window.geometry("200x100") bt1 = tkinter.Button(window, text='打开文件', width=15, height=15, command=open_file) bt1.pack() + # show_text = tkinter.Text(window, height=2) + # show_text.pack() window.mainloop() diff --git a/test.py b/test.py index ba733b1..1501c03 100644 --- a/test.py +++ b/test.py @@ -46,9 +46,6 @@ def video_speed(video_root, out_root, fps=None, scale=1): # yolov5 = detect.YOLOV5() # blank_image = np.zeros((1000, 1000, 3), np.uint8) # blank_image.fill(255) - fourcc = cv2.VideoWriter_fourcc(*'XVID') - videoWriter = cv2.VideoWriter('output.avi', fourcc, 60.0, (1280, 720)) - count = 100 while True: ret, frame = cap.read() # blank_image = frame.copy() @@ -58,9 +55,9 @@ def video_speed(video_root, out_root, fps=None, scale=1): # print("") frame = cv2.flip(frame, 1) - frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) + frame_rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) # frame = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR) - results = hands.process(frame) + results = hands.process(frame_rgb) # results = poses.process(image) # print("*********************************") # if results.pose_landmarks: @@ -74,19 +71,19 @@ def video_speed(video_root, out_root, fps=None, scale=1): # if results. # print(results.multi_hand_landmarks) if results.multi_handedness: - if results.multi_handedness[0].classification[0].label == "Left": - for hand_landmarks in results.multi_hand_landmarks: - # 关键点可视化 - mp_drawing.draw_landmarks( - frame, hand_landmarks, mp_hands.HAND_CONNECTIONS) - # if results.multi_handedness[0].classification[0].label == "Right": - # print(results.multi_handedness[0].classification[0]) + # if results.multi_handedness[0].classification[0].label == "Left": + for hand_landmarks in results.multi_hand_landmarks: + # 关键点可视化 + mp_drawing.draw_landmarks( + frame, hand_landmarks, mp_hands.HAND_CONNECTIONS) + # if results.multi_handedness[0].classification[0].label == "Right": + # print(results.multi_handedness[0].classification[0]) cv2.imshow('MediaPipe Hands', frame) # cv2.imshow('black_image', blank_image) # videoWriter.write(blank_image) # count = count - 1 - # cv2.imwrite("picture3.jpg", frame) - if cv2.waitKey(1) & 0xFF == 27: + cv2.imwrite("picture3.jpg", frame) + if cv2.waitKey(3000) & 0xFF == 27: break cap.release() # videoWriter.release()