The invention, which relates to the technical field of
image processing, discloses a method for converting a 2D image into a 3D image, comprising the following steps: step 1, obtaining a 2D image; step 2,
monocular depth
estimation is carried out on the 2D image to obtain a
relative depth map; 3, determining the longitudinal depth and the zero
parallax surface of the scene according to the content of the 2D image; 4, carrying out value
domain transformation on the
depth map; 5, calculating the
parallax of each pixel of the 2D image according to the transformed
depth map, and then rendering an image of a virtual viewpoint according to the
parallax; and step 6, repairing the cavity. According to the method for converting the 2D image into the 3D image, the watching experience is improved, the stereoscopic impression is enhanced, the
ghosting phenomenon is reduced, and the proper proportion scale is kept; the conversion efficiency and the
automation degree are improved, and manual intervention is reduced; meanwhile, the generalization ability is enhanced; in addition, the hole repairing effect is optimized, so that the converted 3D image is more natural and perfect.