Method and apparatus for processing video
AssigneeBeijing Baidu Netcom Science Technology Co., Ltd.
InventorZhaomin Zhu
Life of this patent
Estimating the term…
Abstract
A method and an apparatus for processing a video are provided technology. The method may include: separating a foreground image and a background image from a video frame in the target video stream, in response to acquiring a target video stream; adding a to-be-displayed content at a target display position in the background image to obtain a processed background image; and combining the foreground image and the processed background image to obtain a target video frame. The present disclosure may directly render the to-be-displayed content in the background, so that the content displayed in the background does not block a body in the foreground, such as person.
Claims20
A method for processing a video, the method comprising:
- receiving a scene image, and recognizing at least one alternative display position in the scene image, wherein the scene image is a single image or a video stream;
- determining a target display position in the scene image based on the at least one alternative display position, wherein the target display position is for displaying a to-be-displayed content;
- wherein after determining the target display position in the scene image, the method further comprises,
- acquiring a target video stream;
- determining that a scene in the target video stream and a scene in the scene image are a same scene, and separating a foreground image and a background image from a video frame in the target video stream;
- adding the to-be-displayed content at a position in the background image corresponding to the target display position in the scene image, to obtain a processed background image;
- and
- combining the foreground image and the processed background image to obtain a target video frame.
An electronic device, comprising:
- one or more processors;
- and
- a storage device, for storing one or more programs,
- wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform operations comprising:
- receiving a scene image, and recognizing at least one alternative display position in the scene image, wherein the scene image is a single image or a video stream;
- determining a target display position in the scene image based on the at least one alternative display position, wherein the target display position is for displaying a to-be-displayed content;
- wherein alter determining the target display position in the scene image, the method further comprises,
- acquiring a target video stream;
- determining that a scene in the target video stream and a scene in the scene image are a same scene, and separating a foreground image and a background image from a video frame in the target video stream;
- adding the to-be-displayed content at a position in the background image corresponding to the target display position in the scene image, to obtain a processed background image;
- and
- combining the foreground image and the processed background image to obtain a target video frame.
A non-transitory computer readable storage medium, storing a computer program thereon, the program, when executed by a processor, causes the processor to perform operations comprising:
- receiving a scene image, and recognizing at least one alternative display position in the scene image, wherein the scene image is a single image or a video stream;
- determining a target display position in the scene image based on the at least one alternative display position, wherein the target display position is for displaying a to-be-displayed content;
- wherein after determining the target display position in the scene image, the method further comprises,
- acquiring a target video stream;
- determining that a scene in the target video stream and a scene in the scene image are a same scene, and separating a foreground image and a background image from a video frame in the target video stream;
- adding the to-be-displayed content at a position in the background image corresponding to the target display position in the scene image, to obtain a processed background image;
- and
- combining the foreground image and the processed background image to obtain a target video frame.
Dependencies are inferred from the claim text.