Mural digitalization is an important part of the conservation work of Dunhuang Academy.Because of the irregular shapes of cave walls and distortion of camera lenses,the photos captured in caves show some geometrical distortion,which causes problems in the image mosaic and greatly decreases the quality of the mosaic.In this research,camera lenses were corrected to reduce the distortion of images and then optimize the image mosaic,not only improving the quality of the automatic mosaic,but also decreasing mosaic errors.