MediaPipeを用いたハンドジェスチャーによる簡単なマウス操作を行うプログラムです。
マウス移動:手の移動
マウス左クリック:手をパーからグーに変える
- mediapipe 0.8.1 or Later
- PyAutoGUI 0.9.52 or Later
- OpenCV 3.4.2 or Later
- Tensorflow 2.3.0 or Later
Webカメラを使ったデモの実行方法は以下です。
python app.py
デモ実行時には、以下のオプションが指定可能です。
- --device
カメラデバイス番号の指定 (デフォルト:0) - --width
カメラキャプチャ時の横幅 (デフォルト:960) - --height
カメラキャプチャ時の縦幅 (デフォルト:540) - --min_detection_confidence
検出信頼値の閾値 (デフォルト:0.7) - --min_tracking_confidence
トラッキング信頼値の閾値 (デフォルト:0.5) - --margin_width
ハンドジェスチャーの操作範囲(横幅のマージン割合)(デフォルト:0.2) - --margin_height
ハンドジェスチャーの操作範囲(縦幅のマージン割合)(デフォルト:0.2)
高橋かずひと(https://twitter.com/KzhtTkhs)
simple-virtual-mouse-using-mediapipe under Apache-2.0 License.