## 3 Pose Optimization Based on Point-Line Features  
### Line Feature Tracking and Outlier Rejection  
Line features are essential in visual SLAM, especially for sparse situations, as they offer more comprehensive geometric information than point features. This article utilizes the LSD (Line Segment Detector) algorithm for line feature extraction, ensuring high precision and a robust real-time performance, which is essential for SLAM systems in dynamic situations. In contrast to point features, line features are higher-dimensional geometric entities encompassing attributes such as length and angle, which are crucial for target tracking and map generation.  
This research improves the accuracy and reliability of in-line feature matching by utilizing geometric restrictions. To maintain angular consistency between matched line segments, we impose an angular constraint stipulating that the angle difference between two potential matching line segments must not be above a certain threshold, \(\alpha\), as follows:  
\[|\theta_{1}-\theta_{1^{\prime}}|<\alpha \tag{1}\]  
This constraint ensures spatial directional similarity between the corresponding line segments, thus enhancing the matching accuracy. This study adds a length similarity constraint to ensure consistency in line segment lengths, stipulating that the length ratio of matched line segments must surpass a predetermined threshold, \(\beta\). This constraint efficiently prevents false matches due to scale discrepancies, hence improving the stability and reliability of line feature matching.  
\[\frac{\min(|l_{1}|,|l_{Y}|)}{\max(|l_{1}|,|l_{Y}|)}>\beta \tag{2}\]  
This limitation efficiently mitigates discrepancies arising from scale variances. The location of line segment midpoints is a crucial geometric constraint, necessitating thatthe distance between the midpoints of corresponding line segments remains below a predetermined threshold, \(\gamma\), as follows:  
\[|M_{1}-M_{1^{\prime}}|<\gamma \tag{3}\]  
The previously specified geometric limitations for minor camera motions often guarantee dependable matching. In significant camera movements, such as transitions between keyframes, geometric constraints may prove inadequate for ensuring stable matching. This study introduces the Line-Based Descriptor (LBD) to improve matching reliability and robustness. This study utilizes the MAD (Median Absolute Deviation) approach to mitigate accuracy degradation resulting from mismatches by eliminating potential false matches. Initially, we compute the rotation angle, \(\varphi_{i}\), for each corresponding pair of aligned line segments, as follows:  
\[\varphi_{i}=\arctan(\frac{v_{i^{\prime}}-v_{i}}{u_{i^{\prime}}-u_{i}}) \tag{4}\]  
Subsequently, we employ the MAD approach to compute the divergence of the rotation angles for each pair of corresponding line segments to detect and eliminate possible mismatches. The Mean Absolute Deviation (MAD) is delineated as follows:  
\[MAD=median(\varphi i\ -median(\varphi)) \tag{5}\]  
If the rotation angle of a pair of line segments deviates from the mean by more than the standard deviation, \(\delta\), this match is deemed a mismatch and is discarded. This strategy has significantly enhanced the resilience of line feature matching in practice, mitigating the effects of mismatches.