当前位置: 首页 > news >正文

西安建设局官方网站广东seo推广方案

西安建设局官方网站,广东seo推广方案,动漫制作专业毕业论文,广告设计公司深圳策划设计公司演示效果 需要安装的第三方库: pip install pygame # 加载音乐 pip install pillow # 加载图片 pip install mediapipe # 判断手势的模型 pip install opencv # 模型要用来处理图形 建议有独显和摄像头的可以尝试! 想着升级一下玩法,只有真敲…

演示效果

需要安装的第三方库:
pip install pygame # 加载音乐
pip install pillow # 加载图片
pip install mediapipe # 判断手势的模型
pip install opencv # 模型要用来处理图形

建议有独显和摄像头的可以尝试!

想着升级一下玩法,只有真敲才能真积徳!于是找了个能判断手势的模型。

源码(开启摄像头后按Q退出)

import time
import tkinter
from tkinter import messagebox
import threading
import pygame # pip install pygame
from PIL import Image, ImageTk # pip install pillowclass window(tkinter.Tk):def __init__(self):super().__init__()# 初始化功德self.gongde=0# 准备音频self.pygame=pygameself.pygame.mixer.init()self.pygame.mixer.music.load('敲.mp3')# 准备图片self.qiaomuyutupian=ImageTk.PhotoImage(file='敲木鱼.jpg') # 转化为tkinter可以使用的图片self.qiaomuyutupian2=ImageTk.PhotoImage(file='敲木鱼2.jpg') # 转化为tkinter可以使用的图片# 启动界面self.base_top()def base_top(self):self.title('敲木鱼加功德')self.geometry('410x400')self.configure(bg='black')# 标签self.label1=tkinter.Label(self,text='积攒功德:'+str(self.gongde),font=('华文新魏',15),fg='white',bg='black',width=18)self.label1.place(x=100,y=70)# 按钮self.button1=tkinter.Button(self,image=self.qiaomuyutupian,relief='ridge',command=self.qiaomuyu)self.button1.place(x=100,y=100)# 按钮self.button2=tkinter.Button(self,text='互动',width=10,command=self.thread_hudong)self.button2.place(x=160,y=315)# 消息self.text1=tkinter.Text(self,width=10,height=5,bg='black',bd=0,foreground='white')self.text1.place(x=125,y=115)def showplus(self):# 文字浮动for i in range(4):self.text1.insert('insert',' \n')else:self.text1.insert('insert',' 功德 + 1')for i in range(5):time.sleep(0.04)self.text1.delete(1.0, 2.0)# 功德+1self.gongde=self.gongde+1self.label1.config(text='积攒功德:'+str(self.gongde))def changetupian(self):self.button1.config(image=self.qiaomuyutupian2)time.sleep(0.1)self.button1.config(image=self.qiaomuyutupian)def qiaomuyu(self):# 多线程启动解决延时,虽然延迟足够小,但为了更有效果th=threading.Thread(target=self.pygame.mixer.music.play)th.start()th2=threading.Thread(target=self.showplus)th2.start()th3=threading.Thread(target=self.changetupian)th3.start()def thread_hudong(self):th4=threading.Thread(target=self.hudong)th4.start()self.frame=tkinter.Frame(self,width=200,height=40,bg='white')self.frame.place(x=103,y=350)self.label2=tkinter.Label(self.frame,text='正在摄像头中,请稍等...',bg='white')self.label2.place(x=33,y=10)def hudong(self):import cv2import mediapipe as mpmp_hands = mp.solutions.handshands = mp_hands.Hands()mp_drawing = mp.solutions.drawing_utils# coding:utf-8`cap = cv2.VideoCapture(0)  # 打开摄像头mark_one=0while True:self.frame.destroy()ret, frame = cap.read()  # 读取视频帧if not ret:breakimage = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)  # 转换颜色空间results = hands.process(image)  # 手势识别# 处理识别结果if results.multi_hand_landmarks:for hand_landmarks in results.multi_hand_landmarks:mp_drawing.draw_landmarks(frame,hand_landmarks,mp_hands.HAND_CONNECTIONS) # 用于指定地标如何在图中连接。for point in hand_landmarks.landmark:x = int(point.x * frame.shape[1])y = int(point.y * frame.shape[0])if y < 200:mark_one=1if y > 400:if 1 - mark_one == 0:self.qiaomuyu()mark_one=0cv2.circle(frame, (x, y), 5, (0, 255, 0), -1) # 画出关键点cv2.imshow('Gesture Recognition', frame)  # 显示结果if cv2.waitKey(1) & 0xFF == ord('q'):breakcap.release()cv2.destroyAllWindows()if __name__ == '__main__':top=window()top.mainloop()

http://www.hkea.cn/news/485685/

相关文章:

  • ysl网站设计论文郑州seo地址
  • 做食品的网站设计要注意片多多可以免费看电视剧吗
  • 网站排名推广自己怎么做长沙seo代理商
  • 手机网站改版公司加盟关键词优化排名查询
  • html5 图片网站建设企业网站多少钱
  • 企业网站定制开发流程网络营销的概念及特点
  • 做火影网站背景图农村电商平台有哪些
  • 国内html5网站建设seo兼职工资一般多少
  • 青海西宁网站建设公司百度网络推广
  • 服装公司网站设计百度站长收录入口
  • 做搜索关键词任务网站网站维护是什么意思
  • 2018什么做网站百度网盘网页版入口
  • 深圳福田大型商城网站建设石家庄最新疫情最新消息
  • 网站版面结构chatgpt 网站
  • 网站后期推广是谁来做广州百度推广开户
  • 不上此网站枉做男人免费制作网站平台
  • 防红短链接生成佛山抖音seo
  • 网站建设php带数据库模板站长工具四叶草
  • 做网站客户拖着不验收店铺推广渠道有哪些方式
  • 站群系统哪个好用怎样进行seo推广
  • 淄博网站建设方案网络推广是做什么的
  • 网站建设销售工作职责seo平台怎么样
  • 免费的网站给一个百度seo优化服务项目
  • 现代广告创意设计郑州百度网站优化排名
  • 兰州网站建设哪家专业谷歌seo网站推广
  • 崇信门户网站留言回复上优化seo
  • 网站建设费用有哪些站长工具搜索
  • 云主机能干什么独立站seo怎么做
  • 苏州专业网站建设设计公司免费发布推广信息的b2b
  • 空间 两个网站网络推广培训班