Estimation of optical speed measurement error for traffic monitoring systems

. This article is devoted to the problem of accurate vehicle speed measurement from video images. The analysis of existing methods of optical speed measurement is carried out, and the need to estimate the measurement error is justified. An idealized mathematical model of speed measurement based on binding to the size of the license plate is studied and the influence of various factors on the measurement accuracy is shown: the influence of the intrinsic and extrinsic camera parameters, the influence of license plate size in images, influence of data averaging. A comparison of the obtained results with the accuracy of widely used in practice radar technologies is shown.


Introduction
Currently, traffic monitoring systems are actively used to collect traffic parameters and register traffic violations. The problem of accurate vehicle speed measurement is one of the most relevant in the practice of traffic violations fixation and road safety ensuring.
According to the principle of speed measurement, modern monitoring systems are divided into three types: radar, laser, and optical. Radar and laser-type devices are characterized by high accuracy of speed detection (the error is no more than 2 km/h) and a high detection range (up to 500 m). In the simplest case radar with a narrow beam, which operates at a fixed frequency, is used. This radar can control only one lane and measures only one parameterthe vehicle speed, and as a rule, captures no more than one vehicle. Modern radar systems can also determine the position of the vehicle and are used to monitor multiple lanes with a correct correspondence between measured speed and a specific vehicle [1].
Optical speed measurement systems allow you to get correct correspondence between the measurement result and a specific vehicle even in dense traffic. If several vehicles are in the control zone at the same time, the speed value is determined independently for each vehicle by reference to its license plate. However, a significant disadvantage of the optical measurement method is considered to be a higher error compared to radars and laser technologies. The purpose of this work is to estimate the optical speed measurement error, as well as to analyze the main factors that affect the accuracy of measurement.
The most common method of optical speed measurement is an approach in which the vehicle speed is calculated as the ratio of the passed path of some fixed point in the images to the time that this path was passed [2]. As a rule, the center of the license plate is taken as a fixed point. Time measurement is based on the camera frame rate. Before using the monitoring system, its camera calibration is performed. Based on known intrinsic and extrinsic camera parameters, the coordinates of the license plate center in image are recalculated to the road plane world coordinates and the passed distance is estimated. The main disadvantage of this method is the unknown height of the license plate position above the road plane. This makes it difficult to calculate the passed distance accurately and adds an additional error to the speed measurement.
Some methods of optical speed measurement are based on determining the boundaries of the shadow under the car as points of contact with the road plane [3][4]. A significant disadvantage of this approach is the instability of the shadow under the car at different positions of the lighting source.
In References [5][6], a method for determining the speed when the camera is mounted perpendicular to the road is presented. Optical flow methods are used to determine the vehicle movement. The disadvantage of these methods is the atypical position of the camera, which makes it difficult to detect vehicles in the case of multiple lanes. The authors of the article [6] stated the standard error in determining the speed of 1.12 km/h. The method presented in the article [7] uses the ratio between segments in the image and in the real world that lie on the same straight line. Knowing the size of the segment in the real world, (the article uses the length between the wheels of the vehicle) you can calculate the passed distance and speed. The disadvantages of this approach are the requirement for the vehicle to move along a straight line, and the difficulty in determining the exact length between the wheels of specific type of vehicle.
A number of methods are based on binding to an object with a known size in the real world. In various articles, the binding is made to the average size of vehicles, the size of license plates and other known parameters [8][9]. In the case of the average size of the vehicles, the error is more than 10% and this case is not suitable for speed measurement. The most general method is to determine the speed by the size of the license plate, since its dimensions in the real world are known with high accuracy and in most cases plate is visible on the images. The speed measurement error of this method is evaluated in the current paper.

Materials and Methods
Vehicles move in a road coordinate system oriented so that the Z-axis is located along the road lane, the X-axis is orthogonal to it, and the Y-coordinate displays the height. If the vehicle is moving strictly along the lane, the speed value can be defined as the ratio of the change in the z coordinate to the change in time: (1) The error in speed measurement depends on the error in measuring the time of frames and the error in measuring the movement of the vehicle over a given time period. From the point of view of time measurement error, this value can be negligible, since modern cameras have a high frame rate stability. Thus, it is necessary to determine the parameters that affect the accuracy of the movement measurement. To do this, consider a pinhole camera model that describes the relationship between the coordinates of the observed point in the world M and its projection m in the image: where K is the matrix of intrinsic camera parameters, responsible for the point projection on the image plane, the R is the matrix which specifies the rotation of the camera coordinate system relative to the road coordinate system, t is the vector of translation that defines the position of the camera optical center with respect to the road coordinate system, and λ is a scale factor proportional to the distance of the observed point [10].
Translating a point from the road coordinate system to the camera coordinate system can be simplified by assuming that the beginning of the road coordinate system is located under the camera optical center: where ( , , ) -coordinates of a point in the road coordinate system, ( , , ) -coordinates of a point in the camera coordinate system, -the height of the camera above the road plane, (△ ,△ ,△ ) -indirect systematic errors of coordinate conversion, depending on the accuracy of determining the angles of pitch, yaw, and roll of the camera relative to the road plane (represented in the matrix ). Let's imagine projecting a point from the camera coordinate system onto the image plane using a matrix of internal parameters in matrix form: where ( , ) -coordinates of the point in pixels on the image, ( 0 , 0 ) -coordinates of the optical center of the image, -camera focal length in pixels. This method of speed measurement is based on binding to an object with known dimensions. As a rule, this value is the width of the license plate, which can be expressed as an equation of the distance between two points in the camera coordinate system: It is assumed that the vehicle is moving strictly along the -axis of the controlled road section, and the plane of the license plate is located perpendicular to it. In this case, 1 = 2 = . Let's express and using intrinsic camera parameters and coordinates of points on the image: Open the brackets of the root expression and square both sides of the equation: where The resulting square equation is solved with respect to ±△ : Thus, the accuracy of measuring the distance to the license plate and, subsequently, the speed is affected by the following parameters: • The focal length of the camera f. For cameras with variable focal length it is measured at the calibration stage of intrinsic parameters. • The width of the license plate in the image, expressed by the coordinates of points in pixels ( 1 , 1 ), ( 2 , 2 ). • Parameters △ , △ , △ , that determine the measurement error of extrinsic parameters of the camera: angles of pitch, yaw, and roll of the camera and its height relative to the road plane.
To analyze the effect of intrinsic camera parameters on the accuracy of speed measurement, we present ideal conditions under which the extrinsic camera parameters are determined with high accuracy. In this case, the parameters △ , △ , △ in the equation 8 can be ignored and the distance to the license plate will be calculated as follows: The distance measurement error is expressed as an indirect error that depends on the error in determining the coordinates of points in the image and the error in determining the focal length: where △ 1 , △ 2 , △ 1 , △ 2 -errors in determining the coordinates of points on the image in pixels, △ -the error in determining the focal length of the camera in pixels. Let's consider ideal conditions under which the coordinates of points and the focal length are determined with an error of no more than one pixel (the camera instrumental error). Then the absolute error of distance measurement will be equal to: where = √( 1 − 2 ) 2 + ( 1 − 2 ) 2 is the size of the license plate in the image. The value of 2 in the root expression can be ignored, since it is several orders of magnitude less than : The relative error of distance measurement will be equal to: Thus, the absolute distance measurement error depends on the focal length, and is inversely proportional to the square of the number plate size in pixels. The relative error is inversely proportional to the license plate size in pixels. The value of the displacement with respect to the error will be equal to: If you do not take into account the error in the measurement of time, it can be argued that the relative error of the speed measurement will be equal to the relative error of the displacement measurement or to the ratio of the expression in square brackets to the expression in parentheses [±]/(±): It can be shown that the relative error of speed measurement will have a minimum value with a certain ratio of the license plate sizes on two fixation frames. To do this, enter additional notation: = 2 / 1 -the ratio of the plate sizes, = 2 -the maximum size of the license plate in two frames. Then the equation 15 can be converted to the following form: The value in parentheses for = 2,415 has an optimal (minimum) value equal to 4.83. For 1 = 2 (case when the change in the size of the license plate is zero), the value = 1, and the error of speed measurement is equal to infinity. If the license plate size 1 = 0, then the value = ∞, which also leads to an infinitely large error value. Thus, the minimum relative error of speed measurement is determined only by the maximum size of the license plate in the image at the optimal ratio (2,415 times) of the maximum and minimum distances to the vehicle: For any other distance ratios, the relative error can only be greater. Figure 1 shows how many times the error of speed measurement will increase relative to the optimal one for different values of .

Results and Discussion
Using the Equation 17, one can calculate the minimum errors in speed measurement depending on the resolution of the video camera and the width of the controlled zone. If we assume that the entire width of the control area is at the bottom of the frame, then we can determine the maximum size of the license plate in pixels relative to the width of the control area N in pixels with a license plate width of 0.52 meters and a single lane width of 3.75 meters: where is the number of lanes. The calculated values of speed measurement errors for typical parameters are shown in table 1. Analyzing the obtained error values, we can conclude that to measure the speed by the size of the license plate on the video image with an error of no more than 2% (this accuracy is provided by radar technologies), it is necessary to have the number of pixels horizontally at least 2440, or the resolution of the video camera at least 3 megapixels per one road lane. It is more cost-effective to use combination of one radar and one camera with a resolution of 3-5 megapixels to control 4 lanes of traffic than to use 4 cameras with the same resolution. Moreover, the results was obtained for an idealized model, this means that intrinsic and extrinsic camera parameters are determined with high accuracy, there is no lens distortion, and the coordinates of the license plate in the image are determined with minimal error, which in practice is not so easy to achieve [11][12].
The random component of the error (inaccuracy in determining the coordinates of the license plate in the image) can be reduced by averaging the results of multiple measurements. According to the theory, the error value will decrease by the root of the number of measurements [13]. Let's estimate the error value of the speed measurement taking into account averaging for the following parameters: • The car crosses the control zone with a length of 30 meters (the nearest border to the camera is 20 meters, the farthest one is 50 meters) • Two control lanes with a total width of 7.5 meters • The horizontal resolution of the camera is 2440 pixels • The minimum and maximum dimensions of the license plate in the control zone are 67 and 169 pixels, respectively • For a single speed measurement is taken a couple of license plates with an average aspect ratio of = 1,585 .
The calculated values of speed measurement errors, taking into account averaging, are shown in table 2. Thus, increasing the frame rate of the video camera allows you to significantly reduce the error of speed measurement on the video image at low speeds, at high speeds, the error reduction due to averaging will be less. However, in real conditions, not all vehicles have a license plate recognized throughout the entire length of the control zone: vehicles may overlap each other or recognition of license plates may be difficult due to weather.
The calculations made above assume that the average speed is measured when driving the entire length of the control zone, and the speed of the vehicle is constant. If the speed is measured over separate consecutive segments, the error will increase due to a decrease in the number of frames. For example, if you measure the average speed for four separate segments, the number of frames of averaging will decrease by four times, and obviously the error will increase by two times. In fact, despite averaging, the error will increase by more than three times, since the coefficient = 2 / 1 in the equation 16 will proportionally decrease [14].
Let's evaluate the influence of the accuracy of determining the camera pitch and yaw angles relative to the controlled road section on the accuracy of speed measurement. At the first step, the evaluation for ideal conditions of camera mounting along the traffic lane is made with the following parameters: • The height of the camera mounting above the road plane is 6 meters • The camera pitch angle is 10 degrees • The camera vertical view angle is 10 degrees.
The distance from the camera to the nearest border of the controlled road section will be equal to where is the length of the control zone, △ is the change in the length of the control zone when pitch angle changes, is the pitch angle, is the vertical angle of camera view, △ is the deviation from the true pitch angle value. Thus, the error decreases with an increase in the pitch angle, but in this case the length of the control zone is reduced. This leads to a decrease in the number of frames for measurement averaging and a decrease in the value = 2 / 1 , which negatively affects the accuracy of speed measurements. For example, at pitch angle of 10° the speed measurement error is 25% per degree of deviation from the true value, at an angle of 20° the error is 10% per degree, and at an angle of 30° the error is 6% per degree. The obtained dependencies are also valid for the yaw angle of the camera position relative to the controlled road section.

Conclusion
We researched the optical method of speed measurement based on binding to the size of the license plate. We got the error values for an idealized mathematical model and showed the main factors affecting the accuracy of speed measurements [15]. Based on the results, even minimal error values achievable in ideal conditions can not be compared with the accuracy of radar technologies. The smallest error values correspond to the case when the camera is used to measure average speed over a long section of the road (for comparison, radars can accurately measure instantaneous speed).
Thus, the use of optical methods for speed measurement with radar-comparable accuracy is very limited or impossible in most cases. It is advisable to use camera only as an additional verification of the measured speed by radar. It should be noted that in many countries optical monitoring systems are allowed to be used only to detect violations of the vehicle position on the road (the vehicle did not give way to a pedestrian, passed the stop line or the red traffic light, etc.), but not to determine the speed.