Method and electronic device for adding virtual item
AssigneeBeijing Dajia Internet Information Technology Co., Ltd.
InventorWenyu Qin
Life of this patent
Estimating the term…
Abstract
A method for adding a virtual item can include: acquiring classification identifiers of a plurality of pixel points in a target human face image, wherein the classification identifier comprises a first identifier of pixel points in a first human face part or a second identifier of pixel points in a second human face part; determining a target region in the target human face image based on the classification identifiers, wherein the target region is a region belonging to the first human face part; adding a virtual item to the target region; wherein the first human face part comprises an uncovered human face part, and the second human face part comprises a covered human face part or a non-human face part.
Claims20
A method for adding a virtual item, comprising:
- acquiring classification identifiers of a plurality of pixel points in a target human face image, wherein the classification identifiers comprise a first identifier of pixel points in a first human face part or a second identifier of pixel points in a second human face part;
- determining a target region in the target human face image based on the classification identifiers, wherein the target region is a region belonging to the first human face part;
- and
- adding a virtual item to the target region;
- wherein the first human face part comprises an uncovered human face part, and the second human face part comprises a covered human face part or a non-human face part;
- wherein said adding the virtual item to the target region comprises:
- acquiring a reference image, wherein pixel values of pixel points in the reference image are determined by the classification identifiers;
- acquiring a first matrix, a second matrix, a third matrix and a fourth matrix, wherein:
- elements of the first matrix are equal to pixel values of pixel points with same positions in the target human face image;
- the second matrix has same size as the first matrix, and all elements of the second matrix are equal to 1;
- elements of the third matrix are equal to pixel values of pixel points with same positions in the reference image;
- and
- elements of the fourth matrix are equal to pixel values of pixel points with same positions in the virtual item;
- and
- generating, based on the first matrix, the second matrix, the third matrix and the fourth matrix, the target human face image added with the virtual item.
An electronic device for adding a virtual item, comprising:
- at least one processor;
- and
- a volatile or non-volatile memory configured to store at least one program comprising at least one instruction executable by the at least one processor;
- wherein the at least one instruction, when executed by the at least one processor, causes the at least one processor to perform a method comprising:
- acquiring classification identifiers of a plurality of pixel points in a target human face image, wherein the classification identifiers comprise a first identifier of pixel points in a first human face part or a second identifier of pixel points in a second human face part;
- determining a target region in the target human face image based on the classification identifiers, wherein the target region is a region belonging to the first human face part;
- and
- adding a virtual item to the target region;
- wherein the first human face part comprises an uncovered human face part, and the second human face part comprises a covered human face part or a non-human face part;
- wherein said adding the virtual item to the target region comprises:
- acquiring a reference image, wherein pixel values of pixel points in the reference image are determined by the classification identifiers;
- acquiring a first matrix, a second matrix, a third matrix and a fourth matrix, wherein:
- elements of the first matrix are equal to pixel values of pixel points with same positions in the target human face image;
- the second matrix has same size as the first matrix, and all elements of the second matrix are equal to 1;
- elements of the third matrix are equal to pixel values of pixel points with same positions in the reference image;
- and
- elements of the fourth matrix are equal to pixel values of pixel points with same positions in the virtual item;
- and
- generating, based on the first matrix, the second matrix, the third matrix and the fourth matrix, the target human face image added with the virtual item.
A non-transitory computer-readable storage medium storing at least one program comprising at least one instruction therein, wherein the at least one instruction, when executed by a processor of an electronic device, causes the electronic device to perform a method comprising:
- acquiring classification identifiers of a plurality of pixel points in a target human face image, wherein the classification identifiers comprise a first identifier of pixel points in a first human face part or a second identifier of pixel points in a second human face part;
- determining a target region in the target human face image based on the classification identifiers, wherein the target region is a region belonging to the first human face part;
- and
- adding a virtual item to the target region;
- wherein the first human face part comprises an uncovered human face part, and the second human face part comprises a covered human face part or a non-human face part;
- wherein said adding the virtual item to the target region comprises:
- acquiring a reference image, wherein pixel values of pixel points in the reference image are determined by the classification identifiers;
- acquiring a first matrix, a second matrix, a third matrix and a fourth matrix, wherein:
- elements of the first matrix are equal to pixel values of pixel points with same positions in the target human face image;
- the second matrix has same size as the first matrix, and all elements of the second matrix are equal to 1;
- elements of the third matrix are equal to pixel values of pixel points with same positions in the reference image;
- and
- elements of the fourth matrix are equal to pixel values of pixel points with same positions in the virtual item;
- and
- generating, based on the first matrix, the second matrix, the third matrix and the fourth matrix, the target human face image added with the virtual item.
Dependencies are inferred from the claim text.