#computervision #opencv #ai
P1: Air Canvas using OpenCV
Ever wished to capture your imagination by simply waving your finger in the air?
In this project, I introduce Air Canvas—a virtual drawing tool that lets you sketch in the air using only your hand gestures. By leveraging the powerful capabilities of OpenCV and MediaPipe, this computer vision project tracks hand landmarks to create a seamless drawing experience.
🔧 Tools and Libraries Used
• Python 3: For scripting and project development.
• NumPy: To manage and manipulate data arrays efficiently.
• OpenCV: This open-source library is a cornerstone for real-time computer vision. It facilitates video frame capture and processing seamlessly.
• MediaPipe: Google’s framework for multimodal machine learning pipelines. In this project, MediaPipe powers real-time hand tracking and landmark detection.
🧩 Algorithm Overview
1. Frame Capture: Begin reading video frames from the webcam. Convert these frames to HSV color space, as it simplifies color detection.
2. Canvas Setup: Create a canvas frame and overlay ink buttons to enable drawing functionalities.
3. Hand Detection: Configure MediaPipe to detect a single hand by adjusting detection parameters.
4. Landmark Identification: Pass RGB frames to MediaPipe's hand detector to locate key landmarks.
5. Track Finger Movements: Detect the forefinger coordinates and continuously store them in an array across successive frames.
6. Render Drawings: Use the stored coordinates to draw points on the canvas and video frames, creating the visual output of your air-drawn masterpiece.
😘I’d love to hear your thoughts and ideas for improvement! Feel free to share your suggestions in the comments.
🔗 Explore the project here: https://github.com/iamramzan/P1-Air-C...