GNU General Public License v3.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

项目背景与痛点

“Viral-Doshi/Gesture-Controlled-Virtual-Mouse” 项目致力于通过手势和语音控制计算机,利用 MediaPipe 和 OpenCV Python 库,为用户提供一种更为直观且自然的交互方式。这项技术尤其在那些受限于传统鼠标操作的场景下,如娱乐多媒体、虚拟现实以及辅助技术等领域展现出巨大的潜力。传统输入设备的限制变得显而易见,尤其是在需要精细控制和长时间操作的情况中。因此,该项目旨在突破这些局限,提供一种更为灵活和人性化的交互方案。

技术核心揭秘

该项目的核心在于利用 MediaPipe 库处理复杂的计算机视觉任务,特别是手部关键点的检测与跟踪。通过 OpenCV,项目将摄像头采集的数据实时处理,解析出手势,并通过预设的模式匹配来触发相应的虚拟鼠标行为。以下展示了系统的架构图,描述了主要组件及其协同工作方式:

graph TD A[摄像头捕获] --> B[OpenCV 预处理] B --> C[MediaPipe 手势识别] C --> D{"手势匹配?"} D -->|"匹配成功"| E[触发对应行为] D -->|"匹配失败"| F{"语音指令?"} F -->|"有指令"| G[语音执行相应操作] F -->|"无指令"| H[保持待命状态]

整体系统可以分为几个关键步骤:

  1. 摄像头捕获:利用摄像头实时捕捉用户的手势。
  2. OpenCV 预处理:对捕获的数据进行预处理,如去噪、调整分辨率等,提高手部识别的准确性。
  3. MediaPipe 手势识别:使用 MediaPipe 库对手部关键点进行检测,基于这些关键点进行手势识别。
  4. 手势匹配:将检测到的手势与预定义的手势进行比对,触发相应的虚拟鼠标行为。
  5. 语音指令补充:对于手势无法直接执行的操作,可以通过语音指令来扩展系统的交互范围。

功能亮点与差异

在众多手势控制及语音控制技术中,此项目的一些独特之处值得特别指出:

  • 高质量的手势检测与识别:MediaPipe 库提供了强大的手势检测能力,确保手势识别的准确性。
  • 语音控制作为补充:不仅可以使用手势控制,还可以通过语音补充操作,适合更为复杂的交互逻辑。
  • 开源&易于扩展:作为开源项目,用户可以轻松地根据自己的需求进行修改和扩展,例如增加新的手势模式或支持显示不同的输出应用。

应用场景与落地建议

在实际生产环境中部署该项目时需注意以下几点:

  • 硬件限制:高质量的手势识别需要良好性能的摄像头和计算资源,确保实时数据处理能力。
  • 数据隐私:处理视频信息时应注意遵守相关数据保护法规,确保用户隐私。
  • 交互体验:针对不同用户群体,可能需要对系统的灵敏度进行调整,优化交互体验。

该技术特别适合应用于多媒体娱乐(如游戏、家庭影院)、虚拟现实头显交互以及辅助技术领域(例如,提升特定残疾人士的使用体验)。

综合评价

综上所述,“Viral-Doshi/Gesture-Controlled-Virtual-Mouse” 项目基于先进的计算机视觉技术,为用户提供了一种创新且自然的计算机交互方式。它展现了手势识别和语音命令的协同工作能力,提供了个性化定制的可能。然而,受限于硬件资源和隐私政策,部署时需谨慎考虑。总体而言,这是一个兼具技术前瞻性和实际应用价值的优秀项目。

关于

GitHub 原始描述(英文)

Virtually controlling computer using hand-gestures and voice commands. Using MediaPipe, OpenCV Python.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

CSS
HTML
JavaScript
Python

README

Gesture Controlled Virtual Mouse   platform

Gesture Controlled Virtual Mouse makes human computer interaction simple by making use of Hand Gestures and Voice Commands. The computer requires almost no direct contact. All i/o operations can be virtually controlled by using static and dynamic hand gestures along with a voice assistant. This project makes use of the state-of-art Machine Learning and Computer Vision algorithms to recognize hand gestures and voice commands, which works smoothly without any additional hardware requirements. It leverages models such as CNN implemented by MediaPipe running on top of pybind11. It consists of two modules: One which works direct on hands by making use of MediaPipe Hand detection, and other which makes use of Gloves of any uniform color. Currently it works on Windows platform.

Video Demonstration: link
Note: Use Python version: 3.8.5

Features

click on dropdown to know more

Gesture Recognition:

Neutral Gesture
Palm
Neutral Gesture. Used to halt/stop execution of current gesture.
Move Cursor Move Cursor
Cursor is assigned to the midpoint of index and middle fingertips. This gesture moves the cursor to the desired location. Speed of the cursor movement is proportional to the speed of hand.
Left Click Left Click
Gesture for single left click
Right Click Right Click
Gesture for single right click
Double Click Double Click
Gesture for double click
Scrolling Scrolling
Dynamic Gestures for horizontal and vertical scroll. The speed of scroll is proportional to the distance moved by pinch gesture from start point. Vertical and Horizontal scrolls are controlled by vertical and horizontal pinch movements respectively.
Drag and Drop Drag and Drop
Gesture for drag and drop functionality. Can be used to move/tranfer files from one directory to other.
Multiple Item Selection Multiple Item Selection
Gesture to select multiple items
Volume Control Volume Control
Dynamic Gestures for Volume control. The rate of increase/decrease of volume is proportional to the distance moved by pinch gesture from start point.
Brightness Control Brightness Control
Dynamic Gestures for Brightness control. The rate of increase/decrease of brightness is proportional to the distance moved by pinch gesture from start point.

Voice Assistant ( Proton ):

Launch / Stop Gesture Recognition launch stop gesture recognition
  • Proton Launch Gesture Recognition
    Turns on webcam for hand gesture recognition.
  • Proton Stop Gesture Recognition
    Turns off webcam and stops gesture recognition. (Termination of Gesture controller can also be done via pressing Enter key in webcam window)
Google Search proton search github
  • Proton search {text_you_wish_to_search}
    Opens a new tab on Chrome Browser if it is running, else opens a new window. Searches the given text on Google.
Find a Location on Google Maps proton find location
  1. Proton Find a Location
    Will ask the user for the location to be searched.
  2. {Location_you_wish_to_find}
    Will find the required location on Google Maps in a new Chrome tab.
File Navigation proton list files  proton open  proton go back
  • Proton list files / Proton list
    Will list the files and respective file_numbers in your Current Directory (by default C:)
  • Proton open {file_number}
    Opens the file / directory corresponding to specified file_number.
  • Proton go back / Proton back
    Changes the Current Directory to Parent Directory and lists the files.
Current Date and Time proton date / time
  • Proton what is today's date / Proton date
    Proton what is the time / Proton time
    Returns the current date and time.
Copy and Paste proton copy proton paste
  • Proton Copy
    Copies the selected text to clipboard.
  • Proton Paste
    Pastes the copied text.
Sleep / Wake up Proton proton sleep / wake up
  • Sleep
    Proton bye
    Pauses voice command execution till the assistant is woken up.
  • Wake up
    Proton wake up
    Resumes voice command execution.
Exit proton exit
  • Proton Exit
    Terminates the voice assisstant thread. GUI window needs to be closed manually.

Getting Started

Pre-requisites

Python: (3.6 - 3.8.5)
Anaconda Distribution: To download click here.

Procedure

git clone https://github.com/xenon-19/Gesture-Controlled-Virtual-Mouse.git

For detailed information about cloning visit here.

Step 1:

conda create --name gest python=3.8.5

Step 2:

conda activate gest

Step 3:

pip install -r requirements.txt

Step 4:

conda install PyAudio
conda install pywin32

Step 5:

cd to the GitHub Repo till src folder

Command may look like: cd C:\Users\.....\Gesture-Controlled-Virtual-Mouse\src

Step 6:

For running Voice Assistant:

python Proton.py

( You can enable Gesture Recognition by using the command “Proton Launch Gesture Recognition” )

Or to run only Gesture Recognition without the voice assisstant:

Uncomment last 2 lines of Code in the file Gesture_Controller.py

python Gesture_Controller.py

Collaborators

Viral Doshi GitHub Email LinkedIn Instagram
Nishiket Bidawat Github Email LinkedIn Instagram
Ankit Sharma GitHub Email LinkedIn Instagram
Parth Sakariya Github Email LinkedIn Instagram

评论

暂无评论