CPC H04N 13/268 (2018.05) [G06T 5/70 (2024.01); G06T 5/77 (2024.01); G06T 7/20 (2013.01); G06T 7/50 (2017.01); H04N 13/15 (2018.05)] | 20 Claims |
1. A three-dimensionalization method for a two-dimensional image, performed by an electronic device, and comprising:
performing depth perception processing on a two-dimensional (2D) image, to obtain depth values of a plurality of pixels in the two-dimensional image;
performing migration processing on the two-dimensional image from multiple perspectives, to obtain a migration result of the two-dimensional image corresponding to each perspective;
determining color values of pixels in a migration image corresponding to each perspective, based on the depth values of the pixels in the two-dimensional image and the migration result of the two-dimensional image corresponding to each perspective;
generating, based on the color values of the pixels in the migration image of each perspective, the migration image corresponding to the perspective; and
encapsulating the migration images of the multiple perspectives in an order, to obtain a three-dimensional video,
wherein the migration processing on the 2D image for each perspective comprises: for a pixel in the plurality of pixels in the 2D image:
determining a horizontal motion vector based on a motion sensitive parameter, a horizontal motion parameter corresponding to the perspective, a depth value of the pixel in the 2D image, and a width of the 2D image;
determining a vertical motion vector based on the motion sensitive parameter, a vertical motion parameter corresponding to the perspective, the depth value of the pixel, and a height of the 2D image; and
obtaining an original position where the pixel in the 2D image is located in a migration image canvas of the perspective, and performing displacement processing with the original position as a starting point and according to the horizontal motion vector and the vertical motion vector, to obtain a migration position where the pixel in the 2D image is located in the migration image canvas.
|