## 3 Method
### Depth Estimation of Light Fields Considering Blur Features and Prior Knowledge
#### 3.2.2 Depth Estimation Optimization Process Considering Prior Knowledge
Initially, during the matching process, we assign appropriate weights to each pixel in the window based on the completeness of the matching window. Completeness refers to whether all the pixels located within the window are present in the target microimage. As illustrated in Figure 9, for a complete blue pixel window, the matching results produced for the pixels inside the window are generally more reliable; therefore, these pixels receive higher weights. Conversely, for a window with missing pixels (represented in red), lower weights are assigned. This approach ensures that more trustworthy pixels play a more significant role in the cost aggregation process, whereas unreliable pixels have a reduced impact on the final matching results. Through this strategy, which is based on completeness and weight distribution information, we can dynamically adjust the influence of each pixel involved in the cost calculation. In regions with high window completeness, the accuracy of the matching cost updates is enhanced, leading to improved overall matching precision. During the iterative propagation process, the weight distribution is gradually adjusted with each iteration, ultimately stabilizing the pixel matching costs and achieving more accurate matching results. Figure 9: Matching window completeness. The black wire frame represents a micro image, the blue and red photo frames represent the matching window, and the blue photo frame belongs entirely to the black photo frame. The red dashed wireframe is not in the image; it is incomplete. (3) Optimization Step Based on Epipolar Geometry Relationships:  
Owing to the limited numbers of pixels contained in microlens images and the prevalence of areas with weak textures, a significant number of mismatches can occur during the stereo matching process. To eliminate these mismatches, we propose a geometric consistency checking algorithm based on the epipolar geometry relationships of the microimages. In the context of the depth estimation process employed for focused light field images, the relative positions of the microlenses are fixed and aligned, allowing us to leverage the geometric relationships of the microlenses to find corresponding image points. By examining the disparity differences between corresponding points, we can effectively eliminate mismatches, significantly reducing the computational load imposed by projection transformations and improving the accuracy of the mismatch removal procedure. To obtain the disparity map of the initially computed raw light field image, we perform geometric consistency checks on each microlens disparity map II. To ensure that we include all the pixels contained in the microlens disparity maps, as shown in Figure 10, we use the six microlens disparity maps with the shortest baselines I\({}_{i}\)(where (i \(\in\) (1-6))) as neighbors for mismatch elimination. First, we calculate the epipolar lines for each pair of microlens images \(\stackrel{{\rightarrow}}{{\mathrm{u}}}\), and then, for each pixel point p in I, we determine the corresponding point q\({}_{i}\) in the neighboring image I\({}_{i}\). Given that the disparity for point p is q, if d\({}_{\mathrm{P}}\) is not zero, we compute the corresponding point q. By comparing the disparity values d\({}_{\mathrm{P}}\) for points p and q, we evaluate the reliability of the disparity value for obtained the target point. The evaluation criteria are as follows:  
\[\mathrm{N=}\sum_{0}^{i}\mathrm{H(d_{P}-d_{\mathrm{P}i})}\mathrm{H(x)= \begin{cases} 1&\text{if $|x|\leq\mathrm{T}$},\\ 0&\text{if $|x|>\mathrm{T}$},\end{cases} } \tag{8}\]  
In the above equation, T represents the disparity threshold, and N denotes the number of times the disparity satisfies this threshold. If N < 2, the disparity value of the pixel point p is considered unreliable, and it is eliminated, resulting in d\({}_{\mathrm{P}=0}\).