In this Section the accuracy of the designed filters was determined by using them to measure a known distance. In experiments 1 and 3 the results are compared with Watanabe and Nayar‟s filters and in experiments 2 and 4, since the defocus setting was changed from that of Watanabe‟s, a new set of filter coefficients was determined. In all the experiments the depth estimation results along with RMS error plots are provided. For these experiments a checkerboard image was used as the test pattern. Experiments with natural textures are presented in chapter 6.
4.8.1. Experiment 1- with defocus condition 2.307 pixels
The apparatus included a 50mm photographic quality lens with an external aperture diameter set to 6.5mm, and a monochrome camera with a CCD sensor of pixel size 7.4 x 7.4m. To enable a useful accuracy comparison with Watanabe [14], the defocus condition was set to pixels
Fe e
307 . 2
. Based on Appendix3, the working
range was calculated to be 56mm, this is quite short but it is limited by the pixel size of the camera and the aperture set. A larger pixel size or a narrower aperture would have provided an increase in the working distance. The far-focussed image was set at 800mm and the near-focussed at 744mm. A checkerboard pattern was moved along the optical path between these points and a pair of defocused images was recorded at every 10mm interval. The normalised mean depth was calculated and mapped to the real world coordinates using the Gaussian lens law.
Figure (4.21a) shows the plots of the actual and the estimated depth. For these results, a centre offset correction was performed to compensate for the experimental error while determining the centre of the compound lens. A detailed description is given in Appendix 4. The RMS error plot for the depth range is shown in Figure (4.21b). The RMS error for the new method was 0.6122% at the far-focussed and 0.6516% at the near-focussed planes, and for Watanabe the errors were 0.9321% and 0.98425% respectively. From the plots it is seen that the depth estimates are reasonably linear but the filters designed using the Two Step Polynomial Approach provided a better fit to the actual depth compared to the Watanabe filters.
4.8.2. Experiment 2- with defocus condition 2.3587 pixels
In the second experiment the working distance was extended to 140mm by setting a smaller aperture of 2.27mm. The far-focussed and the near-focussed images were at 800mm and 660mm respectively, and the defocus condition based on Appendix3
was e 2.3587pixels
Fe . The parameters are summarised in Table 4.3 and a new set of filter coefficients were designed and used for depth estimation. For this defocus condition there were no Watanabe‟s results available for comparison.
Defocus condition e pixels Fe 1 2 min s fr k pixel 1 maxfr 0.73Fe e pixel Max blur diameter 2 0.73 s e k Fe pixel 2.3587 e pixels Fe Focal length, f =50mm Kernel size ks=7 Aperture diameter=2.27mm 51.891 22 0.2857 0.3107 4.7174
Table 4.3: Calculated values for the defocus condition 2.3587
e
pixels Fe
Figure 4.22a: Actual Distance vs. Estimated Distance (mm)
Figure 4.22b: Actual Distance vs. RMSE (mm)
Again the square pattern was moved in steps of 10mm along the optical axis and the normalised depth was calculated from the two defocused images. Figure (4.22a) shows the plot between the actual and the estimated depth, and the plot in Figure (4.22b) shows the RMS error estimated at the individual distances. The RMS error with respect to the distance from the lens was between 0.8310% and 1.8427%. The increase in RMS error can be attributed to the increase in working distance and to the decrease in aperture size which results in darker images. The sharp increase in RMS error at distances of 790mm and 690mm coincides with the theoretical model as shown in Figure (4.11). The distance of 730mm corresponds to the centre of range where normalised depth was zero.
4.8.3. Experiment 3 - with defocus condition 2.307 pixels
In the third experiment a 35mm photographic lens was used and the external aperture
set to 4.55mm giving the defocus condition pixels Fe
e
307 . 2
. Here the results were
compared with Watanabe‟s filters. The working distance calculated based on the procedure in Appendix3 was 107mm; the far-focussed image was set at 800mm and the near-focussed image at 693mm. The normalised depth was calculated at 10mm intervals. Figure (4.23a) shows the plots of the actual and estimated depths for Watanabe‟s filters, and for the filters designed by the new method. The RMS error
(refer Figure (4.23b)) was plotted with respect to the distance from the lens with values between 0.8291% and 1.3496%, and for Watanabe‟s filters the error was between 0.8691% and 1.5301%. From the plots it can be inferred that the filters designed by the Two Step Polynomial method provide a closer fit to the actual depth. The results are corrected for centre offset.
Figure 4.23a: Actual vs. Estimated Distance (mm) Figure 4.23b: Actual Distance vs. RMSE (mm)
When compared with the results in experiment (1) (Section 4.8.1), the defocus condition was the same, but a different lens was used with different working ranges. In each case the estimated depth was linear with the step number, and the RMS error followed a similar shape. However the RMS error was higher for the 35mm lens with a working range of 107mm when compared to a 50mm lens with a working range of 56mm. Here it should be observed that the increase in working range by decreasing the aperture size has had a considerable effect on the accuracy of depth estimation. This led to an investigation of the available options to increase the working range for a given experimental setup. The detailed description is presented in Section 4.9.
4.8.4. Experiment 4- with defocus condition 2.3944 pixels
In the final experiment a 35mm lens was used but the working distance was extended to 200mm by using a smaller aperture of 2.2mm. The far and near-focussed images were at 800mm and 600mm, and the defocus condition calculated based on
Appendix3 was e 2.3944pixels
Fe . The rational filters were redesigned for the parameters summarised in Table 4.4.
Defocus condition e pixels Fe 1 2 min s fr k pixel 1 maxfr 0.73Fe e pixel
Max diameter blur
2 0.73 s e k Fe pixel 2.3944 e pixels Fe Focal length, f =35mm Kernel size ks=7 Aperture diameter=2.2mm 38.310 16 0.2857 0.305 4.78
Table 4.4: Calculated values for the defocus condition e 2.3937pixels Fe
The normalised depth was calculated at 20mm intervals. Figure (4.24a) shows the plots of the actual and the estimated depths, and plot (4.24b) shows the RMS error estimated for individual distances. The maximum RMS error recorded was 7.3%. This large RMS error could be due to the smaller aperture used to increase the working range and also due to the focal error that might be present in the lens used. In order to clearly show linearity of the depth estimation with respect to the actual depth, the results have been corrected for both focus offset and centre offset.
Figure 4.24a: Actual Distance vs. Estimated Distance (mm)
Figure 4.24b: Actual Distance vs. RMSE (mm)
4.9. Effect of focal length, f-number of the lens and the pixel size of the sensor on