# All-in-Focus Three-Dimensional Reconstruction Based on Edge Matching for Artificial Compound Eye
## 5 Experiments
### Evaluation
#### 5.2.4 Image Reconstruction  
The reconstructed image is evaluated in this section. The test sub-image arrays after correction are shown in Figure 13, and the objects in the experiment are located at different distances. Figure 14 compares the all-in-focus reconstructed image of our method with images that are focused on a specific distance. As shown in the figure, if the reconstruction is focused only on a certain distance, objects located at other distances will appear out of focus and become blurry. However, by combining the distances during reconstruction, the reconstructed image will be all-in-focus. Figure 11: Edge depth comparison the depth of the blue box in (**a**) is highlighted in the red box of (**b–d**). Upper: sub-image of channel (6,6), Bottom: sub-image of channel (3,2). (**a**) Target sub-image for matching located in the central, and four neighboring sub-images, (**b**) edge depth map with Census+SC, (**c**) edge depth map with only the Census operator, (**d**) edge depth map with only the SC operator. Figure 12: eCley sub-image array depth map. (**Left**) Sub-image array. (**Middle**) Depth map after edge depth propagation. (**Right**) Depth map after depth refinement. Figure 14: Image reconstruction, the red solid, dashed, and dot boxes are objects or patterns located at different distances. From top to bottom: Focus on far object, focus on middle distance object, focus on near object, all-in-focus image by our method, depth map of the reconstructed image. Figure 13: Test sub-image arrays captured by the eCley. The reconstructed images are compared with three methods (BP [6], Cost Filter [8], and G3D [41]). The images and corresponding quantitative evaluation results are shown in Figure 15 and Table 2, respectively. To better visualize the result of Table 2, Figure 16 shows the result in a histogram. It is evident from the results that EdMP outperforms the other methods in terms of all the metrics, except for the metrics \(D_{b}\), \(D_{s}\), and \(D_{p}\) of sub-image 1. This indicates that EdMP is capable of reconstructing images with the best definition. The reconstructed image in Figure 15, especially the details shown in the bottom row, also demonstrates that EdMP yields the sharpest images. To evaluate the computational complexity of the proposed method, all the methods are tested on a HP laptop with Intel Core i5-3210M 2.5 GHz CPU (Intel, Santa Clara, CA, USA) and Matlab2018b (version 9.5.0.944444), and the average execution times of these four methods are listed in Table 3. G3D projects the sub-image directly into space to obtain pixel depth information, so the G3D method is the most efficient. EdMP is slightly slower than G3D due to the need for neighboring sub-image matching, but the method is significantly more efficient compared to Cost Filter and BP. After the image is reconstructed, it is re-projected using the depth map to create a 3D point cloud map. The point cloud maps are shown in Figure 17. Based on the red box of images, the 3D point cloud created by EdMP is the most complete among the four methods for different objects. This indicates that the reconstructed images of EdMP have the most accurate depth information.