Skip to content

steftodor/traffic-cam-scraper

Repository files navigation

Traffic Cam Scraper

python

Introduction

This script was developed in order to scrape images from multiple traffic camera feeds from one city/organization.

The idea of this was conceived in order to capture time-lapses or events through traffic cameras that are readily available to the public in many cities.

Sample Timelapses

New York City SampleToronto Sample Calgary Sample

Getting Started

To use just the basic camera scraper

  1. Download this repository to your computer, and ensure that you have the latest version of python 3 installed.
  2. Open camera_scraper.py
  3. Modify the following variables to suit your needs. Some examples can be found here.
    1. url_front
    2. url_end
    3. camera_ids
    4. img_type
    5. img_dir
    6. capture_interval
  4. Run the script for as long as you like
  5. End the script when you are satisfied with how many captures you have.

Eliminating broken frames (Ottawa)

  1. Ensure that all prerequisite packages in requirements.txt are installed
  2. Update the following values to match the ones from camera_scraper.py
    1. img_dir
    2. img_type
  3. Run ottawa_clean_set.py
  4. For each camera subdirectory verify the reject folder for validity

Generating gif

  1. Ensure that all prerequisite packages in requirements.txt are installed
  2. Update the following values to match the ones from camera_scraper.py
    1. img_dir
    2. img_type
  3. Run make_gif.py
  4. For each camera subdirectory the gif will be provided as movie.gif

About

This script was developed in order to scrape images from multiple traffic camera feeds from one city/organization.

Resources

License

Stars

Watchers

Forks

Contributors

Languages