## 4 Experiment and Application: Lane-Level Trajectory Matching
### Lane-Level Trajectory Matching
#### 4.2.1 Trajectory Matching in Road Segment Domains  
Assuming that the starting lane of the collected trajectory is known, the trajectory points are searched according to the trajectory point time collection order. When a smart  
Figure 8: Road division and road centerline extraction.  
Figure 9: A lane-level road network in Pingshan, Shenzhen.  
vehicle is driving along a road segment, if a lane change behavior is detected, towards which direction this lane change behavior occurs should be determined. While driving along a road segment, the vehicle's trajectory is composed of lane change trajectory and lane keep trajectory. Figure 10 describes vehicle trajectory characteristics under the left lane change condition and the right lane change condition.  
In the present work, Bezier curves are used for the vehicle lane change trajectory model. The Bessel curve is used to smooth the trajectory connecting the start and end of the trajectory, which can represent a clear and simple relationship between the input control points and the generated curve, ensuring the smoothness, continuity, and controllability of the generated curve [36; 37]. Considering that higher-order curves have higher computational costs, this paper adopts third-order Bezier curves to make the path curves more flexible and easier to realize the matching of the change of path trajectories.  
Based on the lane change trajectory markers provided by the smart vehicle, two trajectory start points and two endpoints are selected as the control points of the trajectory change model in the trajectory change. The coordinates of each point on the third-order Bezier reference curve can be obtained using the following Equation (11):  
\[B(t)=P_{0}(1-t)^{3}+3P_{1}t(1-t)^{2}+3P_{2}t^{2}(1-t)+P_{3}t^{3} \tag{11}\]  
where \(B(t)\) denotes the lane change path, \(t\) denotes the time taken from \(P_{0}\) to \(P_{3}\), and \(P_{0}\), \(P_{1}\), \(P_{2}\) and \(P_{3}\) denote the four required control points.  
The control point \(P_{1}\) can be expressed as Equation (12):  
\[P_{1}=(x_{i},\;y_{i}) \tag{12}\]  
where \(x_{i},\;y_{i}\) denote the horizontal and vertical coordinates of control point \(P_{1}\).  
As shown in Figure 11, the shape of the cubic Bessel curve is controlled by the four points \(P_{0}\), \(P_{1}\), \(P_{2}\), and \(P_{3}\). The curve starts from \(P_{0}\), moves towards \(P_{1}\) and reaches \(P_{3}\) from the direction of \(P_{2}\). The ends of the curve are determined by the start position \(P_{0}\) and the end position \(P_{3}\) of the vehicle lane change behavior. Control point \(P_{1}\) and control point \(P_{2}\) provide directional information and change the shape of the curve. The best matching result is achieved by setting the distance between \(P_{0}\) and \(P_{1}\), \(P_{2}\) and \(P_{3}\) to set the channel change trajectory.  
For lane-keeping trajectory points on the road segment, the lanes that the trajectory points should be in are judged according to the start point of the vehicle and whether the lane-changing behavior occurs, and the trajectory points are matched to the centerline of the corresponding lane by orthogonal projection.  
Figure 10: The direction of a lane change.