摘要

Focus stacking is a computational technique to extend the Depth of Field (DOF) through combining multiple images taken at various focus distances. However, existing focus stacking methods could not cope with false edges produced by propagation of blur kernels, and are affected by colored texture in the stack. In this work, we propose a novel all-in-focus method based on directional-max-gradient flow (DMGF) and labeled iterative depth propagation. Firstly, we present a novel directional-max-gradient flow to describe gradient propagation along different directions in the stack to remove false edges and preserve accurate depth values of both strong and weak edges(also called source points). Then the source points are further labeled as in-plane edges and off-plane edges by unsupervised classification technique. Finally in our proposed labeled iterative Laplacian optimization, these edges are utilized to remove artifacts produced by colored texture in the stack and refine the all-in-focus image. Extensive experiments on both synthesized data and real data show that our method has achieved superior performance to state-of-the-art methods.