A face image processing method and device, electronic equipment and storage medium

By acquiring key point data from facial images and weighting the template materials, the problem of inaccurate beautification effects in the target area was solved, resulting in better beautification effects and user experience.

CN114663290BActive Publication Date: 2025-10-24SO-YOUNG INT INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011401695.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-03
Publication Date
2025-10-24
Estimated Expiration
2040-12-03

AI Technical Summary

Technical Problem

Existing beautification technologies have errors in determining the location of target areas on facial images, resulting in inaccurate beautification effects and reduced user experience.

Method used

By acquiring key point data of the target face image, template materials are drawn onto a blank texture, and at least two color channels of the target area are weighted, including brightening the blue and green channels, to determine the brightening weight value to improve the beautification effect.

Benefits of technology

It achieves precise beautification processing of the target face image area, improving user experience and processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114663290B_ABST
    Figure CN114663290B_ABST
Patent Text Reader

Abstract

The application discloses a face image processing method and device, electronic equipment and storage medium. The method comprises the following steps: acquiring a target face image, and extracting key point data of the target face image from the target face image; acquiring a template material, drawing the template material into a blank texture in a preset manner, so that the template material corresponds to a region to be processed of the target face image; and performing weighted processing on at least two color channels of the region to be processed of the target face image based on the template material. The face image processing method provided by the embodiment of the application can accurately determine the region to be processed of the target face image, and perform weighted processing on at least two color channels of the region to be processed of the target face image based on the template material, so that the target face image after the weighted processing has a better beautifying effect, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, and in particular to a face image processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the development of image processing technology, more and more users process face images through beauty software.

[0003] In the above beauty technology through the beauty software, some users use the beauty technology to make the makeup of the target area of the user more beautiful.

[0004] The existing beauty technology has the following defects:

[0005] Based on the existing beauty technology, the position of any selected target area determined on the face image of the user may have errors, so that the position of the selected target area determined on the face image of the user is not accurate, and finally, the beauty effect of the beauty processing on the face image of the user is poor, thereby reducing the user experience. SUMMARY

[0006] Therefore, it is necessary to provide a face image processing method, device, electronic equipment and storage medium to solve the problem of poor beauty effect caused by inaccurate position of the selected target area based on the existing beauty technology.

[0007] In a first aspect, the embodiments of the present application provide a face image processing method, which comprises:

[0008] Obtaining a target face image, and extracting key point data of the target face image from the target face image;

[0009] Obtaining a template material, and drawing the template material into a blank texture through a preset manner, so that the template material corresponds to a region to be processed of the target face image;

[0010] Based on the template material, at least two color channels of the region to be processed of the target face image are weighted processed.

[0011] In an implementation manner, the drawing of the template material into the blank texture through the preset manner comprises:

[0012] Based on the key point data of the target face image, a fusion region of the target face image in the blank texture is determined;

[0013] Obtaining texture data of the template material;

[0014] According to the index mode and the texture data of the template material, the template material is drawn into the fusion area in the blank texture.

[0015] In an embodiment, the weighting processing of the at least two color channels of the target face image to be processed based on the template material includes:

[0016] In a first channel, the weighting processing of the at least two color channels of the target face image to be processed based on the template material, and

[0017] In a second channel, the weighting processing of the at least two color channels of the target face image to be processed based on the template material.

[0018] In an embodiment, the first channel is a blue channel, and the weighting processing of the at least two color channels of the target face image to be processed based on the template material includes:

[0019] determining a first lightening weight value for lightening processing of the target region in the blue channel;

[0020] According to the first lightening weight value and the pixel value corresponding to each key point of the target face image, in the first channel, the weighting processing of the target face image to be processed based on the template material is performed so that the target face image to be processed is lightened in the blue channel by the first lightening weight value.

[0021] In an embodiment, the determination of the first lightening weight value includes:

[0022] obtaining a first preset input weight value, a second preset input weight value, a blue color extracted from the template material, and a first weighting coefficient for weighting processing in the blue channel, and the sum of the first preset input weight value and the second preset input weight value is 1;

[0023] According to the first preset input weight value, the second preset input weight value, the blue color extracted from the template material, and the first weighting coefficient for weighting processing in the blue channel, the first lightening weight value is determined by weighting processing.

[0024] In an embodiment, the second channel is a blue channel, and the weighting processing of the at least two color channels of the target face image to be processed based on the template material in the second channel includes:

[0025] determining a second lightening weight value for lightening processing of the target region in the green channel;

[0026] According to the second brightening weight value and the pixel value corresponding to each key point of the target face image, in the second channel, the region to be processed of the target face image is weighted based on the template material, so that the region to be processed of the target face image is brightened in the green channel through the second brightening weight value.

[0027] In an implementation, the determining the second brightening weight value comprises:

[0028] The first preset input weight value, the second preset input weight value, the green extracted from the template material and the second weighting coefficient for weighting processing in the green channel are obtained, and the sum of the first preset input weight value and the second preset input weight value is 1;

[0029] The second brightening weight value is determined by weighting processing according to the first preset input weight value, the second preset input weight value, the green extracted from the template material and the second weighting coefficient for weighting processing in the green channel.

[0030] In an implementation, the target region is a region where a sleeping insect is located.

[0031] In a second aspect, the embodiments of the present application provide a face image processing device, the device comprising: an acquisition unit, an extraction unit, a drawing unit and a weighting processing unit;

[0032] The target face image is acquired, and a template material is acquired.

[0033] The extraction unit is configured to extract key point data of the target face image from the target face image acquired by the acquisition unit.

[0034] The drawing unit is configured to draw the template material acquired by the acquisition unit into a blank texture by a preset manner, so that the template material corresponds to a region to be processed of the target face image.

[0035] The weighting processing unit is configured to perform weighting processing on at least two color channels of the region to be processed of the target face image based on the template material acquired by the acquisition unit.

[0036] In a third aspect, the embodiments of the present application provide an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the method steps as described above.

[0037] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, which stores a computer program. The program is executed by a processor to implement the method steps described above.

[0038] The technical solutions provided by the embodiments of the present application can have the following beneficial effects:

[0039] In the embodiments of the present application, a target face image is obtained, and key point data of the target face image is extracted from the target face image. A template material is obtained, and the template material is drawn into a blank texture in a preset manner, so that the template material corresponds to a region to be processed of the target face image. At least two color channels of the region to be processed of the target face image are weighted based on the template material. The face image processing method provided by the embodiments of the present application can accurately determine the region to be processed of the target face image, and weight at least two color channels of the region to be processed of the target face image based on the template material. Therefore, the target face image after the weighting processing has a better beautifying effect, and the user experience is improved. It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.

[0041] Figure 1 is an application scenario diagram of a face image processing method provided by the embodiments of the present application;

[0042] Figure 2 is a flowchart of a face image processing method provided by the embodiments of the present application;

[0043] Figure 3 is a schematic diagram of a target face image identified by 106 key points in an application scenario provided by the embodiments of the present application;

[0044] Figure 4 is a schematic diagram of a sleeping silkworm image for beautifying a target face image in an application scenario provided by the embodiments of the present application;

[0045] Figure 5 is a schematic diagram of a standard face image in an application scenario provided by the embodiments of the present application;

[0046] Figure 6 is a schematic diagram of a processed standard face image obtained after standard grid segmentation processing in an application scenario provided by the embodiments of the present application;

[0047] Figure 7 is a structural schematic diagram of a face image processing device provided by an embodiment of the present disclosure.

[0048] Figure 8 An electronic device connection structure schematic diagram according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0049] The following description and drawings are sufficient to enable one skilled in the art to practice the present application.

[0050] It should be clear that the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by one of ordinary skill in the art without creative labor are within the scope of protection of the present application.

[0051] The optional embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0052] As Figure 1 shown, it is an application scenario diagram of an embodiment of the present disclosure. The application scenario is that multiple users operate a client installed on a terminal device such as a mobile phone through the terminal device. The client communicates data with a background server through a network. A special application scenario is to process a face image, that is, to perform a lying-beauty beautification process on the face image, but is not limited to this unique application scenario. It can be understood that any scenario that can be applied to the present embodiment is included. For convenience of description, the processing process of the face image of at least one client is described as an example to realize the application scenario of the face image processing method.

[0053] As Figure 2 shown, the present disclosure provides a face image processing method, which is applied to a client and specifically includes the following method steps:

[0054] S202: Obtain a target face image, and extract key point data of the target face image from the target face image.

[0055] As Figure 3 shown, it is a schematic diagram of a target face image identified by 106 target face key points in an application scenario provided by an embodiment of the present disclosure; as Figure 3 shown, 106 key points in the target face image are shown. Each key point has a corresponding numerical identifier. For example, numerical identifiers 52, 57, 73, 56, and 55 represent target face key points around the lower corner of one side of the target face image, and correspondingly, numerical identifiers 58, 63, 76, 62, and 61 represent target face key points around the lower corner of the other side of the target face image.

[0056] Since the standard face key points and the target face key points with the same identity have a one-to-one index relationship, the corresponding target face key points associated with the lower eye corners can be indexed according to the index relationship and the standard face key points associated with the lower eye corners.

[0057] S204: Obtain a template material, and draw the template material into the blank texture in a preset manner, so that the template material corresponds to the region to be processed of the target face image.

[0058] In the embodiment of the present application, the step of drawing the template material into the blank texture in a preset manner includes the following steps:

[0059] Based on the key point data of the target face image, determine a fusion region of the target face image in the blank texture;

[0060] Obtain texture data of the template material;

[0061] According to the indexed manner and the texture data of the template material, draw the template material into the fusion region in the blank texture.

[0062] In the embodiment of the present application, the indexed manner is specifically: according to a one-to-one index relationship between each data point of the template material and each data point of the blank texture (one-to-one index through the same label), according to the indexed manner and the texture data of the template material, draw the template material into the fusion region in the blank texture, so that the fusion region has the texture data of the template material, to achieve the color fusion effect.

[0063] In the embodiment of the present application, the template material can be a sleeping silkworm image.

[0064] As shown in Figure 4 , it is a schematic diagram of a sleeping silkworm image for beautifying a target face image in an application scenario provided by the embodiment of the present application.

[0065] As shown in Figure 4 , the sleeping silkworm image has a clear and convex beautifying effect, so that the processed target face image obtained by image fusion processing of the sleeping silkworm image and the target face image is more natural, has a better beautifying effect, and improves the user experience.

[0066] In the embodiment of the present application, the sleeping silkworm image matching the preference of the user can be selected from an image library including various sleeping silkworm images according to the preference of different users, as shown in Figure 3 , the sleeping silkworm image is only an example.

[0067] In the embodiment of the present application, the format of the target face image is preferably an rgba format image.

[0068] As shown in Figure 5 , it is a schematic diagram of a standard face image in an application scenario provided by an embodiment of the present disclosure; in the embodiment of the present application, the preset number of standard face key points of the standard face image can be set to 106. In different application scenarios, different preset numbers of standard face key points can be configured. In Figure 5 , the image is simplified and the preset number of standard face key points is not identified, which is only an example. The format of the standard face image is preferably an rgba format image.

[0069] As shown in Figure 6 , it is a schematic diagram of a processed standard face image obtained after standard grid segmentation processing in an application scenario provided by an embodiment of the present disclosure; through each standard grid as shown in Figure 6 , the accurate positioning of each facial feature in the standard face image can be realized.

[0070] obtain a first data set of a preset number of standard face key points, the first data set comprising identification data of each standard face key point, horizontal coordinate data of each standard face key point, and vertical coordinate data of each target standard key point; and obtain a second data set of a preset number of target face key points, the second data set comprising identification data of each target face key point, horizontal coordinate data of each target face key point, and vertical coordinate data of each target face key point, wherein the standard face key point and the target face key point with the same identification have a one-to-one index relationship;

[0071] perform grid segmentation processing on the standard face image of the standard object according to the data in the first data set to obtain each segmented grid, and paste each segmented grid on a blank picture;

[0072] paste the sleeping silkworm image on the blank picture with the segmented grids to obtain a processed sleeping silkworm image with standardized grids, the processed sleeping silkworm image being a sleeping silkworm image processed by standard grid segmentation.

[0073] S206: performing weighted processing on at least two color channels of the region to be processed of the target face image based on the template material.

[0074] In the embodiment of the present application, the output fused target face image is given a weight value, and the user can manually adjust the weight value according to his own preference and replace the previous weight value.

[0075] In the embodiment of the present application, the target region can be the region where the sleeping silkworm is located. For the description of the sleeping silkworm, please refer to the description of the same part described above, which will not be repeated here.

[0076] In a possible implementation, the step of performing the weighting processing on the at least two color channels of the region to be processed of the target face image based on the template material comprises the following steps.

[0077] In the first channel, the weighting processing is performed on the at least two color channels of the region to be processed of the target face image based on the template material, and in the second channel, the weighting processing is performed on the at least two color channels of the region to be processed of the target face image based on the template material.

[0078] In the embodiment of the present application, the first channel is the blue channel, and the step of performing the weighting processing on the at least two color channels of the region to be processed of the target face image based on the template material comprises the following steps.

[0079] determining a first lightening weight value for lightening processing of the target region in the blue channel;

[0080] performing the weighting processing on the region to be processed of the target face image in the first channel based on the template material according to the first lightening weight value and the pixel value corresponding to each key point of the target face image, so that the region to be processed of the target face image is lightened in the blue channel through the first lightening weight value.

[0081] In a possible implementation, the step of determining the first lightening weight value comprises:

[0082] obtaining a first preset input weight value, a second preset input weight value, a blue color extracted from the template material, and a first weighting coefficient for weighting processing in the blue channel, wherein the sum of the first preset input weight value and the second preset input weight value is 1;

[0083] performing the weighting processing according to the first preset input weight value, the second preset input weight value, the blue color extracted from the template material, and the first weighting coefficient for weighting processing in the blue channel, to determine the first lightening weight value.

[0084] In the embodiment of the present application, when the first channel is the blue channel, the weighting formula used for the weighting processing on the region to be processed of the target face image based on the template material can be:

[0085] color2=color1 * n+color1 * m * B * Alp1

[0086] m=1-n:

[0087] Alp1=1.6;

[0088] color2 = color1 + n * (B - color1) + m * Alp1 * (G - color1), wherein color1 is a pixel value corresponding to an arbitrary key point selected from the target face image, color2 is a pixel value corresponding to the key point corresponding to color1 when the key point is subjected to lightening processing in the blue channel, n is a first preset input weight value, m is a second preset input weight value, B is blue extracted from the template material, and Alp1 is a first weighting coefficient subjected to weighting processing in the blue channel. The above is merely an example, and a certain number of key points in the region to be processed can be selected to be subjected to the above formula and processed in turn, which will not be described herein again.

[0089] In the embodiment of the present application, the second channel is the blue channel, and the weighting processing of the at least two color channels of the region to be processed of the target face image based on the template material in the second channel includes the following steps:

[0090] determining a second lightening weight value for lightening processing of the target region in the green channel;

[0091] performing, according to the second lightening weight value and the pixel value corresponding to each key point of the target face image, the weighting processing of the region to be processed of the target face image based on the template material in the second channel, so as to perform the lightening processing of the region to be processed of the target face image in the green channel through the second lightening weight value.

[0092] In a possible implementation manner, the second lightening weight value is determined by:

[0093] obtaining a first preset input weight value, a second preset input weight value, green extracted from the template material, and a second weighting coefficient subjected to weighting processing in the green channel, and the sum of the first preset input weight value and the second preset input weight value is 1;

[0094] performing the weighting processing according to the first preset input weight value, the second preset input weight value, the green extracted from the template material, and the second weighting coefficient subjected to weighting processing in the green channel, to determine the second lightening weight value.

[0095] In the embodiment of the present application, when the second channel is the green channel, the fusion formula used for fusing the target region corresponding to the background texture of the template material and the target face image can be:

[0096] color3 = color1 * n + color1 * m * G * Alp2;

[0097] m = 1 - n;

[0098] Alp2 = 1.3;

[0099] Wherein, color1 is a pixel value corresponding to an arbitrary key point selected from the target face image, color3 is a pixel value corresponding to the key point corresponding to color1 when the key point is highlighted in the green channel, n is a first preset input weight value, m is a second preset input weight value, G is green extracted from the template material, and Alp2 is a second weighting coefficient for weighting processing in the green channel. The above is only an example, and a certain number of key points in the region to be processed can be selected to traverse and sequentially process using the above formula, which will not be described here.

[0100] It should be noted that, in addition to the two channels listed above, a third channel, for example, a red channel, can also be set. The formula is similar to the foregoing formula, and the difference lies in that the weighting coefficient for weighting processing in the red channel is different. For example, the weighting coefficient for weighting processing in the red channel can be set to 1.2, which will not be described here.

[0101] In the embodiment of the present disclosure, a target face image is obtained, and key point data of the target face image is extracted from the target face image. A template material is obtained, and the template material is drawn into a blank texture by a preset manner, so that the template material corresponds to a region to be processed of the target face image. At least two color channels of the region to be processed of the target face image are weighted based on the template material. The face image processing method provided by the embodiment of the present disclosure can accurately determine the region to be processed of the target face image, and at least two color channels of the region to be processed of the target face image are weighted based on the template material. Therefore, the target face image after weighting processing has a better beautifying effect, and the user experience is improved. In addition, the face image processing method provided by the embodiment of the present disclosure does not need to process each frame of the target face image in real time, but only needs to perform pixel correction processing on the pixel values of the key points of the region to be processed of the target face image. Therefore, the processing efficiency of the face image is improved.

[0102] The following is an embodiment of a face image processing device of the present disclosure, which can be used to execute the embodiment of the face image processing method of the present disclosure. For details not disclosed in the embodiment of the face image processing device of the present disclosure, please refer to the embodiment of the face image processing method of the present disclosure.

[0103] Please refer to Figure 7 which shows a structure schematic diagram of the face image processing device provided by an exemplary embodiment of the present disclosure. The face image processing device can be realized by software, hardware or a combination of the two to become all or part of the terminal. The face image processing device includes an acquisition unit 702, an extraction unit 704, a drawing unit 706 and a weighting processing unit 708.

[0104] Specifically, the acquisition unit 702 is configured to acquire a target face image and acquire a template material;

[0105] The extraction unit 704 is configured to extract key point data of the target face image from the target face image acquired by the acquisition unit 702;

[0106] The drawing unit 706 is configured to draw the template material acquired by the acquisition unit 702 into a blank texture in a preset manner, so that the template material corresponds to a region to be processed of the target face image.

[0107] The weighting processing unit 708 is configured to perform weighting processing on at least two color channels of the region to be processed of the target face image based on the template material acquired by the acquisition unit 702.

[0108] Optionally, the device further comprises:

[0109] A determination unit (not shown in the figure) is configured to determine a fusion region of the target face image in the blank texture based on the key point data of the target face image extracted by the extraction unit. Figure 7

[0110] The acquisition unit 702 is further configured to acquire texture data of the template material.

[0111] The drawing unit 706 is specifically configured to draw the template material into the fusion region in the blank texture according to the indexed manner and the texture data of the template material.

[0112] Optionally, the acquisition unit 702 is further configured to:

[0113] Acquire the texture data of the template material.

[0114] The drawing unit 706 is configured to draw the template material acquired by the acquisition unit 702 into the blank texture in the indexed manner, wherein the texture data of the template material is used to index the key point data of the target face image.

[0115] Optionally, the weighting processing unit 708 is configured to:

[0116] In a first channel, perform weighting processing on the at least two color channels of the region to be processed of the target face image based on the template material, and

[0117] In a second channel, perform weighting processing on the at least two color channels of the region to be processed of the target face image based on the template material.

[0118] Optionally, the first channel is a blue channel, and the device further comprises:

[0119] ​The determining unit is further configured to determine a first brightening weight value for brightening the target region in a blue channel.

[0120] The weighting processing unit 708 is further configured to perform weighting processing on the region to be processed of the target face image based on the template material in the first channel according to the first brightening weight value determined by the determining unit and the pixel value corresponding to each key point of the target face image, so that the region to be processed of the target face image is brightened in the blue channel by the first brightening weight value.

[0121] Optionally, the obtaining unit 702 is further configured to:

[0122] The first preset input weight value and the second preset input weight value are added to 1.

[0123] The determining unit is specifically configured to determine the first brightening weight value by weighting processing of the first preset input weight value, the second preset input weight value, the blue color extracted from the template material, and the first weighting coefficient for weighting processing in the blue channel, which are obtained by the obtaining unit 702.

[0124] Optionally, the second channel is a blue channel, and the determining unit is further configured to determine a second brightening weight value for brightening the target region in a green channel.

[0125] The weighting processing unit 708 is further configured to perform weighting processing on the region to be processed of the target face image based on the template material in the second channel according to the second brightening weight value obtained by the obtaining unit 702 and the pixel value corresponding to each key point of the target face image, so that the region to be processed of the target face image is brightened in the green channel by the second brightening weight value.

[0126] Optionally, the obtaining unit 702 is further configured to obtain the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel, and the first preset input weight value and the second preset input weight value are added to 1.

[0127] The determining unit is further configured to determine the second brightening weight value by weighting processing of the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel, which are obtained by the obtaining unit 702.

[0128] Optionally, the target region is a region where the sleeping insect is located.

[0129] It should be noted that the face image processing apparatus provided in the above embodiment is only used for illustrating the division of the above functional units when the face image processing method is performed, and in actual application, the above functions can be completed by different functional units according to the needs, that is, the internal structure of the device is divided into different functional units to complete all or part of the above described functions. In addition, the face image processing apparatus and the face image processing method provided in the above embodiment belong to the same concept, and the implementation process is embodied in the face image processing method, which will not be described here.

[0130] In the embodiment of the present disclosure, the acquisition unit is configured to acquire a target face image and a template material; the extraction unit is configured to extract key point data of the target face image from the target face image acquired by the acquisition unit; the drawing unit is configured to draw the template material acquired by the acquisition unit into a blank texture in a preset manner, so that the template material corresponds to a region to be processed of the target face image; and the weighting processing unit is configured to perform weighting processing on at least two color channels of the region to be processed of the target face image based on the template material acquired by the acquisition unit. The face image processing apparatus provided in the embodiment of the present disclosure can accurately determine the region to be processed of the target face image, and perform weighting processing on at least two color channels of the region to be processed of the target face image based on the template material, so that the target face image after the weighting processing has a better beautifying effect, and the user experience is improved. In addition, the face image processing method provided in the embodiment of the present disclosure does not need to process each frame of the target face image in real time, but only needs to perform pixel correction processing on the pixel values of each key point of the region to be processed of the target face image, so that the processing efficiency of the face image is improved.

[0131] As shown in Figure 8 The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the method steps described above.

[0132] The embodiment of the present disclosure provides a storage medium storing computer readable instructions, and a computer program is stored on the storage medium. The program is executed by the processor to implement the method steps described above.

[0133] The following will be described with reference to Figure 8, which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 8 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0134] like Figure 8 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the electronic device are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0135] Typically, the following devices may be connected to the I / O interface 805: an input device 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. The communication device 809 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0136] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0137] Note that the computer readable medium described above can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the foregoing. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus or device. In the disclosure, the computer readable signal medium can include a computer readable program code propagated on or through a computer readable medium, in baseband or as part of a carrier wave. The computer readable signal medium can take a variety of forms, including but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device. Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0138] The computer readable medium described above can be included in the electronic device described above; alternatively, the computer readable medium can exist as a separate entity in which the electronic device is incorporated.

[0139] Computer program code for carrying out operations of the disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0140] The flow and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow and block diagrams can represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logic functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may be executed in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or combinations of hardware and software.

[0141] The units described in the embodiments of the present disclosure can be implemented by software or by hardware. In some cases, the names of the units do not constitute a limitation on the units themselves.

Claims

1. A method for processing a face image, characterized by, The method comprises: acquiring a target face image, and extracting key point data of the target face image from the target face image; Acquiring a template material, and drawing the template material into a blank texture in a preset manner, so that the template material corresponds to a region to be processed of a target face image; Based on the template material, at least two color channels of the region to be processed of the target face image are weighted processed; The drawing of the template material into the blank texture in the preset manner comprises: Based on the key point data of the target face image, a fusion region of the target face image in the blank texture is determined; texture data of the template material is acquired; and the template material is drawn into the fusion region in the blank texture according to the indexed manner and the texture data of the template material; The weighted processing of the at least two color channels of the region to be processed of the target face image based on the template material comprises: A first brightening weight value for brightening processing of the target region in a first channel is determined; and the weighted processing of the region to be processed of the target face image based on the template material in the first channel is performed according to the first brightening weight value, a pixel value corresponding to each key point of the target face image, so that the brightening processing of the region to be processed of the target face image in the first channel is performed.

2. The method of claim 1, wherein, The first channel is a blue channel, and the weighted processing of the at least two color channels of the region to be processed of the target face image based on the template material comprises: A first brightening weight value for brightening processing of the target region in the blue channel is determined; The weighted processing of the region to be processed of the target face image based on the template material in the blue channel is performed according to the first brightening weight value, a pixel value corresponding to each key point of the target face image, so that the brightening processing of the region to be processed of the target face image in the blue channel is performed.

3. The method of claim 2, wherein, The determination of the first brightening weight value comprises: A first preset input weight value, a second preset input weight value, a blue color extracted from the template material, and a first weighting coefficient for weighted processing in the blue channel are acquired, and a sum of the first preset input weight value and the second preset input weight value is 1; The first brightening weight value is determined according to the first preset input weight value, the second preset input weight value, the blue color extracted from the template material, and the first weighting coefficient for weighted processing in the blue channel.

4. The method of claim 1, wherein, The weighted processing of the at least two color channels of the region to be processed of the target face image based on the template material further comprises: a second channel is a green channel; A second brightening weight value for brightening processing of the target region in the green channel is determined; The second brightening weight value, the pixel value corresponding to each key point of the target face image, and the green channel are used to perform weighted processing on the region to be processed of the target face image based on the template material, so that the region to be processed of the target face image is brightened in the green channel.

5. The method of claim 4, wherein, The second brightening weight value is determined by: The first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighted processing in the green channel are obtained, and the sum of the first preset input weight value and the second preset input weight value is 1. The second brightening weight value is determined according to the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighted processing in the green channel.

6. The method of claim 1, wherein, The target region is the region where the sleeping silkworm is located.

7. An apparatus for processing a face image, characterized by comprising: The device comprises an acquisition unit, an extraction unit, a drawing unit, and a weighted processing unit. The acquisition unit is configured to acquire a target face image and a template material. The extraction unit is configured to extract key point data of the target face image from the target face image acquired by the acquisition unit. The drawing unit is configured to draw the template material acquired by the acquisition unit into a blank texture in a preset manner, so that the template material corresponds to a region to be processed of the target face image. The weighted processing unit is configured to perform weighted processing on at least two color channels of the region to be processed of the target face image based on the template material acquired by the acquisition unit. The device further comprises: The determination unit is configured to determine a fusion region of the target face image in the blank texture based on the key point data of the target face image extracted by the extraction unit. The acquisition unit is further configured to acquire texture data of the template material. The drawing unit is specifically configured to draw the template material into the fusion region in the blank texture according to the indexed manner and the texture data of the template material. The device further comprises: The determination unit is further configured to determine a first brightening weight value for brightening the target region in the first channel. The weighted processing unit is configured to perform weighted processing on the region to be processed of the target face image based on the template material according to the first brightening weight value determined by the determination unit, the pixel value corresponding to each key point of the target face image, and the first channel, so that the region to be processed of the target face image is brightened in the first channel.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor runs the computer program to implement the method of any one of claims 1-6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Weighing characteristic face recognition method for multichannel pulse coupling neural network

    CN103345624A

  • Image processing method and device, electronic equipment and readable storage medium

    CN108765272A