Truck Detection

Short Description

The Truck Detection algorithm detects the number of moving trucks along roads using 10m resolution Sentinel-2 level 2A data. The author Henrik Fisser (, developed this algorithm (with the title: Truck detection – Sensing trade from space) in the context of the Euro Data Cube COVID-19 edition of Sentinel Hub’s custom script contest. The algorithm exploits the small offset between Sentinel-2 bands which causes moving objects to appear as rainbows in RGB images allowing the detection and mapping of moving trucks.
The output of the algorithm is point vector data ( GeoPackage (.gpkg) format) with the coordinates of the detected trucks, dates of detected trucks and the valid road area as attributes.

How to generate trucks vector data

Generate trucks data for your area of interest in these simple steps:
  1. Create EDC account here and purchase enough credits
  2. Navigate to EDC Browser
  3. Select the required input parameters
  4. Follow the check-out wizard to complete your order.

Data Source

Truck detection algorithm detects trucks on Sentinel -2 L2A images. Find out more information about Sentinel-2 data in the documentation

Table 1: Data source description

Data Source Sentinel 2 L2A
Resolution 10m
Geographical coverage Global
Update Frequency New Sentinel data are added regularly, usually within few hours after they are available on Copernicus Hub
Bands used Blue, Green, Red, SCL

Table 2: Description of Sentinel 2 L2A bands used

Name Description Units & Typical Range
B02 Blue DN, typically from 0-10000
B03 Green DN, typically from 0-10000
B04 Red DN, typically from 0-10000
SCL Scene classification data, based on Sen2Cor processor Codelist, from 0-11

Detection Method

The detection method exploits small sensing offset of different wavelength that moving objects have in Sentinel-2 data which causes a specific reflectance relationship in the RGB, which looks like a rainbow. The method only targets the blue part of the ‘rainbow’ truck object since the dominance of blue reflectance is rare over land surfaces. This blue part of the truck serves as a marker. The detection is then achieved through reflectance band math calculations.
Initial step - Create a road mask, Check that the following conditions are fulfilled: Cloud masking : Final step - the ratios between B02 (blue) and B03 (green) and B02 and B04 (red) are calculated. The following thresholds are applied: Result- Each truck is represented by pixels with value 1. Connected pixels are filtered to identify single trucks and then vectorized to get the final result.

Algorithm Input Parameters

Table 3: Required parameters

Name Possible Values Description
Area of Interest BBox or polygon Area of Interest
Time range from 2016-11-01 to date Time period for which the algorithm will run
OSM Values "motorway", "trunk", "primary" Road types found in OSM. Trucks are only detected on roads obtained from OSM. Their descriptions can be found here
Max. cloud coverage Integer (from 0 to 100) Maximal cloud coverage in percentage
Week days "Monday", "Tuesday" ... Days of the week for which the algorithm will run in the selected time range

Paramters usage

Name Usage
Area of Interest The area where the algorithm requests the Sentinel-2 data and detects trucks. Note that the algorithm requests ALL Sentienl-2 data available within the area of interest whether there are roads or not.
Time range The time range that the algorithm requests the Sentinel-2 data and detects trucks. Note that the algorithm requests ALL available data/acquisitions within the time range.
OSM Values The road types that the algorithm detects trucks. Currently motorway, trunk, and primary are supported. The OSM Values determine the valid road area, while the area outside of selected roads are masked.
Max. cloud coverage The algorithm computes the cloud coverage of the pixels located over the network of roads (pixel intersecting roads) and computes the % of cloudiness by dividing the number of cloudy pixels by the total number of pixels intersecting roads. There is a trade-off between a high value that can generate a lot of false positives due to the close similarity between cloud edges and trucks signals and a low value that can lead to undetected trucks due to over filtering.
Week days The algorithm allows users to select specific week days for filtering purposes. Note that the revisit time of Sentinel-2 is 5 days, meaning that there may be only ONE acquisition for each week day in a month. To avoid an empty result, if less week days are selected, a longer time range is required.

Algorithm output

The output of the algorithm is point vector data in GeoPackage format with coordinates of the detected trucks, the dates of detected trucks and the valid road area as attributes.

Projection of the output data

Format of the output data

Supported delivery methods


More Information


Application Areas

Known Limitations


trucks on sentinel 2
example of trucks visible on sentinel 2 image

Example of trucks detected (green dots) by the algorithm along Ventura freeway, southern California on 22-07-2020 with Sentinel 2 image overlay