Application of Plane Homography for Vehicle Speed Calculations in Traffic Accident Investigations

The analysis of vehicle speeds at the moment of traﬃc accidents is becoming increasingly important. To solve diﬃcult calculations arising from video analysis when the shooting direction of the camera is the same as the driving direction of the vehicles, an improved plane homography method is proposed. This method is based on detecting the frame rate of and extracting all of the key image frames from a surveillance video. Next, a normalizing approach for the control points is proposed to reduce the ill-conditions of matrix calculations when the perspective image is rectiﬁed to an orthographic image. The information in the rectiﬁed image is then measured and recorded by extracting the mark point information. Finally, the corresponding curve of time and speed for the examined vehicle is created, which can be used to analyze the average braking deceleration of the accident-causing vehicle. This method can directly determine the speed of a vehicle using videos of a traﬃc accident without any reference to the dimensions of the vehicle itself. Considering an actual traﬃc accident as an example, the driving trajectories and velocity curves for two vehicles are obtained using this method. The proposed method can eﬀectively overcome the shortcomings of the commonly used speed recognition methods and it is easy to utilize.


Introduction
In recent years, although the number of road traffic accidents has been decreasing, it is still the main factor causing abnormal human deaths.
e World Health Organization claims that more than 1.35 million lives each year are lost due to traffic accidents. Road traffic injuries are the eighth leading cause of death for all age groups and are currently the leading cause of death for children and young adults aged 5 to 29 years [1]. Road accidents are influenced by many factors such as road conditions, traffic flow, and user behavior on the road. Comprehensively analyzing traffic accidents can improve the sustainability of both passenger and freight transportation.
Speeding is a critical issue in various types of fatal traffic accidents, and it requires a considerable amount of time for law enforcement officers to record evidence and measure important scene characteristics to determine the speeds of vehicles during the investigation of traffic accidents.
erefore, the capability to analyze vehicle speeds at the moment of an accident is required.
In the past, engineers and scientists have focused on the use of conservation of energy and impulse-momentum methodologies based on the damage sustained by vehicles involved in a collision. e relationship between the residual crushing of a vehicle and the related speed parameters of the vehicle, such as the impact speed, ΔV, and the equivalent barrier speed (EBS), have been previously analyzed. Randles et al. [2] found that the photogrammetric method provides better precision than hands-on physical measurements. Newer technologies such as the use of the event data recorder (EDR) function of an airbag control unit have been introduced to determine the speeds of vehicles at the moment of an accident. However, EDR data are not recorded for some accidents because the recording conditions of EDR data cannot be met [3].
Nowadays, the construction of video monitoring systems has been popularized as a deterrent to criminal acts. In addition, video monitoring networks for road traffic management are gradually being realized. An increasing number of road traffic accident scenes can be accessed from video monitoring data, which provides an intuitive factual basis for traffic accident processing. At the same time, it is becoming increasingly popular to install the car driving recorder (CDR), which can be used by drivers as visual evidence to identify the responsible party in an accident. Some pioneering studies on the determination of vehicle speed from video-derived images have been reported. Wong et al. [4] suggested a method for directly estimating vehicle travelling speeds by applying a cross-ratio to a stationary video obtained from a road traffic management system. Han [5] estimated vehicle travelling speeds in CDR videos by compositing the start and end frames of a video and estimating the distance travelled and speed of the vehicle using a calculated cross-ratio. Kim et al. [6] proposed a vehicle speed estimation method for forensic videos, which can be used to simply estimate a vehicle's change in speed in a reliable and continuous manner. Verolme et al. [7] showed that information obtained via image analysis is crucial for determining the sequence of events and the two-or threedimensional geometry of an accident. Jiao et al. [8] introduced a computer-based virtual reality method that can digitally reconstruct traffic accidents by performing a threedimensional reconstruction of accident scenes. Mieremet et al. [9] demonstrated the use of the Markov Chain Monte Carlo approach to derive probability intervals instead of confidence intervals when estimating speed from video images. A technique known as camera matching, which uses reverse projection photogrammetry applied to multiple images from a video, can be used to determine the positions of vehicles in successive frames of a video recording. is method was examined for use with a fixed camera by Fenton et al. [10] and for use with a moving camera by Manuel et al. [11], Neale et al. [12,13], and Coleman et al. [14].
However, when the shooting direction of the camera is the same as the driving direction of the vehicles, the estimation of speed via the cross-ratio becomes impossible. In addition, these studies cannot determine the track curve and measure the vehicle's moving speed within a certain frame difference in the video field by analyzing the dynamic image sequence of the traffic accident video.
In this paper, an improved plane homography method is proposed for vehicle speed determination using videos from traffic accident investigations. In this method, the detection of the frame rate and extraction of all key frame photos from a surveillance video are required. Because of the ill-conditions of matrix calculations, a normalizing approach for the control points is proposed when the perspective image is rectified to an orthographic image. en, the corresponding curve of time and speed is created based on the information obtained from the rectified image and frame rate. Finally, the braking deceleration of the accident-causing vehicle and the driver's operational processes are analyzed, which can provide a basis for a public security traffic police department to manage the accident. e remainder of this paper is organized as follows: first, a camera pin-hole model is introduced and an improved plane homography method is proposed. Using this principle, a vehicle speed calculation method is established. Next, actual traffic accident analyses are performed to demonstrate the feasibility of this method. Finally, discussions are presented and conclusions are drawn.

Plane Homography Algorithm
Assuming that the points on an image are located in the same plane in space, only a single photo is required to reconstruct a traffic accident scene. When the pixel coordinates and the space coordinates of four reference points are known and any three of these points are noncollinear, the corresponding relationship between a point on the image plane and a point in space can be determined [15][16][17].

Pin-Hole Model.
e pin-hole model is a camera model that is used in traffic accident investigations in which all the scenery in an object space is projected onto the image plane [18]. As shown in Figure 1, π is the camera image plane and O f uv, Oxy, O c X c Y c Z c , and O w X w Y w Z w , respectively, denote the pixel, image plane, camera, and word coordinate systems. e camera's optical center O c is the origin of the camera coordinate system, with shaft axes X c and Y c , that are, respectively, parallel to axes x and y in Oxy, and Z c overlaps the optical axis of the camera. e origin O of the image plane coordinate system is on the optical axis, and it is called the main point. Its pixel coordinates are (u o , v o ) in O f uv, which act as the offset values in the imaging process. e distance O c O is the focal length f of the camera. e origin O f in the pixel coordinate system is located in the upper left corner of the image, with shaft axes u and v that are, respectively, parallel to the x and y axes in Oxy.
Given a space point P, P w � [X w · Y w · Z w · 1] T are the homogeneous coordinates in O w X w Y w Z w , whose coordinate unit is the metric system. Let u f � [u · v · 1] T be the homogeneous coordinates in O f uv, whose coordinate unit is the pixel system. e pin-hole imaging model can then be represented by the following formula: where λ is an arbitrary proportion coefficient; a x , a y , c, u o , and v o describe the parameters of the relative position between the photograph center and the photos, and they represent the camera's own characteristics; r 11 , r 12 , r 13 , r 21 , r 21 , r 23 , r 31 , r 32 , r 33 , and t x , t y , and t z , respectively, denote the rotation and translation parameters from the world coordinate system to the camera coordinate system, and they represent the parameters of the photography beam in terms of spatial position and posture when photographing.

Projective Transformation.
Assuming that the space point is on a plane surface, Cartesian coordinates are established in those planes. (x, y) are coordinates used in the space plane, while (u, v) are coordinates used in the image plane. e homogeneous coordinates of the corresponding points P(x, y) and I(u, v) are, respectively, set as follows: for ∀s ≠ 0, define p � (x s , y s , s)T and for ∀t ≠ 0, Projective transformation is a reversible homogeneous linear transformation on the projective plane, which can be described by a 3 × 3 matrix: where H is referred to as the projective transformation matrix. Because the transformation is homogeneous, the same projective transformation matrix H can differ with a nonzero constant factor. Using the third row of equation (2), solving for t yields Because t and s are nonzero scaling constants, an inspection of equation (3) reveals that we can set h 33 � 1 without the loss of generality, and therefore the projective transformation only has eight unknowns that are, h 11 , . . ., h 32 .

Four-Point Calculation.
By taking the first and second lines and dividing them by the third line of equation (2), the following solutions are obtained: Simplifying and rearranging equation (4) gives To solve for the eight unknowns h 11 ,. . .,h 32 of the projective transformation matrix H, equations are deduced using four pairs of object points P k (x k , y k ) and image points Let the vector h�(h 11 According to equation (5), the matrix equations can be written as follows: where the matrix is After the values of vector b and matrix K are calculated using P k (x k , y k ) and I k (u k , v k ), the value of vector h can be calculated by solving equation (6), and the projective transformation matrix H can thereby be constructed.

Normalization Processing.
When computing the true values of an object point P(x, y) and an image point I(u, v), these coordinates can be large numbers with units of pixels, meters, and so forth. Large coordinate values can cause K to be ill-conditioned, and different units of measurement systems can lead to data inconsistencies, which affect the accuracy of image rectification. To avoid these problems, before using equation (6) for calculations, the coordinate values of the object point and image point should be normalized using translation and scaling transformations [19], as shown in Figure 2. e translation transformation involves using the center of the four selected pair points as the origin and creating a coordinate system from this origin. en, the coordinates of each point are converted using the following equation: Figure 1: Pin-hole imaging principle diagram.

Mathematical Problems in Engineering
where the number of selected points is 4 and e scaling transformation involves choosing an isotropic scaling factor to maintain the consistency of the coordinate transformations such that the average distance of each point from the origin is equal to � 2 √ . is means that the "average" point is equal to (1, 1). e scaling coefficients C P and C I can be calculated as follows: e coordinates of each point are given as follows, following the scaling transformation:

Vehicle Speed Calculations
e speed of a vehicle can be determined by determining the difference in the positions of the vehicle in question: In equation (11), v is the vehicle speed, L is the distance of the test vehicle between the first and second shots, and T is the time between the first and second shots. e time used in equation (11) is the time between successive analyzed video sequence frames. Typically, this is a speed of 25 to 30 frames per second (FPS). Next, all of the key frame photos of the video are extracted using video processing software. In addition, the total times of the photo groups can be determined from the frame rate information of the video.
After obtaining the relevant photos from the video of a traffic accident, the mark points on the images must be selected. For example, the contact point between the vehicle's wheel and the ground could be selected in all extracted photos. en, the mark points are stored in pixel positions of each photo to form the pixel coordinate points group of vehicle driving. Using the plane homography algorithm, a two-dimensional reconstruction map of all marked points can be obtained via orthographic projection. is can be used to create the driving trajectory.
Using equation (11), the vehicle speed can be calculated. We can then create a curve of the time and speed by fitting the velocity values. e overall vehicle speed calculation method may be summarized as follows: (1) Determine and record the frame rate of the surveillance video. (2) Extract all the key frame photos in the surveillance video using video processing software. (3) Select four pairs of space points P k (x k , y k ) and the corresponding image points I k (u k , v k ) in the space plane and camera digital image plane, respectively, wherein no three points are collinear. (4) Perform normalized processing on P k (x k , y k ) and I k (u k , v k ) to obtain P Ck (x Ck , y Ck ) and I Ck (u Ck , v Ck ) using equations (8)

Results
e proposed method was applied to real-world traffic accident cases to validate the method's usability.
A traffic accident that occurred in 2015 was considered. An ambulance and an electric bicycle collided with one another in this traffic accident. A surveillance video of the incident was captured by a camera near the scene, which revealed that the ambulance was preparing to turn left when travelling through the intersection from north to south as the electric bicycle was turning left. en, the accident occurred. Figure 3 shows an image frame from the footage captured during the accident by a surveillance camera. e footage was found to have a frame rate of 25 FPS. To determine their driving statuses, the two vehicles' moving pathways must be accurately determined. As shown in Figure 4, an X-Y Cartesian coordinate system was designed with known dimensions because the location and size of the crosswalk lines at the scene are fixed. e control point "0" is the origin of the diagram. e direction from point "0" to point "1" denotes the direction of the X-axis, and the direction from point "0" to point "3" denotes the direction of the Y-axis. e coordinates of the four control points in the field are listed in Table 1.

Ambulance Analysis.
e footage of the collision process is converted into a key frame photo every three frames, which has a time interval of 0.12s, as shown in Figure 5. Next, relevant information from the accident scene can be reconstructed in two dimensions via the projective transformation matrix H, which is calculated by substituting the above coordinates and the pixel coordinates of the four control points in the photo into equation (5).
Image rectification is then performed using a plane homography algorithm for each photo. e rectified images are shown in Figure 6, which clearly show the movement of the ambulance in the accident. Moreover, the distances between two points in the image can be measured. rough careful observation, the middle point of the ambulance roof warning light was selected as the mark point. ese mark points are then marked on each image. A composite image is created from the sixteen images by stacking them together, as shown in the leftmost image of Figure 7. In addition, the trajectory of the ambulance can be extracted to form a single picture, as shown in the rightmost image of Figure 7.
Finally, the distance travelled by the ambulance between any two points is calculated. Using the total time indicated by the video frames, the speed of the ambulance can be calculated. A scatter diagram of the ambulance driving velocity can then be obtained, as shown in Figure 8.
To clearly express the motion process, the velocity curve is drawn using meters per second, and a linear equation is used to regress the speed data to obtain a motion equation for each motion process.
When the ambulance appears in the surveillance video, the time is 2.00 s, the speed is approximately 19.58 m/s, and the speed in the second key frame image is approximately 19.51 m/s at the time of 2.12 s, as shown in Figure 9. e ambulance is therefore slowly decelerating at a rate of −0.5833 m/s 2 . In the third key frame image, the time is 2.24 s, wherein the speed drops to approximately 18.45 m/s, indicating that the braking system has been activated, as shown in Figure 10. erefore, we can infer that the ambulance driver should have been pressing the brake pedal when the electric bicycle can be seen. At this point, the braking deceleration rate is −4.6890 m/s 2 . However, it is too late because the distance between the ambulance and bicycle is too

Electric Bicycle Analysis.
Using the same method as that used to analyze the ambulance, a composite picture can be created and the trajectory of the electric bicycle can be extracted to produce a single picture, as shown in Figure 11. In addition, the scatter diagram of electric bicycle driving velocity can be obtained, as shown in Figure 12.
When the electric bicycle appears in the surveillance video, the time is 0.20 s and its speed is about 3.67 m/s. When the time is 1.04 s, the speed is approximately 4.01 m/s, as shown in Figure 13. During this time period, the electric bicycle is slowly accelerating at a rate of 0.3046 m/s 2 . Next, the driver of the electric bicycle sees that the vehicle next to it has stopped and wants to accelerate through the intersection, as shown in Figure 14. At this point, the acceleration is 3.8750 m/s 2 .
When the time is 2.12 s, the speed reaches its maximum value, which is approximately 6.23 m/s, as shown in Figure 15. e driver then suddenly slows down to about 5.08 m/s at 2.48 s and to 4.41 m/s at 2.60 s as the driver sees the ambulance coming quickly from the front left of the bicycle. e braking deceleration rate is −3.808 m/s 2 at this point. However, the electric bicycle cannot stop at this point because the distance is too small, and it collides with the ambulance. In the accident report, the speed of the ambulance hitting the electric bicycle is approximately 60 km/h, which is verified to be 16.67 m/s through a field measurement verification. e method described in this paper provided values of between 17.45 and 16.97 m/s, which is consistent with the results measured in the accident report with errors of 4.6% and 1.7%, respectively.

Discussion
Using the method of plane homography for the determination of vehicle speeds in a traffic accident investigation, only the coordinates of the four points in the field are required, which is mathematically the simplest formulation that can be constructed for planar analysis. By analyzing the video frame resolution and determining the related time intervals, the application of plane homography for vehicle speed determination can be used to obtain not only the vehicle motion parameters, such as speed and displacement, but also the change of the motion state of a vehicle, including its acceleration and braking deceleration. is can be used to directly determine the speed of a vehicle from videos of a traffic accident without any reference to the dimensions of the vehicle itself at the scene. In addition, the velocity values and fitting curves may be obtained, as shown in Figures 9,10,[13][14][15] is method may also be used to qualitatively create a composite image of the accident scene from the rectified images by stacking them together and forming a single trajectory picture, as shown in Figure 16. e accident scene and driving trajectories of the vehicles can be clearly seen from a vantage point above the accident, which may be drawn by hand using traditional methods.
Moreover, we compared our method with other approaches mentioned in previous references [5,6] for vehicle speed estimation, as shown in Table 2. It can be seen that the proposed method provides excellent accuracy in terms of vehicle speed estimation, which is well within the accuracy acceptable for traffic accident investigations.
ere are several guidelines for the selection of the control points. First, all control points must be seen in the image and space planes. Second, no three of the four control          points should be collinear. Furthermore, this method can also correctly reflect the perspective projection relationship between a spatial plane and the image plane of an entire scene, which requires four control points to cover the area of interest. erefore, the accuracy of the results will be reduced when the area of interest is far away from the area covered by the four control points of the accident.

Conclusions
When the shooting direction of a camera is the same as the driving direction of vehicles in a surveillance video, the determination of vehicle speeds from such videos is difficult. To solve this problem, an improved plane homography method was proposed in this study. e time between a key image frame from a surveillance video was calculated by first detecting the frame rate. After extracting all of the key image frames from the surveillance video, the same four control points were used in each photo to determine a projective transformation matrix. Next, the perspective photo was rectified to an orthographic image. Finally, the corresponding curve of time and speed was created based on the information provided by the rectified image and frame rate. Using this method, the braking deceleration of an accident-causing vehicle may be analyzed. An actual traffic accident was examined to demonstrate the feasibility of the proposed method. e relative error obtained using the planar homography method was consistent with the results of the accident reported via field measurement verifications.
is proposed method could provide a better method for the public security traffic police department to investigate such accidents. It should be noted that a large shooting angle of the surveillance video should be utilized to ensure that the analysis results are as accurate as possible when using the proposed method. e accuracy of photogrammetric methods is generally influenced by the quality (resolution, distortion, etc.) of the key frame images. In the future, an uncertainty analysis of the proposed method should be considered.  Data Availability e data used to support the findings of this study are included within the article and are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.