Skin detection method and electronic device
Abstract
A skin detection and evaluation method includes: obtaining a face image of a user; detecting a skin problem that appears in the face image; prompting in a first interface, the user that the skin problem appears on a face, wherein the first interface comprises the face image; and displaying a second interface in response to a first operation performed by the user in the first interface, wherein the second interface comprises a first facial simulated image obtained after the skin problem is aged; or displaying a third interface in response to a second operation performed by the user in the first interface, wherein the third interface comprises a second facial simulated image obtained after the skin problem is de-aged.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1. A skin detection method, comprises:
obtaining, by an electronic device, a face image of a user;
detecting, by the electronic device, a skin problem that appears in the face image;
prompting, by the electronic device in a first interface, the user that the skin problem appears on a face, wherein the first interface comprises the face image; and
displaying, by the electronic device, a second interface in response to a selection performed by the user in the first interface, wherein the selection is a selection of a first aging operation or a second aging operation, wherein the second interface comprises a first facial simulated image obtained after the skin problem is aged; or
displaying, by the electronic device, a third interface in response to the selection performed by the user in the first interface, wherein the selection is a selection of a first de-aging operation or a second de-aging operation, wherein the third interface comprises a second facial simulated image obtained after the skin problem is de-aged;
wherein the method further comprises:
(1) when the skin problem comprises a color spot problem and the selection is a selection of the first aging operation:
detecting, by the electronic device in the face image, a color spot region in which the color spot problem appears;
obtaining, by the electronic device, a change coefficient K1 of an L pixel channel, a change coefficient K2 of a pixel channel, and a change coefficient K3 of a b pixel channel in the color spot region;
performing, by the electronic device, aging processing on the L pixel channel in the color spot region, to obtain a pixel value L′ of an aged L pixel channel, wherein L′=L+K1×C1×L, L is a pixel value of the L pixel channel before the aging processing, and C1 is a constant;
performing, by the electronic device, aging processing on the a pixel channel in the color spot region, to obtain a pixel value a′ of an aged a pixel channel, wherein a′=a+K2×C2× a, a is a pixel value of the a pixel channel before the aging processing, and C2 is a constant; and
performing, by the electronic device, aging processing on the b pixel channel in the color spot region, to obtain a pixel value b′ of an aged b pixel channel, wherein b′=b+K3×C3×b, b is a pixel value of the b pixel channel before the aging processing, and C3 is a constant; or
(2) when the skin problem comprises a color spot problem and the selection is a selection of the first de-aging operation:
detecting, by the electronic device in the face image, a color spot region in which the color spot problem appears;
obtaining, by the electronic device, a change coefficient K1 of an L pixel channel, a change coefficient K2 of a pixel channel, and a change coefficient K3 of a b pixel channel in the color spot region;
performing, by the electronic device, de-aging processing on the L pixel channel in the color spot region, to obtain a pixel value L′ of de-aged L pixel channel, wherein L′=L−K1×C1×L, L is a pixel value of the L pixel channel before the de-aging processing, and C1 is a constant;
performing, by the electronic device, de-aging processing on the a pixel channel in the color spot region, to obtain a pixel value a′ of a de-aged a pixel channel, wherein a′=a−K2×C2× a, a is a pixel value of the pixel channel before the de-aging processing, and C2 is a constant; and
performing, by the electronic device, de-aging processing on the b pixel channel in the color spot region, to obtain a pixel value b′ of a de-aged b pixel channel, wherein b′=b−K3×C3×b, b is a pixel value of the b pixel channel before the de-aging processing, and C3 is a constant; or
(3) the skin problem comprises a fine line problem and the selection is a selection of the second aging operation:
detecting, by the electronic device in the face image, a fine line region in which the fine line problem appears;
obtaining, by the electronic device, a change coefficient D of the fine line region;
performing, by the electronic device, aging processing on an R pixel channel in the fine line region, to obtain a pixel value R′ of an aged R pixel channel, wherein R′=R+C5×D, R is a pixel value of the R pixel channel before the aging processing, and C5 is a constant;
performing, by the electronic device, aging processing on a G pixel channel in the fine line region, to obtain a pixel value G′ of an aged G pixel channel, wherein G′=G+C6×D, G is a pixel value of the G pixel channel before the aging processing, and C6 is a constant; and
performing, by the electronic device, aging processing on a B pixel channel in the fine line region, to obtain a pixel value B′ of an aged B pixel channel, wherein B′=B+C7×D, R is a pixel value of the B pixel channel before the aging processing, and C7 is a constant; or
(4) the skin problem comprises a fine line problem and the selection is a selection of the second de-aging operation:
obtaining, by the electronic device, a change coefficient D of the fine line region in the face image;
performing, by the electronic device, de-aging processing on an R pixel channel in the fine line region, to obtain a pixel value R′ of a de-aged R pixel channel, wherein R′=R−C5×D, R is a pixel value of the R pixel channel before the de-aging processing, and C5 is a constant;
performing, by the electronic device, de-aging processing on a G pixel channel in the fine line region, to obtain a pixel value G′ of a de-aged G pixel channel, wherein G′=G−C6×D, R is a pixel value of the G pixel channel before the de-aging processing, and C6 is a constant and
performing, by the electronic device, de-aging processing on a B pixel channel in the fine line region, to obtain a pixel value B′ of a de-aged B pixel channel, wherein B′=B−C7×D, R is a pixel value of the B pixel channel before the de-aging processing, and C7 is a constant.
2. The method of claim 1 , wherein the skin problem comprises the color spot problem, and wherein the selection is a selection of the first aging operation or the first de-aging operation.
3. The method of claim 1 , wherein the skin problem comprises a fine line problem, and the selection is the second aging operation or the second de-aging operation.
4. The method of claim 1 , wherein the first interface further comprises an aging progress bar and a slider, and the election includes a sliding operation of dragging the slider on the aging progress bar by the user; and the method further comprises:
displaying, by the electronic device in the second interface, the first facial simulated image corresponding to the first position, when the slider is dragged to a first position of the aging progress bar.
5. The method of claim 1 , wherein the first interface further comprises a scoring status or a skin care suggestion for the skin problem in the face image.
6. An electronic device, comprising:
a non-transitory memory comprising instructions; and
a processor coupled to the non-transitory memory, the instructions being executed by the processor to cause the electronic device to:
obtain a face image of a user;
detect a skin problem that appears in the face image;
prompt in a first interface, the user that the skin problem appears on a face, wherein the first interface comprises the face image; and
display a second interface in response to a selection performed by the user in the first interface, wherein the selection is a selection of a first aging operation or a second aging operation, wherein the second interface comprises a first facial simulated image obtained after the skin problem is aged; or
display a third interface in response to the selection performed by the user in the first interface, wherein the selection is a selection of a first de-aging operation or a second de-aging operation, wherein the third interface comprises a second facial simulated image obtained after the skin problem is de-aged;
wherein the instructions being executed by the processor cause the electronic device further to:
(1) when the skin problem comprises a color spot problem and the selection is a selection of the first aging operation:
detect a color spot region in which the color spot problem appears;
obtain a change coefficient K1 of an L pixel channel, a change coefficient K2 of a pixel channel, and a change coefficient K3 of a b pixel channel in the color spot region;
perform aging processing on the L pixel channel in the color spot region, to obtain a pixel value L′ of an aged L pixel channel, wherein L′=L+K1×C1×L, L is a pixel value of the L pixel channel before the aging processing, and C1 is a constant;
perform aging processing on the a pixel channel in the color spot region, to obtain a pixel value a′ of an aged a pixel channel, wherein a′=a+K2×C2× a, a is a pixel value of the a pixel channel before the aging processing, and C2 is a constant; and
perform aging processing on the b pixel channel in the color spot region, to obtain a pixel value b′ of an aged b pixel channel, wherein b′=b+K3×C3×b, b is a pixel value of the b pixel channel before the aging processing, and C3 is a constant; or
(2) when the skin problem comprises a color spot problem and the selection is a selection of the first de-aging operation:
detect a color spot region in which the color spot problem appears;
obtain a change coefficient K1 of an L pixel channel, a change coefficient K2 of a pixel channel, and a change coefficient K3 of a b pixel channel in the color spot region;
perform de-aging processing on the L pixel channel in the color spot region, to obtain a pixel value L′ of de-aged L pixel channel, wherein L′=L−K1×C1×L, L is a pixel value of the L pixel channel before the de-aging processing, and C1 is a constant;
perform de-aging processing on the a pixel channel in the color spot region, to obtain a pixel value a′ of a de-aged a pixel channel, wherein a′=a−K2×C2× a, a is a pixel value of the pixel channel before the de-aging processing, and C2 is a constant; and
perform de-aging processing on the b pixel channel in the color spot region, to obtain a pixel value b′ of a de-aged b pixel channel, wherein b′=b−K3×C3×b, b is a pixel value of the b pixel channel before the de-aging processing, and C3 is a constant; or
(3) the skin problem comprises a fine line problem and the selection is a selection of the second aging operation:
detect a fine line region in which the fine line problem appears;
obtain a change coefficient D of the fine line region;
perform aging processing on an R pixel channel in the fine line region, to obtain a pixel value R′ of an aged R pixel channel, wherein R′=R+C5×D, R is a pixel value of the R pixel channel before the aging processing, and C5 is a constant;
perform aging processing on a G pixel channel in the fine line region, to obtain a pixel value G′ of an aged G pixel channel, wherein G′=G+C6×D, G is a pixel value of the G pixel channel before the aging processing, and C6 is a constant; and
perform aging processing on a B pixel channel in the fine line region, to obtain a pixel value B′ of an aged B pixel channel, wherein B′=B+C7×D, R is a pixel value of the B pixel channel before the aging processing, and C7 is a constant or
(4) the skin problem comprises a fine line problem and the selection is a selection of the second de-aging operation:
obtain a change coefficient D of the fine line region in the face image;
perform de-aging processing on an R pixel channel in the fine line region, to obtain a pixel value R′ of a de-aged R pixel channel, wherein R′=R−C5×D, R is a pixel value of the R pixel channel before the de-aging processing, and C5 is a constant;
perform de-aging processing on a G pixel channel in the fine line region, to obtain a pixel value G′ of a de-aged G pixel channel, wherein G′=G−C6×D, G is a pixel value of the G pixel channel before the de-aging processing, and C6 is a constant; and
perform de-aging processing on a B pixel channel in the fine line region, to obtain a pixel value B′ of a de-aged B pixel channel, wherein B′=B−C7×D, R is a pixel value of the B pixel channel before the de-aging processing, and C7 is a constant.
7. The electronic device of claim 6 , wherein the skin problem comprises a color spot problem, and wherein the selection is a selection of the first aging operation or the first de-aging operation.
8. The electronic device of claim 6 , wherein the skin problem comprises the fine line problem, and wherein the selection is a selection of the first aging operation or the first de-aging operation.
9. The electronic device of claim 6 , wherein the first interface further comprises an aging progress bar and a slider, and the selection includes a sliding operation of dragging the slider on the aging progress bar by the user; the instructions further cause the electronic device to:
display in the second interface, the first facial simulated image corresponding to the first position, when the slider is dragged to a first position of the aging progress bar.
10. The electronic device of claim 6 , wherein the first interface further comprises a scoring status or a skin care suggestion for the skin problem in the face image.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.