提交 1f3615af 编写于 作者: JOKER0810's avatar JOKER0810

Update mainFunction.py

上级 3804bbab
......@@ -109,6 +109,12 @@ class MyWindow(QMainWindow,LogIn.Ui_LogIn):
frame, hand_list = index_thumb_pt(frame, results)
if hand_list['click']:
draw_character(self.gesture_lines, self.img_black) #在黑底图片上将文字的各个点连起来,实现写字的功能
if len(self.gesture_lines)>1 and p_to_p_distance(self.gesture_lines[-1],hand_list["pt"]) < 30:
hand_list["pt"] = list(hand_list["pt"])
hand_list["pt"][0] = int(self.gesture_lines[-1][0] + (hand_list["pt"][0] - self.gesture_lines[-1][0]) / 2) # 平滑写字的移动
hand_list["pt"][1] = int(self.gesture_lines[-1][1] + (hand_list["pt"][1] - self.gesture_lines[-1][1]) / 2)
hand_list["pt"] = tuple(hand_list["pt"])
self.gesture_lines.append(hand_list["pt"])
img_gray = cv2.cvtColor(self.img_black, cv2.COLOR_BGR2GRAY)
......@@ -168,4 +174,4 @@ if __name__ == "__main__":
MainWindow.center()
MainWindow.add_shadow()
MainWindow.show()
sys.exit(app.exec_())
\ No newline at end of file
sys.exit(app.exec_())
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册