This is a raspberry pi, windows, unix computer openCV2 object speed camera demo program. It is written in python and uses openCV2 to detect and track object motion. The results are recorded on speed photos and data in a CSV file that can be imported to a spreadsheet or other program for additional processing. 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 detection is restricted between y_upper and y_lower variables (road area). If a track is longer than track_len_trig variable then average speed will be calculated (based on IMAGE_VIEW_FT variable) and a speed photo will be taken and saved in an images folder. If log_data_to_file=True then a speed2.csv file will be created/updated with event data stored in CSV (Comma Separated Values) format. This can be imported into a spreadsheet. See GitHub Repo for details
Requires a Raspberry Pi computer with a RPI camera module or webcam installed, configured and tested to verify it is working. I used a RPI model B2 but a B+ , 3 or earlier will work OK. A quad core processor will greatly improve performance due to threading. Also runs with webcam under windows or a unix distro. Note windows will not run bash shell scripts. See wiki for more details re windows install.
NOTE - Review settings in config.py file and edit with nano or text editor as required. You will need to perform a calibration to set the correct value for IMG_VIEW_FT variable based on the distance from camera to objects being measured for speed. See video and GitHub project page for more details.