High dynamic range (HDR) imaging technology is becoming increasingly popular in various applications. A common approach to get an HDR image is the multiple exposed images fusion. However, the phenomenon of ghosting artifacts is brought in for the scene with non-static objects. This paper proposes a ghost-free HDR image synthesis algorithm that utilizes a sparse representation framework. Based on the dependency among adjacent low dynamic range (LDR) images and the sparsity of the moving object that leads to the ghost artifacts, we formulate the problem into two steps moving object detection and ghost free HDR generation. In the moving object detection step, we formulate the problem as sparse representation due to the sparsity and instantaneous of the moving objects. In the HDR generation step, joint weighting is proposed to generate a ghost-free HDR image from the reference image. Experiments show that the proposed algorithm outperforms the state-of-the-art methods favorably on the textures and colors.