## 3 Vehicle Pose Estimation Method
### Parameter Optimization  
When the current frontal and host vehicles are on the same ground and the pitch angle is fixed, the camera's mounting height can be inserted into Equation (1) to calculate the longitudinal vehicle distance \(D_{1}\), which can be used to optimize other vehicle structural parameters such as height, width, and offset. When \(D_{1}\) is accurate, given that the true width of the target vehicle is \(\overline{W}\), and the initial vehicle width with a certain error is \(W^{*}\), then Formula (2) can be calculated as:  
\[\eta=\frac{\Delta D_{1}^{i}}{\Delta D_{2}^{i}}=\frac{D_{1}^{t+i}-D_{1}^{t}}{D_ {2}^{t+i}-D_{2}^{t}}=\frac{\frac{f^{\overline{W}}}{u^{\overline{W}}}-\frac{f ^{\overline{W}}}{u^{\overline{W}}}}{\frac{f^{\overline{W}}}{u^{\overline{W}}} -\frac{f^{\overline{W}}}{u^{\overline{W}}}}=\frac{\overline{W}}{W^{*}} \tag{15}\]  
where \(D_{1}^{i}\) and \(D_{1}^{t+i}\) are the distances calculated by Formula (1) in frames \(t\) and \(t+i\), and \(D_{2}^{t}\) and \(D_{2}^{t+i}\) are the distances calculated by Formula (2). When the errors in Formulas (1) and (2) are small, the ratio of the vehicle distance variation \(\eta\) shall be exactly equal to the ratio between the true and initial vehicle widths. When frontal vehicles are flush with the host, that is, \(l_{k}\approx 0\), the reliability of the current \(D_{1}\) sequence is judged by the probability distribution of the \(\eta\) sequence for detecting a stable reference vehicle distance to correct the initial ranging parameters.  
As shown in Figure 7, the distance variation sequence \(\Phi=(\Delta D_{1}^{i},\Delta D_{2}^{i})_{i\in\{1,2,\ldots k\}}\) is calculated in the given image sequence \(  
prior dataset \(U\). By employing the aforementioned methodology, it becomes possible to efficiently filter out unforeseen sequences characterized by significant fluctuations in the distance change ratio. This proactive filtering process effectively mitigates the perturbations introduced by variations in pitch angles. Upon successfully identifying the reference distance sequences, the subsequent phase involves optimizing unknown parameters.  
Given an accurate reference distance, the unknown parameters of the vehicle structure can be corrected. Assuming the true ranging sequence is \(\{D_{1},D_{2},.D_{i}\dots,D_{t}\}\), take Equation (2) as an example and let \(x=1/w\); then, the optimal vehicle width and offsets can be calculated by minimizing objective function \(J\):  
\[J=\sum_{i=1}^{t}{(fW\times x_{i}+k-D_{i})^{2}} \tag{17}\]  
Calculate the partial derivative of \(J\) with respect to \(fW\) and \(k\) and set \(A=\sum x_{i}^{2}\), \(B=\sum x_{i}\), \(C=\sum x_{i}D_{i}\), \(E=\sum D_{i}\); then, the target parameters can be calculated as follows:  
\[\left\{\begin{array}{l}W=\frac{(Ct-BE)/(At-B^{2})}{f}\\ k=(AE-CB)/(At-B^{2})\end{array}\right. \tag{18}\]  
Following the calculation of other structural parameters using similar techniques, a robust estimation of the distance between the camera and the edge points becomes feasible through the utilization of two measurement models. When the bottom edge points are obstructed or offer minimal texture cues, the viability of the middle or top edge points as alternatives becomes evident. In cases involving camera pitch\(-\)angle variations, the vehicle distances derived from Formula (2) provide heightened precision. Additionally, the pitch angle can be reverse\(-\)calculated using Formula (1). Ultimately, the yaw angle of the target vehicle can undergo further refinement based on the calculated values from \(I_{c}\), facilitated through the application of Formula (3).  
Figure 7: Probabilistic estimation \(\eta\) of distance variation ratio for vehicle \(i\) in the reference variation queue from \(r\). The valid distance \(\Delta D_{1}\) and \(\Delta D_{2}\) have a similar ratio between reference frames \(t\) and \(t+k\). The frames are the vehicle cut\(-\)in process in a pose state between reference frames \(t\) and \(t+k\).