## 2 Forth Road Bridge Vehicle Length Data
### Vehicle Lengths in Traffic Image Data  
A video system was installed on the south main tower to survey the traffic on the FRB. The video system includes an Internet protocol camera, a network video recorder (NVR) and a power-over-ethernet (PoE) unit. The camera has pan/tilt/zoom (PTZ) capability and is suitable for outdoor use. Continuous serviceability of the camera was ensured by the infrared-cut filter. Electric power and data transfer were supplied by the PoE unit using a single cable. The NVR provides access to settings of the camera and data records.  
The system collected video traffic data at a rate of 1 frame per second from April to August 2017, before the traffic was redirected to the new bridge. Only daytime traffic from 5 am to 10 pm on the northbound carriageway is considered in this research. The night-time traffic data were removed from the database due to a large number of images of low quality and traffic with low flow. A further group of 203 out of 2210 h of video data were removed due to challenging weather conditions (wind, sun or fog). Videos were segmented into frames and each frame analysed separately.  
A digital image can be represented numerically as three matrices, one for each of the primary colours. Adaptive thresholding [38] and morphological reconstruction [39] are applied to analyse the frames and extract the key traffic features such as vehicle outline. The outline of each vehicle is then enclosed in a rectangle and its location and dimensions extracted. Details of the image processing method are given in [37; 40]. Approximately 3 million northbound vehicles, representing 95% of the data in these images, were identified in 130 days of records. Figure 2 gives an example of an image being analysed step by step and vehicle length being extracted.  
One year of WIM records are available from a WIM system at the South end of the FRB. Different data cleaning criteria were applied [42] to ensure a clean set of data. The cleaned database of free-flowing vehicles was used to establish the statistical correlation between vehicle length and weight. Figure 3a provides a bivariate histogram of length and weight data for one month of slow-lane traffic,  
Figure 1: Longitudinal elevation of the Forth Road Bridge (FRB).  
Figure 2: Vehicle length measured in images: primary intensities (red, green, blue) extracted from colour image and represented as individual grey images; results of red, green and blue intensities applied together; vehicle outlines identified and enclosed in rectangles [41].  
i.e., the colours indicate the frequency of each length/weight combination. This can be used to extract a gross weight histogram for vehicles of any given length. Here the histogram is shown for vehicles in the length range of 9.9 to 10.2 m (Figure 3b). Having found the histogram, the probability density function (PDF) is estimated using a univariate kernel density estimator (KDE) [43]--Figure 3c. Hence the cumulative distribution function (CDF) is found--Figure 3d. Having established the CDF, Monte Carlo sampling is used to infer a 'typical' weight for the vehicle recorded in the image. While this process is clearly inaccurate for individual vehicles, it has been shown to be quite accurate in probabilistic calculations of the type considered here [36].