A browser-only, real-time obstacle detection app that gives voice, haptic (vibration), and audio-beep feedback using nothing but the device camera — no backend, no external libraries.
| File | Language | Purpose |
|---|---|---|
index.html |
HTML5 | Page structure: welcome screen, camera view, controls |
style.css |
CSS3 | All styling, layout, colors, and animations |
script.js |
JavaScript | Camera capture, frame-differencing detection, zone mapping, and voice/haptic/audio feedback logic |
- Requests camera access (
getUserMedia) on the rear camera. - Downscales each frame to 160×120 and compares it against the previous frame (frame-differencing) to detect motion.
- Groups moving pixels into blobs (flood-fill / connected components) and maps each blob onto a 3×2 zone grid (Left / Centre / Right, Front-Left / Front / Front-Right).
- Classifies the nearest blob as Safe, Caution, or Danger and raises a zone-specific voice alert (Web Speech API), vibration pattern (Vibration API), and audio tone (Web Audio API).
Just open index.html in a browser — or, for camera access to work
reliably, serve the folder locally, e.g.:
npx serve .Then visit http://localhost:3000 (or the port shown) on a device with a
camera.
- Push this repo to GitHub.
- Go to Settings → Pages.
- Set the source to the
mainbranch, root folder. - Your app will be live at
https://<username>.github.io/<repo-name>/.