Skip to content

Latest commit

 

History

History
189 lines (143 loc) · 4.97 KB

File metadata and controls

189 lines (143 loc) · 4.97 KB

🎥 Camera Setup Guide - Step by Step

🚨 PROBLEM IDENTIFIED

The main application (app.py) cannot start because it requires Firebase credentials, which prevents the camera from working.

🎯 SOLUTION: Test Camera First, Then Fix Main App

STEP 1: Test Basic Camera Functionality

Run this command to test if your camera works at all:

python simple_camera_test.py

What this does:

  • ✅ Tests basic camera access
  • ✅ Tests hand tracking functionality
  • ✅ Gives you interactive camera test
  • ✅ No Flask or Firebase required

Expected output:

🤟 Sign Language Learning - Camera Test
==================================================
🎥 Testing Camera Access...
✅ Camera opened at index 0
📊 Camera Properties:
   Resolution: 640x480
   FPS: 30.0
✅ Successfully read frame from camera

🖐️ Testing Hand Tracking...
✅ Hand detector initialized successfully
✅ Hand detection test passed - Found 0 hands

✅ All tests passed!

🎮 Do you want to run interactive camera test? (y/n):

STEP 2: If Camera Test Works - Run Interactive Test

When prompted, type y to run the interactive camera test:

What you'll see:

  • 🎥 Live camera feed in a window
  • 🖐️ Hand detection with landmarks
  • 📊 Finger count and pattern display
  • 💾 Press 's' to save images
  • 🔴 Press 'q' to quit

STEP 3: If Camera Test Fails - Troubleshoot

Common Issues & Solutions:

❌ "No camera found at any index"

  • Check if camera is connected
  • Close other apps using camera (Zoom, Teams, etc.)
  • Restart your computer
  • Check Device Manager for camera drivers

❌ "Failed to read frame from camera"

  • Camera is busy with another application
  • Close all camera-using apps
  • Check Windows privacy settings for camera access

❌ "Hand tracking test failed"

  • Reinstall dependencies: pip install -r requirements.txt
  • Make sure you're in the virtual environment

STEP 4: Once Camera Works - Test Web Version

If the standalone test works, try the web version:

python camera_test.py

Then:

  1. Open browser to http://localhost:5000
  2. Click "🚀 Start Camera"
  3. Allow camera access when prompted
  4. You should see live camera feed with hand tracking

STEP 5: Fix Main Application (Optional)

Once camera is working, you can fix the main app by:

Option A: Quick Fix (Remove Firebase Dependency)

Edit app.py and comment out Firebase initialization:

# Comment out these lines temporarily:
# if not firebase_admin._apps:
#     cred = credentials.Certificate("firebase-credentials.json")
#     firebase_admin.initialize_app(cred)
# db = firestore.client()

Option B: Get Real Firebase Credentials

  1. Go to Firebase Console
  2. Create a new project
  3. Download service account key as firebase-credentials.json
  4. Place it in your project root

🔧 TROUBLESHOOTING CHECKLIST

Camera Hardware Issues:

  • Camera is physically connected
  • Camera shows in Device Manager
  • No other app is using camera
  • Windows privacy settings allow camera access

Software Issues:

  • Virtual environment is activated (venv\Scripts\activate)
  • All dependencies installed (pip install -r requirements.txt)
  • OpenCV can access camera
  • MediaPipe is working

Browser Issues (for web version):

  • Using HTTPS or localhost
  • Camera permissions granted
  • No browser extensions blocking camera
  • Modern browser (Chrome, Firefox, Edge)

📱 TESTING COMMANDS

1. Basic Camera Test:

python simple_camera_test.py

2. Web Camera Test:

python camera_test.py

3. Demo Mode (No Camera):

python demo.py

4. Check Dependencies:

python test_setup.py

🎯 EXPECTED RESULTS

✅ SUCCESS:

  • Camera opens and shows live feed
  • Hand tracking detects your hand
  • Finger patterns are displayed
  • Real-time processing works smoothly

❌ FAILURE:

  • Camera doesn't open
  • Error messages about camera access
  • Hand tracking not working
  • Poor performance or lag

🆘 GETTING HELP

If Camera Still Doesn't Work:

  1. Run the test and share the exact error message
  2. Check Windows camera app works first
  3. Try different camera index (0, 1, 2, etc.)
  4. Restart computer and try again
  5. Check if camera works in other applications

Share This Information:

  • Error message from python simple_camera_test.py
  • Windows version
  • Camera model (if known)
  • Whether camera works in other apps

🎉 NEXT STEPS

Once camera is working:

  1. Test hand tracking accuracy
  2. Try different hand positions
  3. Test in different lighting conditions
  4. Move to main application testing
  5. Configure Firebase for full functionality

Remember: The camera test is designed to work independently. If it fails, the issue is with your camera setup, not the application code!