Scripts for Google Traffic Map Capture/Process

get_google_traffic_map_once.py captures Google Traffic images as shown below:
Currently, the script takes screen shots every 10 min.
get_google_traffic_map_once.py (1.1 KB)

preprocessing_pngs.py crops the captured image for user-defined areas. The script creates two large intermediate files for QA purposes.
preprocessing_pngs.py (1.5 KB)

count_rgb.py counts pixels in the cropped images to classify areas depending on traffic jam conditions: dark red (“D”) for severe traffic, red (“R”) for heavy traffic, orange (“O”) for medium traffic, and green (“G”) for light traffic. The result is 2020_ATL_screenshots_cropped_DROG_Counts.csv that contains DROG pixel counts for each cropped figure.
count_rgb.py (1.8 KB)
2020_ATL_screenshots_cropped_DROG_Counts.csv (1.6 MB)

As of now the color detection is based on RGB codes. However, in the future, HSV (or HSB) with RGB-to-HSV (or vice versa) cross-walk can be utilized to do color detection like a human does.

1 Like

How do you use the count data in your organization? Have you mapped grid cell to road segment?

For now, we count all DRO pixels as a proxy for traffic conditions.

No, I have not.