## 3 Method
### Neighborhood Microimage Selection Under Multiple Constraints
#### 3.1.3 Ambiguity Constraint  
The ambiguity constraint uses gradient analysis to assess image sharpness and identify microlenses with varying blur levels for neighborhood selection. The ambiguity constraint refers to an image sharpness assessment implemented through gradient analysis to determine the microlenses with varying degrees of blurriness that should be included in the neighborhood. Microlenses with the same focal length (such as those in Figure 5, which have the same color as that of the reference microlens) exhibit consistent levels of blurriness, which can provide a more reliable basis for matching. To optimize the microimage selection process, we categorized the microimages within the baseline range based on their degree of blurriness, prioritizing images that have the same level of sharpness as that exhibited by the reference microlens. To achieve this, we compute a blurriness score for each image by statistically analyzing the gradient magnitudes of the neighboring microimages relative to the reference microimage. Sharp images have big changes, while blurry ones have small changes. A scoring function combines this blur score with photometric consistency to determine blur levels. To determine the blurriness levels of different microimages, the overall gradient distribution \(\mathrm{G_{i}}\) of each microimage is calculated using the Laplacian operator. The gradient  
Figure 4: Relationship between the overlapping regions of different microimages and their disparity \(d_{p}\). The two blue circles are two different microimages. Figure 5: Arrangement of microlenses in a multifocal light field camera, with three different colors representing three types of microlenses. variance \(\text{Var}(\text{G})\) is computed via Formula (4), and the blurriness score \(\text{C}_{\text{pi}}\) is derived according to Formula (5). \[\text{Var}(\text{G})=\frac{1}{\text{N}}\sum_{i=1}^{\text{N}}\left(\text{G}_{i}- \overleftarrow{\text{G}}\right)^{2}, \tag{4}\]  
\[\text{C}_{\text{pi}}=1-\frac{\text{Var}(\text{G})}{\text{G}_{\text{Max}}}, \tag{5}\]  
Here, \(\text{G}_{\text{Max}}\) represents the maximum gradient variance observed within a set of images and indicates the clearest image. If \(\overline{\text{G}}\) is below the threshold \(\text{T}_{\text{G}}\), the score approaches 1, indicating that the image is blurry; if \(\overline{\text{G}}\) is above \(\text{T}_{\text{G}}\), the score approaches 0, indicating that the corresponding image is clear. On this basis, the blurriness of the microimages contained within the neighborhood is determined, enabling the selection of microimages across different blurriness categories, as shown in Figure 6, three colors are used to represent microimages with three blur levels. Furthermore, by considering both the blurriness score \(\text{C}_{\text{pi}}\) of each microimage in the neighborhood and the number of matched feature point pairs \(\text{num}(\text{I},\text{I}_{\text{i}})\), a model for evaluating the blurriness of the microimages is constructed. This model considers not only the overall blurriness of the images but also the reliability of the feature point matches. The blurriness score \(\text{C}_{\text{pi}}\) measures the extent of local gradient changes in the examined image, reflecting the sharpness of the image, whereas \(\text{num}(\text{I},\text{I}_{\text{i}})\) indicates the number of feature point matches, representing the textural degree of the overlapping area of the images. A scoring function is developed on the basis of these two factors, with the following calculation formula:  
\[\text{F}(\text{I}\text{I}_{\text{i}})=\alpha\cdot\text{num}(\text{I}\text{I}_{ \text{i}})+\beta\cdot\frac{\sum_{0}^{n}\text{C}_{\text{pn}}}{\text{num}(\text{ I}\text{I}_{\text{i}})}, \tag{6}\]  
In the above formula, F is the scoring function, I is the reference microlens image, I\({}_{\text{i}}\) is the microimage within the baseline range, and \(\alpha\) and \(\beta\) are weight parameters. Figure 6: Neighborhoods of images with different blur levels.