Install latest/stable of car-distance-finder
Ubuntu 16.04 or later?
Make sure snap support is enabled in your Desktop store.
Install using the command line
sudo snap install car-distance-finder
Don't have snapd? Get set up for snaps.
This snap uses a MobileNet SSD network to detect vehicles in a video stream, and then tracks them using the CSRT tracker algorithm implemented on OpenCV. The distance from the camera to the vehicles is then estimated by a simple formula using the bounding box for the vehicle and the camera's focal distance. The later is hard-coded in the code, so do not expect anything accurate: it is more of an example application.
The program is able to track multiple vehicles while still running the neural network for detections on the stream. Extensive multi-threading is used to accomplish this while at the same time trying to be as real-time as possible. This means that the trackers are fed with the latest available frames and some times older frames are not processed.
Sources can be found at https://github.com/alfonsosanchezbeato/car-distance-finder
Generate an embeddable card to be shared on external websites.
Choose your Linux distribution to get detailed installation instructions. If yours is not shown, get more details on the installing snapd documentation.