-
Notifications
You must be signed in to change notification settings - Fork 177
Program Description
Welcome to the rpi-speed-camera wiki!
This is windows, unix and raspberry pi computer and openCV object motion speed tracker program. It is written in python and bash script and uses openCV to detect and track object motion and speed. This can be used for vehicles or any other moving objects. It tracks the speed of the largest moving object in the camera view. This program has been tested and runs using python2 or python3 and associated opencv 2 or 3 version. For non Raspberry Pi computers you will need a USB web camera installed.
Note opencv3 requires install from source. I have a whiptail menu driven script to automate download, dependencies install, cmake and compile of opencv3, if you are interested see my GitHub project Raspberry Pi Menu Driven OpenCV 3.2.0 Compile from Source Script.
This project also includes a menu driven admin tool called menubox.sh that can perform most speed camera operations
The program will detect motion in the field of view and use opencv to calculate the largest contour and return its x,y coordinate. Motion is tracked for a specified pixel length and speed reported. Motion detection is restricted between y_upper, y_lower, x_left, x_right variables (rectangle area of road or area of interest). Only motion within this rectangle is tracked. If a track is longer than track_len_trig variable then average speed will be calculated (based on cal_obj_px and cal_obj_mm variables) and a speed photo will be taken and saved in an images folder. If config.py variable log_data_to_file=True then a speed-cam.csv file will be created/updated with event data stored in CSV (Comma Separated Values) format. This can be imported into a spreadsheet.
The results are recorded on speed photos and optionally in a CSV data file that can be imported to a spreadsheet or other program for additional processing. The CSV data can also be used to create web pages that can be viewed on a web browser from another computer on the same network.
How to Install rpi-speed-camera
- YouTube Speed Camera Demo Video https://youtu.be/eRi50BbJUro
- YouTube Speed Lapse Video - A Day on the Street https://youtu.be/-xdB_x_CbC8
- Speed Camera RPI Forum post https://www.raspberrypi.org/forums/viewtopic.php?p=1004150#p1004150
- YouTube motion-track video https://youtu.be/09JS7twPBsQ
- YouTube Channel https://www.youtube.com/user/pageaucp
- Speed Camera GitHub Repo https://github.com/pageauc/rpi-speed-camera
Wiki Home
Description, Issues, Features
How to Install or Upgrade
How to Run
How to Calibrate
Change Settings and Plugins
How to Tune Motion Tracking
Setup RTSP Camera
rclone Remote Storage File Transfer
How to View Speed Data
How to Generate Graphs
How to Run speed-search.py
How to Start on Boot
How to use run.sh
watch-app.sh Remote config
How to Manage Sqlite3 Database
How to move speed-camera to ext drive
How to use OPENALPR with speed camera
Github Repo