In this chapter, we considered the effects of illumination and window sizes on the focus measures for accurate calculation of depth map. We showed that the illumination effects can directly result in incorrect estimation of depth map if proper window size is not used for computation. We used two well established focus measures, i.e., Sum of Modified Laplacian and Gray Level Variance. We proved that larger window size results in two major errors. One is the introduction of blurring which results in smoothing of the object hence giving false impression of 3D smoothing in depth map. Second is the wrong extraction of frame numbers for depth map corresponding to the sharpest pixel values in the sequence of the images. Hence, it is suggested that smaller window size should be used with the upper bound of 5x5 on the size of the window. Hence, without pre-processing for image enhancement and without use of proper window size, it is not possible to obtain the accurate depth map for 3D shape recovery. It is worth noting that the problem defined in this chapter is not limited to Shape From Focus only. Rather most of the image processing techniques (especially 3D image recovery algorithms) based on window processing are marred with this problem, i.e., usage of large window size. Hence, this chapter provides guidance for research in this direction too. In addition, we have presented a focus measure based on robustness in the presence of noise. We tested and compared this focus measure using simulated cone images, real cone images and slanted planar object images. The results show that this focus measure tends to perform better than the traditional focus measures when the noise is present in the images. We have shown the performance of various focus measures with three different types of noise, i.e., Gaussian, Shot and Speckle noise. The various focus measures used for comparison include Sum of Modified Laplacian (SML), Gray Level Variance (GLV), Tenenbaum and M2 focus measures which clearly indicate that the optical focus measure is equally good for images without noise and at the same time, it shows much enhanced performance in comparison to others in the presence of noise. It can be argued that some noise removal filter can be used before processing with the focus measure. However, as shown, the result of the proposed focus measure (FMO) is better even in the absence of noise. Further, FMO does not require noise removal filter because noise removal property is inherent within this technique. Lastly, we know that different types of noise removal filter are employed for different types of noise, e.g., median filter for shot noise, Weiner filter for Gaussian noise etc. Hence, some knowledge of noise is required before hand for the application of such filters. We used RMSE and Correlation metric measures to compare the performance of the earlier focus measures with our optical focus measure. The results clearly indicate that the RMSE values are lowest while the correlation values are the highest for the presented focus measure when compared with the SML, GLV, Tenenbaum and M2 focus measures at almost all the noise levels for all objects. It is concluded from the results that the best performance is shown by FMO followed by GLV, Tenenbaum, M2 and SML.