| CPC G11B 27/031 (2013.01) [G06T 7/12 (2017.01); G06T 7/215 (2017.01); G06T 7/60 (2013.01); G06T 7/70 (2017.01); G06T 7/90 (2017.01); G06V 20/41 (2022.01); G06V 20/48 (2022.01); G06T 2207/10016 (2013.01); G06T 2207/10024 (2013.01); G06T 2207/30196 (2013.01)] | 11 Claims |

|
1. A method for generating a video having a three-dimensional (3D) effect, the method being performed by a server and comprising:
obtaining an original video, the original video comprising at least one frame of a raw image;
segmenting the raw image to obtain a foreground image comprising a moving object to obtain a foreground image sequence, the foreground image sequence comprising at least one frame of the foreground image;
determining, based on a moving track of the moving object in the foreground image sequence, a target raw image, included in the original video, in which a target occlusion image is to be placed and an occlusion method of the target occlusion image in the target raw image, wherein the occlusion method includes an occlusion location, an occlusion size, and an occlusion color, and wherein the occlusion method is determined, from a plurality of occlusion methods, based on a pixel width or pixel length of the target raw image, wherein determining the target raw image and the occlusion method comprises:
determining a type of the moving object and the moving track of the moving object based on the foreground image sequence;
determining, in an occlusion material library, the target occlusion image matching the type of the moving object, the occlusion material library comprising at least one occlusion image; and
determining the occlusion size and the occlusion color of the target occlusion image based on the target raw image;
adding the target occlusion image to the target raw image based on the occlusion method to obtain a modified target raw image; and
replacing the target raw image in the original video with the modified target raw image, and generating a target video having a 3D effect.
|