Skip to content

SayantikaLaskar/AI-Virtual-Zoom-Gesture-using-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI Virtual Zoom Using Gesture

This project implements a virtual zoom system using hand gestures, utilizing OpenCV and cvzone to track hand movements and zoom in/out based on distance between hands. The system detects hands in real-time and resizes an image dynamically based on gesture input.

Features

  • Hand gesture-based zooming
  • Real-time hand tracking using OpenCV and cvzone
  • Smooth zooming effect with distance measurement
  • Works with any webcam

Installation

1. Clone the Repository

git clone https://github.com/yourusername/AI-Virtual-Zoom-Gesture.git
cd AI-Virtual-Zoom-Gesture

2. Install Dependencies

Ensure you have Python installed, then run:

pip install opencv-python cvzone numpy

Usage

Run the script:

python AIVirtualZoomGesture.py

How It Works

  1. Start the script → Webcam turns on.
  2. Show both hands with index & middle fingers up → Zoom starts.
  3. Move hands closer → Zooms in.
  4. Move hands apart → Zooms out.
  5. Release hands → Resets the zoom.

Code Explanation

  • Hand tracking: Detects hands using cvzone.HandTrackingModule.
  • Distance measurement: Calculates distance between hand centers.
  • Dynamic image resizing: Resizes the image based on hand distance.

Troubleshooting

Issue Solution
ModuleNotFoundError: No module named 'cvzone' Run pip install cvzone
Webcam not detected Check cv2.VideoCapture(0), try 1 if using an external webcam
Image not appearing Ensure pikatchu.jpeg is in the correct directory

Future Improvements

  • Add hand tracking smoothing for better accuracy.
  • Implement single-hand zooming (e.g., thumb & index finger).
  • Display zoom percentage for user feedback.

License

This project is licensed under the MIT License.


🚀 Developed by Sayantika Laskar

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages