DEV Community

Yan
Yan

Posted on

NUMBA 3 Making Gesture Control Feel Natural

What if you could control your mouse cursor without touching anything, but with the smoothness of a high-end gaming mouse?

I built NUMBA 3 — a Python-based touchless controller that uses MediaPipe for hand tracking and Numba for high-speed physics calculations. It’s not just a "detect-and-move" script; it’s an attempt to make gesture control feel natural.

The Problem: Why most AI mice feel laggy
Most gesture-based controllers suffer from jitter and linear movement. If you move your hand 1cm, the cursor moves 1cm. It feels "robotic."

To fix this, I implemented a custom Physics Engine optimized with @njit (Numba).

  1. Adaptive Pre-processing
    Light conditions change. To make hand tracking stable, I implemented a CLAHE (Contrast Limited Adaptive Histogram Equalization) and a toggleable inversion mode. This ensures the MediaPipe model sees a clear silhouette of the hand even in low light.

  2. Gesture Modes
    The system isn't just for moving the cursor. I've implemented:

MOUSE Mode: Standard navigation.

SCROLL Mode: Natural scrolling using finger distance.

TURBO Mode: High-sensitivity movement for large displays.

Dynamic Switching: Just raise your pinky to cycle through modes!

The "Inversion" Paradox
Interestingly, during development, I encountered a paradox: while higher contrast usually helps AI, too much detail (background noise) makes it worse. By adding a "Binary Inversion" toggle, I allowed the system to adapt to dark vs. light backgrounds instantly.

The project is fully open-source. If you want to try it out or contribute to the physics engine:
How it Works

  1. Real-time Physics with Numba I used the Numba library to pre-compile the physics logic into machine code. This allows the system to calculate "boost" and "thresholds"

Check it out

GitHub Repo: yan4ikxxx-wq/NUMBA_3

GitHub logo yan4ikxxx-wq / NUMBA_3

AI-powered hand tracking system for touchless PC control. Built with MediaPipe & Python.

CHECK Система управления курсором Windows с помощью жестов рук оптимизированная для работы в условиях сложного освещения Использует компьютерное зрение и высокопроизводительные вычисления на Numba

"Enjoying this project? Buy me a coffee 🚀" Donate

English version below


Особенности (RU) 🇷🇺

  • Плавность движения: Физика курсора просчитывается через Numba (@njit), что исключает задержки (input lag).
  • Адаптивное зрение: Использование фильтра CLAHE и алгоритма OTSU позволяет системе видеть руку даже при плохом освещении.
  • Динамическая калибровка: Система автоматически подстраивает чувствительность при смене режимов.
  • Интерфейс "Картинка в картинке" (PIP): Вы всегда видите, как нейросеть обрабатывает ваше изображение в реальном времени.

Требования

  • ОС: Windows 8.1/10/11
  • Веб-камера (рекомендуется 30+ FPS)

Управление

  1. MOUSE: Управление курсором (запястье — ведущая точка). Клик — сведение большого и указательного пальцев.
  2. SCROLL: Лайк (большой палец вверх) — скролл вверх, жест "V" — скролл вниз.
  3. TURBO: Режим повышенной скорости курсора.
  • Смена режима: Удерживайте мизинец поднятым в течение 1 секунды.

Быстрые клавиши

  • I — Инверсия бинарной маски (если…

almost instantly.

Top comments (0)