Language
Python
Tool Type
Algorithm
License
IDB Open-Source Software License
Version
1.0.0
Inter-American Development Bank
RoadScan is an open-source tool developed by the IDB to assess road trafficability through automated analysis of satellite imagery. It uses Meta's Segment Anything Model (SAM), image processing techniques, and anomaly detection algorithms to segment roads, identify moving vehicles, and detect pavement defects such as potholes and stains. The pipeline processes TMS (Terrain/Satellite) images from areas defined in KML files, generating georeferenced results in raster (GeoTIFF) and vector (Shapefile, GeoJSON) formats that can be directly integrated into geographic information systems (GIS).
RoadScan reduces the need for manual road inspections, which are costly, slow, and difficult to scale. It automates road condition assessment using satellite imagery, enabling detection of pavement anomalies, vehicle traffic quantification, and generation of georeferenced data remotely. This facilitates prioritization of road maintenance investments and improves decision-making in transport infrastructure.
It works as a pipeline of 8 Python notebooks executed sequentially: 1\. Generates bounding boxes from a KML file and downloads TMS satellite images (Terrain and Satellite). 2\. Segments road infrastructure using thresholding and morphological operations on Terrain images. 3\. Crops satellite images to retain only the road surface. 4\. Detects vehicles (cars, buses, and trucks) using LangSAM. 5\. Segments clean pavement by removing lateral visual noise. 6\. Detects visual anomalies (potholes, stains) through chromatic filtering in HSV color space. 7\. Applies reverse geocoding to obtain detailed locations. 8\. Consolidates all results into a unified table with road, vehicle, anomaly, and location data.
Uses open geospatial formats: GeoTIFF for raster data, Shapefile and GeoJSON for vector data, and KML for defining areas of interest. Built on open-source libraries such as GeoPandas, Rasterio, OpenCV, and Meta's SAM (Segment Anything Model). Compatible with any standard GIS system.
Connect with the Development Code team and discover how our carefully curated open source tools can support your institution in Latin America and the Caribbean. Contact us to explore solutions, resolve implementation issues, share reuse successes or present a new tool. Write to [email protected]
The complete RoadScan processing flow diagram is shown, from image download to result consolidation.
The road segmentation and vehicle detection results using the SAM model on satellite imagery are shown.
Detected pavement anomalies are shown, including potholes and stains, classified through HSV chromatic analysis.
Meta AI image segmentation model used by RoadScan for vehicle and pavement detection.