Аннотация:In this paper we study a problem of 3D scene reconstruction from a set of differently focused images, also known as the shape from focus (SFF) problem. Existing shape from focus methods are known to produce unstable depth estimates in areas with poor texture and in presence of strong highlights. So in this work we focus on the robustness of 3D scene structure recovery. We formulate a shape from focus problem in a Bayesian framework using Markov Random Fields and present an SFF method that yields a globally optimal surface with enforced smoothness priors. Although shape from focus has been studied for quite a long time there is no widely accepted test set for evaluation of SFF algorithms. Therefore we present a test set composed of 27 image sets with hand-labeled ground truth. We quantitatively evaluate our method on this test set and present the comparison results. These results demonstrate that our method is robust to highlights and untextured regions and that it outperforms the state-of-the-art.