The invention discloses a rapid and efficient hole filling algorithm based on foreground and background gradient transition. Firstly, grey processing is conducted on an input image, and an original depth image is obtained through depth extraction; secondly, operations such as filtering, foreground fattening and foreground and background gradient gradual transition are conducted on the original depth image so that a processed depth image can be obtained; 3D drawing is conducted by using the original depth image and the processed depth image, and the two obtained images are synthesized to obtain a target image; hole regions of the obtained target image are filled according to the proposed hole filling algorithm, so that a final left-right view is obtained. Compared with other methods, the algorithm has the advantages that the algorithm is simpler and easy to implement, the calculation process is simplified greatly, operation time is shortened greatly, and the algorithm is very applicable to real-time 3D display technologies.