## 2 Stereo Reconstruction Algorithm for Unstructured Scenes
### GVDS Feature Extraction Algorithm
The distribution of feature points is closely related to the environment to be reconstructed, and unstructured scenes are often in natural environments with different distributions and intensities of texture information, which can easily lead to too dense or sparse a distribution of feature points, and this can affect the accuracy of subsequent texture mapping. Therefore, the distribution of the extracted feature points should be focused on before the depth values are calculated. First, the feature points should be extracted in the region where the depth information varies widely: that is, the feature points of excellent quality should be selected. Second, the distribution of feature points should not be too dense. Third, some feature points should also be extracted from the regions with weak depth variation. Based on the above idea, we propose a homogenized feature extraction algorithm with gradient value decreasing step by step (GVDS), and the calculation steps for this algorithm are as follows:  
1. Set the total number of feature extraction points as \(N\), the number of feature points with strong depth variation as \(I\), the shortest Euclidean distance between adjacent feature points as \(d\), and the disparity map derived from stereo matching as \(P\);
2. Calculate the gradient value for the disparity map \(P\), and then the point \(C_{1}\) with the largest gradient value can be found, which is the first feature point selected;
3. In order to avoid too dense a distribution of feature points, the gradient of the surrounding pixels within a certain range should be set to zero after a feature point is selected. In the disparity map \(P\), the gradient-zeroing operation is carried out in the surrounding area with point \(C_{1}\) as the center of the circle and \(d\) as the radius;
4. Repeat steps (2) and (3) until the number of selected feature points is not less than \(I\);
5. Feature point extraction is performed for the remaining scattered regions with low depth variation in the disparity map \(P\). A pixel coordinate in the disparity map \(P\) is defined as \((d,d)\) so that it traverses the region with a non-zero gradient value starting from the top left of the disparity map \(P\). If the gradient values of the pixels with distances of \(d\) in the top, bottom, left, and right directions are not zero when the traversal reaches a certain point, the point is selected as the feature point and is called \(C_{2}\);
6. The gradient of the surrounding area with point \(C_{2}\) as the center and \(d\) as the radius is set to zero;
7. Repeat steps (5) and (6) until the total number of feature points that have been selected is \(N\). The schematic diagram for the GVDS algorithm is shown in Figure 7. In order to obtain a better reconstruction effect, the GVDS feature extraction algorithm considers that the feature points are best taken in regions with strong depth variations, and the gradient-zeroing operation also avoids a dense distribution of feature points, while some feature points are further extracted in flat regions with weak depth variations.