Method and apparatus for synthesizing virtual and real objects
AssigneeBeijing Xiaomi Mobile Software Co., Ltd.
InventorXingsheng Lin
Life of this patent
Estimating the term…
Abstract
A method for synthesizing virtual and real objects, includes: acquiring a target object in an image captured by a terminal device; in a depth information fusion mode, acquiring the depth information of the target object by a camera apparatus of the terminal device, wherein the depth information fusion mode is configured to superimpose a virtual object generated by computer modeling on the image, and the depth information of the target object is configured to indicate a distance between the target object and the terminal device; acquiring the depth information of the virtual object; and superimposing the virtual object on the image based on the depth information of the target object and the depth information of the virtual object.
Claims12
A method for synthesizing virtual and real objects, applied to a terminal device, the method comprising:
- acquiring a target object in a two-dimensional image captured by the terminal device;
- in a depth information fusion mode, acquiring depth information of the target object by a camera apparatus of the terminal device, wherein the depth information fusion mode is configured to superimpose a virtual object generated by computer modeling on the two-dimensional image, and the depth information of the target object is configured to indicate a distance between the target object and the terminal device;
- acquiring two-dimensional position information of the virtual object placed in the two-dimensional image;
- calculating, after the target object is acquired, depth information of the virtual object according to the two-dimensional position information of the virtual object placed in the two-dimensional image, wherein the depth information of the virtual object is recorded in the two-dimensional position information of the virtual object, and the depth information of the virtual object changes with the movement of the virtual object in the two-dimensional image;
- and
- superimposing the virtual object on the two-dimensional image according to a comparison result of the depth information of the target object and the depth information of the virtual object.
A terminal device, comprising:
- a processor;
- a camera apparatus coupled to the processor;
- and
- a memory for storing instructions executable by the processor;
- wherein the processor is configured to:
- acquire a target object in a two-dimensional image captured by the terminal device;
- in a depth information fusion mode, acquire depth information of the target object by the camera apparatus of the terminal device, wherein the depth information fusion mode is configured to superimpose a virtual object generated by computer modeling on the two-dimensional image, and the depth information of the target object is configured to indicate a distance between the target object and the terminal device;
- acquire two-dimensional position information of the virtual object placed in the two-dimensional image;
- calculate, after the target object is acquired, depth information of the virtual object according to the two-dimensional position information of the virtual object placed in the two-dimensional image, wherein the depth information of the virtual object is recorded in the two-dimensional position information of the virtual object, and the depth information of the virtual object changes with the movement of the virtual object in the two-dimensional image;
- and
- superimpose the virtual object on the two-dimensional image according to a comparison result of the depth information of the target object and the depth information of the virtual object.
A non-transitory computer-readable storage medium having stored therein instructions that, when executed by a processor of a terminal device, cause the terminal device to perform a method for synthesizing virtual and real objects, the method comprising:
- acquiring a target object in a two-dimensional image captured by the terminal device;
- in a depth information fusion mode, acquiring depth information of the target object by a camera apparatus of the terminal device, wherein the depth information fusion mode is configured to superimpose a virtual object generated by computer modeling on the two-dimensional image, and the depth information of the target object is configured to indicate a distance between the target object and the terminal device;
- acquiring two-dimensional position information of the virtual object placed in the two-dimensional image;
- calculating, after the target object is acquired, depth information of the virtual object according to the two-dimensional position information of the virtual object placed in the two-dimensional image, wherein the depth information of the virtual object is recorded in the two-dimensional position information of the virtual object, and the depth information of the virtual object changes with the movement of the virtual object in the two-dimensional image;
- and
- superimposing the virtual object on the two-dimensional image according to a comparison result of the depth information of the target object and the depth information of the virtual object.
Dependencies are inferred from the claim text.