python手势控制游戏_AirGesture - 无需触摸键盘利用手势来玩游戏

[PYTHON] AirGesture - Play games without touching keyboard

Introduction

Here is my python source code for AirGesture - Play games without touching keyboard. This project is an application of hand detection model in Tensorflow. With my code, you could play many games on PC without using any keyboard. At the moment you could play the following games

Super Mario Bros by running the script mario.py

Battle City by running the script battle_city.py

Dinosaur Game by running the script dinosaur.py

Please make sure that only one hand shown in front of camera. Otherwise scripts may not work as well as you expect

Super Mario Bros

The screen is splitted into 3 equal parts horizontally. Here is the mapping between your gesture and Mario's movement:

Open hand within the left part -> Left jump

Closed hand within the left part -> Left run

Open hand within the middle part -> Jump

Closed hand within the middle part -> Do nothing

Open hand within the right part -> Right jump

Closed hand within the right part -> Right run

Super Mario Bros

Battle City

The screen is splitted into 5 parts, including 4 triangles and a circle. Here is the mapping between your gesture and tank's movement:

Open hand -> Fire

Closed hand within the circle -> Do nothing

Closed hand within the left triangle -> Go left

Closed hand within the right triangle -> Go right

Closed hand within the up triangle -> Go up

Closed hand within the left triangle -> Go down

Battle City

Dinosaur Game

The screen is splitted into 2 equal parts vertically. Here is the mapping between your gesture and dinosaur's action:

Closed hand -> Run

Open hand within the upper part -> Jump

Open hand within the lower part -> Duck

Dinosaur

Requirements

python 3.x

cv2

tensorflow

numpy

gym

gym_super_mario_bros

gym_chrome_dino

pygame

opencv

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值