Skip to content

openxc/nightvision

Repository files navigation

Nighttime Forward Collision Warning with OpenXC

This Nighttime Forward Collision Warning is an Android app that uses OpenXC and a standard USB webcam to add "night vision" to a car with off-the-shelf parts. The webcam faces forward from the dashboard and uses edge detection to detect objects on the road in the path of the vehicle (i.e. deer). Samantha Skinger developed the first version of this app as a summer intern at Ford in 2012. The application is tuned for rural night driving and doesn't cope well with city lights or daylight.

Disclaimer This application is intended to be used with a display device that has a fixed, preferably permanent location in the vehicle. For example, mounted on the dash. Never mount anything on the dash such that the driver's view is impeded. While the night vision camera application may help increase visibility, the OpenXC platform does not make any claims of a safety benefit.

Dependencies

Hardware

This application was tested with a webcam with the infrared filter removed and with IR illuminators on the front of the car. The visibility was not any greater than with headlights alone, but there may still be a workable passive IR solution that can improve detection distance.

Software

Installation instructions

  1. Install the OpenXC Enabler to the device.
  2. Run ndk-build in the android-webcam project folder to compile the native camera library.
  3. Run ndk-build in the nightvision project folder to compile the native nightvision extensions.
  4. Install the NightVisionActivity application to the device.
  5. Start the app once, then restart device to make sure the VehicleMonitoringService service is properly registered to begin at bootup and start monitoring the gear position.
  6. Mount the Android device where it will be secure and visible to the driver when backing up, but not in the way of normal driving.
  7. Mount the USB webcam on dashboard or windshield and plug into the Android device. We recommend using velcro and attaching the camera to the back of the rearview mirror.
  8. Assuming the VI is attached to the OBD-II port, connect the tablet to it via USB or Bluetooth.

With Maven:

Follow the directions to install the Android Webcam library, then:

$ cd nightvision
$ ndk-build && mvn package android:deploy android:run

Functionality

The app continuously reads vehicle data from the VI and watches for changes in headlamp_status to determine if the nighttime warning should be activated.

When enabled, the feed from the webcam is passed first to an implementation of the Sobel edge detection algorithm. The detection focuses on 50% of the display area around the center, since this is where the horizon of the road will be while driving.

Once the edges are detected, a rudimentary object detection algorithm finds clusters of edges that indicate an object on the road ahead. If an object is detected, it will be highlighted on the display and an alert will sound.

License

Copyright (c) 2012-2013 Ford Motor Company Licensed under the BSD license.

About

Video-based object detection for forward collision warnings with OpenXC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published