Visually impaired individuals and general users often lack an affordable, portable system for real-time environmental awareness. Existing solutions are expensive, bulky, or require cloud dependency.
We built a low-cost, real-time smart vision system using an ESP32-CAM and an Android application powered by YOLO object detection.
The system captures live images, transmits them wirelessly, processes them on-device, and provides visual + audio feedback to the user.
- ๐ท Real-time image capture using ESP32-CAM
- ๐ก Wireless transmission over WiFi (HTTP)
- ๐ค On-device object detection using YOLOv8
- ๐ Distance estimation (based on bounding box scaling)
- ๐ Voice feedback using Text-to-Speech (TTS)
- ๐ฑ Clean Android UI for portable,offline and light monitoring
- ๐ป WEB-APP for more accurate detections, hosted locally
- โก Low-cost and portable edge solution
โโโโโโโโโโโโโโโโโโโโโโโโ
โ ESP32-CAM (L) โ
โโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โ WiFi (Image Stream / Capture)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ ESP32-CAM (R) โ
โโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Web-App Server โ
โ (app.py) โ
โโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Stereo Matching โ
โ โข WLS Filtering โ
โ โข Depth Estimation โ
โ โข YOLOv8 Detection โ
โโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Browser UI (User) โ
โโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Camera Feeds โ
โ โข Depth Map โ
โ โข Bounding Boxes โ
โ โข Distance (meters) โ
โโโโโโโโโโโโโโโโโโโโโโโโ
(Alternative Mobile Pipeline)
โโโโโโโโโโโโโโโโโโโโโโโโ
โ ESP32-CAM โ
โโโโโโโโโโโฌโโโโโโโโโโโโโ
โ WiFi (Image POST)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Android Device โ
โโโโโโโโโโโโโโโโโโโโโโโโค
โ โข YOLOv8 Detection โ
โ โข Distance Estimationโ
โ โข Text-to-Speech โ
โโโโโโโโโโโฌโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ User Output โ
โโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Bounding Boxes โ
โ โข Labels โ
โ โข Audio Alerts โ
โโโโโโโโโโโโโโโโโโโโโโโโ
ESP32-CAM (L/R) -> WEB-APP: Send Stereo Frames
WEB-APP -> Stereo Engine: Compute Disparity (WLS)
WEB-APP -> YOLOv8: Detect Objects
YOLOv8 -> WEB-APP: Detection Results
WEB-APP -> WEB-APP: Distance Calculation
WEB-APP -> User (Browser): Display + Depth Map + Distances
ESP32-CAM -> APP: Send Image Frame
APP -> YOLOv8: Process Image
YOLOv8 -> APP: Detection Results
APP -> APP: Distance Calculation
APP -> User: Display + Voice Output
| Component | Description |
|---|---|
| ESP32-CAM (AI Thinker) | Camera + microcontroller |
| 5V Power Supply | Stable external power |
| Jumper Wires | Connections |
- 5V โ ESP32 5V
- GND โ ESP32 GND
โ ๏ธ Important:
- Use stable 5V supply (ESP32-CAM is sensitive to voltage drops)
- During programming: connect GPIO0 โ GND
- After upload: remove GPIO0 connection
- Arduino IDE
- ESP32 Camera Library
- WiFi + HTTP Streaming
- Python (Flask / FastAPI)
- OpenCV (Stereo Matching + WLS Filtering)
- YOLOv8 (PyTorch / ONNX)
- NumPy (Depth Computation)
- HTML + CSS + JavaScript (Browser UI)
- Android (Kotlin / Java)
- YOLOv8 (TFLite)
- TextToSpeech API
-
Install Arduino IDE
-
Add ESP32 board:
https://dl.espressif.com/dl/package_esp32_index.json -
Select:
Board: AI Thinker ESP32-CAM -
Upload code to both cameras (Left & Right)
-
Open Serial Monitor โ note both IP addresses
-
Clone the repository:
git clone https://github.com/your-username/your-repo.git cd your-repo -
Install dependencies:
pip install -r requirements.txt -
Update camera URLs in
app.py:LEFT_CAM_URL = "http://<left_cam_ip>" RIGHT_CAM_URL = "http://<right_cam_ip>" -
Run the server:
python app.py -
Open in browser:
http://<your-device-ip>:5000
-
Open project in Android Studio
-
Connect phone
-
Grant permissions:
- Camera
- Microphone (for TTS output)
- Internet
-
Run the app
- Turn on mobile hotspot
- Power ESP32-CAM
- Ensure both devices are on same network
- Enter ESP32 IP in app (if required)
- Start detection
This project estimates distance using stereo triangulation, similar to how human vision perceives depth.
๐ข Core Formula
Distance= f*B/dโ
f (Focal Length): Camera parameter in pixels (FOCAL_LENGTH_PX = 1700)
B (Baseline): Distance between the two cameras (BASELINE_CM = 10 cm)
d (Disparity): Horizontal pixel difference of the object between left and right images
๐ฏ How Disparity is Calculated:
Object Matching Detects the same object (e.g., person) in both images using label, position, and size. Refined Matching Extracts a small patch from the object in the left image Uses OpenCV matchTemplate to find the best match in the right image Computes disparity as the difference in X-coordinates
๐ Smoothing for Stability:
To reduce noise and flickering, the system applies a rolling average (last 10 values) to stabilize disparity and produce smoother distance estimates.
๐ Key Insight Large disparity โ Object is close Small disparity โ Object is far
- Dependent on lighting conditions
- Distance estimation is approximate
- Network latency may affect performance
- ESP32 has limited processing power
- ๐ GPS tracking
- ๐ฏ Better distance estimation using depth models
- ๐ Battery-powered portable design
- ๐ง Custom-trained YOLO model
- Power the ESP32-CAM
- Open the Android app
- Show live detection
- Demonstrate voice output
- Move objects closer/farther to show distance effect
- Combines IoT + Computer Vision + Mobile AI
- Fully portable and low-cost
- Works in real-time without cloud dependency
- Scalable for smart assistive systems
- Ryan Mittal
- Abdul
- Aryan Khare