• 3D shape;
  • DCT;
  • focus measure;
  • principal component analysis;
  • shape from focus


This article introduces a new algorithm for shape from focus (SFF) based on discrete cosine transform (DCT) and principal component analysis (PCA). DCT is applied on a small 3D neighborhood for each pixel in the image volume. Instead of summing all focus values in a window, AC parts of DCT are collected and then PCA is applied to transform this data into eigenspace. The first feature, containing maximum variation is employed to compute the depth. DCT and PCA are computationally intensive; however, the reduced data elements and algorithm iterations have made the new approach competitive and efficient. The performance of the proposed approach is compared with other methods by conducting experiments using image sequences of a synthetic and two microscopic objects. The evaluation is gauged on the basis of unimodality, monotonicity, and resolution of the focus curve. Two other global statistical metrics, root mean square error (RMSE) and correlation have also been applied for synthetic image sequence. Besides, noise sensitivity and computational complexity are also compared with other algorithms. Experimental results demonstrate the effectiveness and the robustness of the new method. Microsc. Res. Tech., 2008. © 2008 Wiley-Liss, Inc.