This application provides a real-time camera feed with advanced text detection capabilities. It can automatically detect and use your iPhone 14 via Continuity Camera for 60fps video feed, making it perfect for capturing and analyzing math problems and other text content.
- Continuity Camera Support: Automatically detects and uses your iPhone 14 camera for 60fps feed
- Real-time Text Detection: Advanced OCR with multiple engines (EasyOCR, Tesseract, Google Vision)
- High-Quality Video: Supports up to 1920x1080 resolution at 60fps
- Smart Camera Detection: Automatically finds the best available camera
- Manual Camera Selection: Option to manually select specific cameras
- Image Capture: Timestamp-based image capture with text detection overlays
- AI Integration: Built-in support for sending images to LLMs for problem solving
- Install the required dependencies:
pip install -r requirements.txtTo use your iPhone 14 camera for 60fps video feed:
-
Enable Continuity Camera on your iPhone:
- Go to Settings > General > AirPlay & Handoff
- Turn on 'Continuity Camera'
-
Ensure both devices are signed into the same Apple ID
-
Position your iPhone:
- Place it on a stand or hold it steady
- Point it at the text you want to analyze
- Ensure good lighting for better text detection
-
The app will automatically detect your iPhone camera
- Run the camera application:
python text_detection_camera.py-
Camera Controls:
- Press
cto solve (capture crop + send to LLM) - Press
tto toggle text detection on/off - Press
ato toggle accurate mode (slower but more accurate) - Press
gto cycle granularity (paragraph/line/word) - Press
fto show/save full recognized text - Press
qto quit
- Press
-
Camera Selection:
- The app automatically detects and uses your iPhone camera if available
- If iPhone camera is not detected, you can manually select from available cameras
- Manual selection is offered when iPhone camera is not found
aiglasses/
├── text_detection_camera.py # Main camera application with text detection
├── requirements.txt # Python dependencies
├── README.md # This file
└── captured_images/ # Directory where captured images are stored
├── captured_image_YYYYMMDD_HHMMSS.jpg
├── text_detection_YYYYMMDD_HHMMSS.jpg
└── ocr_crop_YYYYMMDD_HHMMSS.jpg
- Python 3.7+
- Webcam or camera device (iPhone 14 via Continuity Camera recommended)
- OpenCV
- NumPy
- EasyOCR or Tesseract (for text detection)
- Google Cloud Vision (optional, for enhanced OCR)
- iPhone camera not detected: Ensure Continuity Camera is enabled on your iPhone
- Camera permissions: On macOS, grant camera permissions to your terminal/IDE
- Multiple cameras: Use manual camera selection if auto-detection fails
- Poor OCR accuracy: Try accurate mode ('a' key) for better results
- No text detected: Ensure good lighting and steady camera positioning
- Missing dependencies: Install OCR libraries with
pip install easyocrorpip install pytesseract
- Import errors: Install all dependencies with
pip install -r requirements.txt - Performance issues: Use fast mode for higher FPS, accurate mode for better detection
- iPhone connection: Ensure both devices are on the same WiFi network and signed into the same Apple ID
- iPhone Positioning: Keep your iPhone steady on a stand or tripod
- Lighting: Ensure good, even lighting on the text
- Text Quality: Use clear, printed text rather than handwritten text
- Camera Distance: Position the camera 6-12 inches from the text
- Stability: Avoid motion blur by keeping the camera steady