## 1 Introduction
He proposed a photometric stereo method, as shown in Figure 1b, using \(m(m\quad 3)\) light sources \(L_{1},L_{2},\ldots,L_{m}\) in different directions to sequentially illuminate the same object under scrutiny and obtain \(m\) images. The \(I_{1}(x,y),I_{2}(x,y),\ldots,I_{m}(x,y)\) equations can be combined  
when \(m\) 4, the least-squares solution (Equation (7)) for the linear system in Equation (6) can be calculated and then \(\rho(x,y),N(x,y)\) can be reconstructed. \[g(x,y)=(S^{T}S)\ \ ^{1}S^{T}i(x,y) \tag{7}\]  
\[\rho(x,y)=kg(x,y)k \tag{8}\]  
\[N(x,y)=\frac{g(x,y)}{\rho(x,y)}=\frac{g(x,y)}{kg(x,y)k} \tag{9}\]  
Further, if the 3D morphology \(z(x,y)\) of the object surface needs to be reconstructed, it this can be achieved by integrating the normal vector \(N(x,y)\). The specific integration method can be found in the literature [35; 36; 37; 38; 39; 40]. However, photometric stereo reconstruction is often applied in the field of defect detection, where the object is usually an object that can move rather than a scene, and the method requires more pre-processing steps to carry out experiments, which has a greater impact on the real-time processing. Aiming at the defects and deficiencies of these existing 3D reconstruction techniques based on stereo vision, we propose a scene reconstruction method with better accuracy and real-time performance. Our contributions can be summarized as follows:  
Based on the FAST feature detection algorithm, a SAD-FAST feature detection algorithm with newer and smarter decision conditions is proposed. This algorithm changes the fixed grayscale difference threshold used by the traditional FAST detection into a self-adaptive grayscale difference threshold based on the light and dark stretch contrast of the image to avoid missing the necessary feature points and improves the feature point judgment conditions to screen the feature points with higher quality:  
In this study, the three-step correlation algorithm in the stereo-matching system based on feature points was adopted to \"select the essence and discard the dress\", and a combination method of FAST feature detection + SURF feature description + FLANN feature matching is proposed. Furthermore, the Mahalanobis distance was used to reduce the mismatching between different dimensions when matching, which ensured efficiency and accuracy when facing complex texture scenes. We propose a GVDS feature extraction algorithm to adjust the distribution of feature points, avoiding the loss of 3D information caused by the absence of feature points in part of the scene to be reconstructed and thus making the final reconstruction effect more realistic and improving the reconstruction efficiency. As can be seen, our proposed algorithms focus on the two most critical steps (stereo matching and depth value calculation) in stereo 3D reconstruction. The SAD-FAST feature detection algorithm can perfectly solve the problem that feature points are difficult to detect in weak-texture regions and can find the feature points with the strongest feature information in a certain region to solve the problem of overly dense distribution. The improved stereo-matching system had a significantly improved matching success rate and real-time performance compared to the inherent system, and it finally yielded disparity maps with good disparity in weakly textured regions without the help of hole filling or filter denoising. In the depth value calculation, our proposed GVDS algorithm could effectively avoid the loss of 3D information in weakly textured regions without neglecting the key points in regions with strong depth variations, making it possible to derive complete 3D point-cloud maps, which are irreplaceable for the generation of the final complete models. We took pictures with the stereo camera platform that we built for experimental evaluation. The experimental results showed that the proposed algorithm has strong real-time performance and robustness, and the reconstruction effect was good.