Image rendering method and apparatus
AssigneeHuawei Technologies Co., Ltd.
InventorsChuanna Huang, Jing Xiao, Guangyao Zhao
Life of this patent
Estimating the term…
Abstract
An image rendering method and apparatus where the method includes recognizing a target area from a to-be-rendered image, setting a virtual light source for the target area, and performing rendering on the target area using the virtual light source. When rendering is performed on the to-be-rendered image, the rendering performed on the to-be-rendered image is implemented using the virtual light source. The virtual light source plays a rendering action only on the target area corresponding to the virtual light source, and does not affect another part of the to-be-rendered image, and therefore an image effect of the to-be-rendered image may be relatively good.
Claims18
An image rendering method, comprising:
- recognizing a target area from a to-be-rendered image;
- setting a virtual light source for the target area according to depth information of the target area, wherein setting the virtual light source for the target area according to the depth information comprises selecting, for each target area, an illuminance ratio within a present ratio range corresponding to the depth information of the target area as an illuminance ratio of the virtual light source;
- selecting, for the target area, a location within a preset location range corresponding to the depth information of the target area as a location of the virtual light source;
- and
- performing rendering on the target area using the virtual light source.
An image rendering method, comprising:
- recognizing a target area from a to-be-rendered image;
- setting a virtual light source for the target area according to depth information of the target area;
- selecting, for the target area, a location within a preset location range corresponding to the depth information of the target area as a location of the virtual light source;
- and
- performing rendering on the target area using the virtual light source, wherein performing rendering on the target area using the virtual light source comprises:
- generating, for a target pixel of the target area, a gain factor under an action of the virtual light source;
- performing rendering on an initial color of the target pixel using the gain factor in order to obtain a rendered color of the target pixel;
- and
- replacing the initial color of the target pixel with the rendered color.
An image rendering apparatus, comprising:
- a memory;
- and
- a processor coupled to the memory and configured to:
- recognize a target area from a local image;
- set a virtual light source for the target area according to depth information of the target area;
- select, for the target area, a location within a preset location range corresponding to the depth information of the target area as a location of the virtual light source;
- select an illuminance ratio within a preset ratio range corresponding to the depth information as an illuminance ratio of the virtual light source;
- and
- perform rendering on the target area using the virtual light source.
An image rendering apparatus, comprising:
- a memory;
- and
- processor coupled to the memory and configured to:
- recognize a target area from a local image;
- set a virtual light source for the target area according to depth information of the target area;
- select, for the target area, a location within a preset location range corresponding to the depth information of the target area as a location of the virtual light source;
- generate, for a target pixel of the target area, a gain factor under an action of the virtual light source;
- perform rendering on the target area using the virtual light source by performing rendering on an initial color of the target pixel using the gain factor generated in order to obtain a rendered color of the target pixel;
- and
- replace the initial color of the target pixel with the rendered color of the target pixel.
Dependencies are inferred from the claim text.