How debopriya-ai/gesturesense- works
Project type and purpose
• GestureSense is a real‐time computer vision application (not a web or mobile stack).
• It uses classical image‐processing techniques (no deep learning) to detect and count fingers from a live webcam feed.
File structure
• Top‐level files:
• main.py – the entry point that initializes the webcam feed, runs the processing loop, and displays results.
• utils.py – contains geometric and contour‐analysis helper functions (adaptive thresholding, convex hull, cosine‐rule classifier).
• assets/ – demo screenshots or GIFs (not involved at runtime).
• Final_Project_MV*.ipynb – Jupyter notebook for exploratory analysis or demonstration.
• Configuration files (none beyond LICENSE, README).
Key insights from README
• Tech stack: Python, OpenCV, NumPy.
• Pipeline stages: ROI segmentation → adaptive thresholding → contour detection → convex hull/defect analysis → cosine‐rule classification → GUI overlay.
• Goal: low‐latency, high‐accuracy real‐time performance (~30 FPS).
Main components and interactions
a. Input Component
• “Webcam / Video Capture”
• External dependency: OpenCV’s cv2.VideoCapture
b. Preprocessing Component
• ROI Selector (crop to hand region)
• Adaptive Thresholding (grayscale → binary mask)
c. Contour Analysis Component
• Contour Detector (findContours)
• Contour Filter (select largest hand contour)
d. Feature Extraction Component
• Convex Hull Calculator
• Convexity Defect Analyzer
• Cosine‐Rule Finger Classifier
e. Output / Rendering Component
• Window (OpenCV GUI)
f. Utilities Module
• Shared functions from utils.py
g. External Libraries
• OpenCV, NumPy
Relationships & data flow
Webcam → Preprocessing → Contour Analysis → Feature Extraction → Output/Rendering → Display
• Utilities module should be depicted as a side component that each processing stage calls into.
• External libraries at the bottom or side, showing that each main block depends on OpenCV/NumPy.
Architectural patterns & design principles
• Pipeline pattern: sequential data transformations.
• Single‐process, in‐memory communication (no microservices).
• Separation of concerns: main.py handles control flow; utils.py encapsulates pure functions.
Essential elements
• Component names and brief descriptions.
• I/O (webcam/display)
• Processing stages
• Helpers/utilities
• External dependencies
• Annotations for performance targets (e.g., “30 FPS”) and any hardware considerations (e.g., CPU usage).