Image processing method, device, electronic device and storage medium

By matching the color values of the hair and eyebrow areas in the image and adjusting the color values of eyelashes and skin areas, the problem of image aesthetics caused by inconsistent hair color and eyebrow colors and the stiffness of eyebrow sticker technology is solved, achieving a more natural and beautiful image processing effect.

CN112184540BActive Publication Date: 2025-08-08BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910589702.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-02
Publication Date
2025-08-08
Estimated Expiration
2039-07-02

AI Technical Summary

Technical Problem

The image aesthetics of users due to inconsistent hair color and eyebrow color are reduced, as well as the problem that existing eyebrow sticker technology is stiff and easy to penetrate when facial expressions change.

Method used

By matching the color values of the hair area and eyebrow area of the person in the image, the difference is within the preset range, adjust the hair color and eyebrow color to achieve consistency, and combine the color values of the eyelashes and skin areas to improve the naturalness and aesthetics of the image.

Benefits of technology

It effectively reduces the difference in hair color and eyebrow color, improves the authenticity and aesthetics of the faces of the characters in the image, and solves the problem of stiff visual effects and inconvenience of expression changes in eyebrow sticker technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112184540B_ABST
    Figure CN112184540B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing method, apparatus, electronic device, and storage medium; wherein the method comprises: determining a hair region and an eyebrow region of a person in a target image showing a human face; and matching a color value of the hair region with a color value of the eyebrow region so that a difference between the color values of the hair region and the eyebrow region is within a first preset range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, electronic device, and storage medium. Background Art

[0002] Many users dye their hair to suit their style or mood. However, due to the small size of eyebrows, dyeing them is difficult, or because users fear the dye will damage their facial skin, most users dye their hair without dyeing their eyebrows. This creates a mismatch between the hair and eyebrow colors, which can make the user's overall appearance look awkward. This can also affect the aesthetics of the user's image.

[0003] To solve the above problems, the relevant technology pre-sets a variety of eyebrow sticker materials of different colors in an application (APP) with image processing function. After the user selects the eyebrow sticker of the required color as needed, the eyebrow sticker selected by the user is covered on the eyebrow part of the current user image to achieve the change of the eyebrow color in the user image, thereby improving the beauty of the user image to a certain extent.

[0004] However, the eyebrow stickers provided by related technologies only match the eyebrow shape of the user's normal facial expression. If the user raises their eyebrows, frowns, or even makes other facial expressions, the eyebrow stickers corresponding to only one expression will not match the eyebrow shape of the user's other expressions. If the user still uses the eyebrow stickers to replace the original eyebrows, it may make the user's image look more awkward. Moreover, the related technology uses eyebrow stickers to directly cover the user's eyebrows, which produces a harsh visual effect and is easy to expose. It can be understood that the viewer can easily notice that the eyebrows in the user's image are fake. Summary of the Invention

[0005] To overcome the problems existing in the related art, the present disclosure provides an image processing method, an apparatus, an electronic device, and a storage medium.

[0006] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, the method comprising:

[0007] Determine the hair region and eyebrow region of a person in a target image showing a face;

[0008] The color value of the hair region and the color value of the eyebrow region are matched so that the difference between the color value of the hair region and the color value of the eyebrow region is within a first preset range.

[0009] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, including:

[0010] The first determining module is used to determine the hair area and the eyebrow area of the person in the target image showing the human face;

[0011] The first matching module is configured to match the color value of the hair region with the color value of the eyebrow region so that the difference between the color value of the hair region and the color value of the eyebrow region is within a first preset range.

[0012] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0013] processor;

[0014] a memory for storing a computer program executable by the processor;

[0015] Wherein, the processor implements the steps of the image processing method when executing the program.

[0016] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the image processing method are implemented.

[0017] The technical methods provided by the embodiments of the present disclosure bring at least the following beneficial technical effects:

[0018] By matching the color values of the hair area and the eyebrow area of the person shown in the image so that the difference in color values between the two is within a first preset range, not only can the hair color and eyebrow color of the person shown in the image be avoided from being too different, thereby affecting the beauty of the person's appearance, but also the problem of stiff visual effects and easy exposure caused by the related technology of using eyebrow stickers to directly cover the eyebrow area of the person can be solved, which is conducive to improving the authenticity, beauty and naturalness of the person's face in the processed image.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a flowchart of an image processing method according to an exemplary embodiment of the present disclosure;

[0021] Figure 2 is a schematic diagram of an original target image according to an exemplary embodiment of the present disclosure;

[0022] Figure 3 This disclosure is shown according to an exemplary embodiment Figure 2A schematic diagram of a target image obtained after the original target image in is processed by one of the image processing methods provided in the embodiments of the present disclosure;

[0023] Figure 4 is a structural block diagram of an image processing device according to an exemplary embodiment of the present disclosure;

[0024] Figure 5 The figure is a structural block diagram of an electronic device showing an image processing apparatus according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.

[0026] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0027] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining."

[0028] Current camera applications generally offer a number of common image processing features, such as filters, image color conversion, and stickers, to facilitate user manipulation of images captured, downloaded, or otherwise acquired, to achieve desired effects, such as beautification, cosmetic enhancements, or retro effects. For example, for users whose hair and eyebrow colors are inconsistent, images captured by the user may be affected by this discrepancy. Therefore, users may need to replace their original eyebrows with eyebrow stickers provided by current camera applications to minimize the discrepancy between the two colors. However, the eyebrow shapes associated with eyebrow stickers provided in related art are typically those associated with a user's normal facial expression. If a user raises their eyebrows, frowns, or performs other facial expressions, an eyebrow sticker designed to correspond to only one expression may not be consistent with the user's other facial expressions. If the user continues to use an eyebrow sticker to replace the original eyebrows, the resulting image may appear even more disjointed. Moreover, the related technology uses eyebrow stickers to directly cover the user's eyebrow area, which produces a relatively stiff visual effect and is easy to be exposed. It can be understood that it is easy for viewers to find that the eyebrows in the user's image are fake.

[0029] Based on this, the embodiment of the present disclosure proposes a new image processing method, which matches the color values of the hair area and the eyebrow area of the person shown in the image so that the difference in color value between the two is within a first preset range. This not only avoids the hair color and eyebrow color of the person shown in the image being too different, thereby affecting the beauty of the person's appearance, but also solves the problem of stiff visual effects and easy exposure caused by the related technology of using eyebrow stickers to directly cover the eyebrow area of the person, which is conducive to improving the authenticity, beauty and naturalness of the person's face in the processed image.

[0030] like Figure 1 As shown, Figure 1 This is a flowchart illustrating an image processing method according to an exemplary embodiment of the present disclosure. The method can be applied to a terminal, for example, a camera or photo album system built into the terminal, or a third-party camera or photo album application installed in the terminal, or as an image processing function built into the system, or installed in the terminal as a new application. The method includes the following steps:

[0031] In step S011, the hair region and eyebrow region of a person in a target image showing a face are determined;

[0032] In step S012, the color value of the hair region and the color value of the eyebrow region are matched so that the difference between the color value of the hair region and the color value of the eyebrow region is within a first preset range.

[0033] In the above, the target image can be obtained by performing facial recognition processing on the currently input image. The currently input image can be automatically detected and obtained by the system. For example, when the system detects that the number of images stored in the terminal has increased, it can use the newly added image as the currently input image. Alternatively, the currently input image can be obtained based on user operation. For example, the user can first specify the image to be processed on the application interface of an application that can execute the method, and then click on the control for indicating matching hair color and eyebrow color provided in the application interface to trigger the generation of a user instruction for indicating matching hair color and eyebrow color, so that the currently input image can be obtained and processed accordingly according to the user instruction.

[0034] Based on this, in order to avoid the system from freezing due to the large amount of calculation generated by automatically detecting the current input image and triggering the steps S011 and S012, which causes excessive use of system computing resources and affects the user experience, in one embodiment, the step S011 can be executed only when the instruction is received. Based on this, the step S011 can be adaptively adjusted to: when a user instruction for instructing to match hair color and eyebrow color is received, the hair area and eyebrow area of the character in the current input image are determined.

[0035] Therefore, the image currently input by the user can be obtained according to the user instruction and the image can be processed in a targeted manner, which can meet the user's processing needs for the specified image without the need to execute the detection step of the new image or the step of image processing each new image to match the hair color and eyebrow color of the person in the image, thereby greatly reducing the system's computing power and avoiding system freezes caused by excessive occupation of system computing resources.

[0036] As can be seen from the above, when the user needs to adjust the eyebrow and hair colors of the person in the specified image to be relatively consistent, the image input to the system is generally an image showing a face. In this case, the currently input image is the target image showing a face. However, it is not ruled out that the user accidentally selects an image that does not show a face and triggers the user instruction. In this case, if the image continues to be matched with the hair color and eyebrow color based on the instruction, it is likely to cause the system to crash or mistakenly believe that a face exists and recognize eyebrow and hair areas that do not actually exist, which not only affects the final image processing effect but also causes unnecessary calculation operations. Because, to solve this technical problem, in one embodiment, in step S011, the determination of the hair and eyebrow areas of the person in the target image showing a face includes:

[0037] In step S0111, a currently input image is obtained and face recognition is performed on the currently input image;

[0038] In step S0112, it is determined whether there is a face in the currently input image based on the face recognition result;

[0039] In step S0113, when a human face exists in the currently input image, the currently input image is determined to be the target image, and the hair region and eyebrow region of the person in the target image are identified;

[0040] In step S0114 , when the currently input image does not contain a human face, a prompt message is output to prompt the user to re-input an image showing a human face.

[0041] In the above, since relatively mature technologies for face recognition, hair region recognition, and eyebrow region recognition already exist, for example, AI face image recognition technology can be used to recognize faces, hair regions, and eyebrow regions, and this disclosure does not elaborate on this. In addition, the prompt information can be output on the screen or played through a voice module.

[0042] Therefore, the above embodiment first performs face recognition on the currently input image, identifies the hair area and eyebrow area of the person in the target image when the currently input image is a target image showing a face, and directly outputs the prompt information without identifying the hair area and eyebrow area when the currently input image does not show a face. This can avoid the system error crash caused by continuing to identify the input image that does not show a face or the problem of continuing to identify the hair area and eyebrow area, which is beneficial to ensuring the stability of system operation and reducing unnecessary operation operations.

[0043] After obtaining the hair region and eyebrow region of the person in the target image, step S012 may be performed to ensure that the difference between the color values of the hair region and the color values of the eyebrow region is within a first preset range. To ensure that the difference between the color values of the hair region and the color values of the eyebrow region is within the first preset range, the present embodiment provides multiple technical solutions for matching the color values of the hair region and the color values of the eyebrow region. Please refer to the following:

[0044] In the first embodiment, in order to improve the consistency of the hair color and the eyebrow color after the matching process and achieve a better image processing effect, the first preset range can be represented as a zero value. Based on this, the step of matching the color value of the hair area with the color value of the eyebrow area in step S012 can include:

[0045] In step S01211, a hair color value is determined based on the hair region; the hair color value is used to represent the hair color of the person displayed in the current target image;

[0046] In step S01212, the color value of the eyebrow area is set to the hair color value.

[0047] It can be seen from step S01211 and step S01212 that after obtaining the hair area and the eyebrow area, only the hair color value in the hair area can be extracted. Finally, the color value of the eyebrow area only needs to be set as the hair color value, and there is no need to extract the color value of the eyebrow area separately. This not only ensures the consistency of the hair color and eyebrow color of the character in the target image and achieves a good image processing effect, but also reduces the data required for extraction and the number of calculation steps, which is conducive to improving the matching efficiency of hair color and eyebrow color.

[0048] Similar to the first embodiment, in the second embodiment, the first preset range is also represented as a zero value. Based on this, in step S012, the step of matching the color value of the hair region with the color value of the eyebrow region may include:

[0049] In step S01221, an eyebrow color value is determined based on the eyebrow area; the eyebrow color value is used to represent the eyebrow color of the person displayed in the current target image;

[0050] In step S01222, the color value of the hair area is set to the eyebrow color value.

[0051] It can be seen from step S01221 and step S01222 that after obtaining the hair region and the eyebrow region, only the eyebrow color value in the eyebrow region can be extracted. Finally, the color value of the hair region only needs to be set as the eyebrow color value, and there is no need to extract the color value of the hair region separately. This not only ensures the consistency of the hair color and eyebrow color of the character in the target image and achieves a good image processing effect, but also reduces the data required for extraction and the number of calculation steps, which is conducive to improving the matching efficiency of hair color and eyebrow color.

[0052] In a third embodiment, in step S012, the step of matching the color value of the hair region with the color value of the eyebrow region may include:

[0053] In step S01231, when the difference between the color value of the hair region and the color value of the eyebrow region is not within the first preset range, the color value of the hair region or the color value of the eyebrow region is updated so that the color value difference calculated based on the updated color value is within the first preset range.

[0054] In a third embodiment, corresponding hair color values and eyebrow color values can be extracted from the hair region and the eyebrow region, respectively. A determination is then made as to whether the difference between the hair color value and the eyebrow color value is within the first preset range. If not, the color value of the eyebrow region or the hair region can be updated based on the difference. For example, assuming the difference between the hair color value and the eyebrow color value is a positive number, and the right endpoint threshold of the preset range is b, where a is greater than b by 2, the hair color value can be updated to the difference between the original hair color value and the value 2, or the eyebrow color value can be updated to the sum of the original eyebrow color value and the value 2. The value 2 is not the only option; any value that ensures that the color value difference calculated based on the updated color value is within the first preset range is sufficient.

[0055] It should be noted that the color value can be expressed as an RGB color value or as a hexadecimal color code. The first preset range can be set by the user according to actual needs, or can be preset by the developer during the development phase based on experience or experiments. For example, the first preset range can be represented by a numerical value or an interval, and this disclosure does not limit this. Among them, if the first preset range is represented by an interval, since the difference between the hair color value and the eyebrow color value may be a positive number or a negative number, based on this, the left endpoint threshold of the interval can be a negative number, and the right endpoint threshold can be a positive number, and the absolute values of the negative and positive numbers can be the same or different.

[0056] When the color value is represented as an RGB color value, the color value includes the values of the three RGB channels, namely, the R value, the G value, and the B value. Based on this, the difference between the color value of the hair region and the color value of the eyebrow region includes the R value difference, the G value difference, and the B value difference. Accordingly, the color value difference being within the first preset range can be understood as any difference among the R value difference, the G value difference, and the B value difference being within the first preset range. When the color value is represented as a hexadecimal color code, the color value includes only one hexadecimal color code. Based on this, the difference between the color value of the hair region and the color value of the eyebrow region can be expressed as the difference between the hexadecimal color code corresponding to the hair color and the hexadecimal color code corresponding to the eyebrow color.

[0057] In addition, if it is not desired to include negative numbers in the interval and it is desired to use non-negative numbers to constitute the interval, then in another embodiment, the solution in step S012 can be adaptively adjusted. For example, the description that the difference between the color value of the hair region and the color value of the eyebrow region is within a first preset range can be adjusted to: the absolute value of the difference between the color value of the hair region and the color value of the eyebrow region is within the first preset range.

[0058] In a fourth embodiment, to ensure consistency between a person's hair and eyebrow colors while satisfying a user's need to set the color values of the hair and eyebrow regions of the same person in the target image to be different from the original hair and eyebrow colors, in step S011, the step of determining the hair and eyebrow regions of a person in the target image displaying a human face is performed upon receiving a user instruction for matching hair and eyebrow colors, the user instruction carrying the user-set target color values. In step S012, the step of matching the color values of the hair and eyebrow regions may include:

[0059] In step S01241, the target color values set by the user for the hair area and the eyebrow area are determined according to the user instruction;

[0060] In step S01242, the color values of the hair area and the eyebrow area are both set to the target color values.

[0061] Therefore, through the fourth implementation scheme, the user can change the original hair color and eyebrow color of the character in the target image as needed, which can meet more user needs and improve user interest.

[0062] It should be noted that, in the present disclosure, the hair region and the eyebrow region belong to the same person in the target image.

[0063] Thus, by using the hair color and eyebrow color matching solution in any of the above embodiments, the difference between the hair color and the eyebrow color in the target image can be reduced, for example, Figure 2 and Figure 3 As shown, Figure 2 is a schematic diagram of an original target image according to an exemplary embodiment of the present disclosure. Figure 3 This disclosure is shown according to an exemplary embodiment Figure 2 A schematic diagram of a target image obtained after the original target image in is processed by one of the image processing methods provided in the embodiments of the present disclosure. Figure 2 and Figure 3 It can be seen that after the hair color and eyebrow color matching process, the eyebrow color of the character in the updated target image is the same as the hair color, where Figure 3The black border around the eyebrow region is intended to clearly indicate the area depicted by the eyebrows. In practice, if a person's hair color is purple and their eyebrows are black, then after processing using the method described in any embodiment of the present disclosure, the eyebrow and hair colors of the person in the updated target image can be both purple, both black, or both the target color values set by the user. In either case, the hair and eyebrow colors of the person in the updated target image are similar or identical, achieving a good beautification effect. Furthermore, by identifying the eyebrow and hair regions and then updating the color values of the eyebrow and / or hair regions, changes in the eyebrow or hair regions can be effectively avoided, ensuring that the shape of the person's eyebrows after the color value update is consistent with the person's facial expression in the original image. This solves the problem in related art of using eyebrow stickers to directly cover a person's eyebrow region, resulting in a stiff visual effect, easy to make mistakes, and inapplicable to different expressions or different eyebrow shapes. This helps improve the authenticity, aesthetics, and naturalness of the person's face in the processed image.

[0064] In addition to matching the hair color and eyebrow color of the person in the image, in order to meet the user's need for beautification of other areas of the person in the image and enhance the visual effect and aesthetics of the processed image, in one embodiment, based on any of the above embodiments, the method may further include:

[0065] In step S021, the eyelash region in the target image is determined;

[0066] In step S022, the color value of the eyelash region is matched according to the color value of the hair region or the eyebrow region, so that the difference between the color value of the hair region or the eyebrow region and the color value of the eyelash region is within a second preset range.

[0067] In the above description, the eyelash region of the person in the target image can be identified using AI facial recognition technology in related art, which will not be described in detail here. Similarly, the eyelash region, the hair region, and the eyebrow region all belong to the same person in the target image. The value range of the second preset range can be the same as or different from the value range of the first preset range.

[0068] In addition, the principle of matching the color value of the eyelash region with the color value of the hair region or the eyebrow region is the same as the principle of matching the color values of the hair region and the eyebrow region. Therefore, reference may be made to the above-mentioned matching scheme of hair color and eyebrow color, which will not be described in detail here.

[0069] Therefore, by further matching the color value of the eyelash area with the color value of the hair area or the eyebrow area, the hair color, eyebrow color and eyelash color of the person in the target image can be made similar or the same, which can improve the coordination of the visual effects of the three, thereby improving the image processing effect and the image aesthetics.

[0070] In addition, for users who wear makeup, they may only apply makeup to their face and not their neck. This may result in inconsistent colors between the face and neck, causing a significant difference in color between the face and neck regions displayed in the captured target image, affecting the visual effect and aesthetics of the image. Therefore, to address this technical issue and meet users' needs for beautifying other areas of the image character, based on any of the above embodiments, in one embodiment, the method may further include:

[0071] In step S031, the facial skin area and the neck area in the target image are determined;

[0072] In step S032, the color values of the facial skin area and the neck area are matched so that the difference between the color values of the facial skin area and the neck area is within a third preset range.

[0073] In the above, the facial skin area and neck area of the person in the target image can be identified using AI facial recognition technology in related technologies, which will not be described in detail here. Similarly, the facial skin area and neck area represent the same person in the target image. The value range of the third preset range can be the same as the value range of the first preset range, or it can be different.

[0074] In addition, the principle of matching the color value of the facial skin area with the color value of the neck area is the same as the principle of matching the color value of the hair area with the eyebrow area. Therefore, you can refer to the above-mentioned hair color and eyebrow color matching scheme, which will not be repeated here.

[0075] Therefore, by further matching the color value of the facial skin area with the color value of the neck area, the facial skin and neck skin of the person in the target image can be made similar or the same, which can improve the image processing effect and image aesthetics.

[0076] In addition, for some users, the facial area displayed in the captured target image may contain blocks of different colors and shadows due to birthmarks or facial injuries, uneven facial color due to physical reasons, or problems with lighting angles, thus affecting the visual effect and aesthetics of the image. Therefore, to solve this technical problem and meet the user's needs for beautification of other areas of the image character, based on any of the above embodiments, in one embodiment, the method may further include:

[0077] In step S041, the color values of the pixels in the facial skin area of the target image are determined;

[0078] In step S042, determining whether the color of the facial skin area is uniform based on the color value of the pixel point;

[0079] In step S043, if the color of the facial skin area is uneven, the color value of the facial skin area is updated to make the color of the facial skin area uniform.

[0080] In the above, the facial skin area of the person in the target image can be identified by using AI face recognition technology in related technologies, which will not be described in detail here.

[0081] In step S042, the facial skin region may be processed using image region segmentation techniques known in the related art to determine whether there are regions with different pixel attributes. In this embodiment, the pixel attributes may include pixel color values. If there are regions with different pixel attributes, it can be considered that the color of the facial skin region is uneven. At this point, the color value of the facial skin region may be updated.

[0082] In the above, in order to make the color of the skin area of the face uniform, the embodiment of the present disclosure provides a variety of skin color value update schemes for updating the color value of the skin area of the face, please see the following

[0083] In the first example, the color value of the largest region with the largest area can be obtained, and the color values of other regions in the facial skin region except the largest region can be set to the color value of the largest region to make the color of the updated facial skin region uniform.

[0084] In the second example, the color value of the target area with the highest brightness, the middle brightness, or the lowest brightness can be obtained, and the color values of other areas in the facial skin area except the target area can be set to the color value of the target area to make the color of the updated facial skin area uniform.

[0085] In a third example, after identifying regions with different pixel attributes within the facial skin region, second prompt information may be output to prompt the user to select a designated region from the regions with different pixel attributes. After outputting the second prompt information, upon receiving a first instruction indicating the designated region selected by the user, the color value of the designated region is obtained according to the first instruction, and the color values of the remaining regions within the facial skin region, excluding the designated region, are set to the color value of the designated region, thereby achieving a uniform color in the updated facial skin region.

[0086] In a fourth example, after identifying areas with different pixel attributes within a facial skin region, third prompt information may be output to prompt the user to enter a designated color value for the facial skin region, allowing the user to uniformly change the color value of the facial skin region to another color value as needed. After outputting the third prompt information, upon receiving a second designation instruction indicating a user-selected designated color value, the user-set designated color value is obtained based on the second designation instruction, and the color value of the facial skin region is set to the designated color value.

[0087] Therefore, by further processing the facial skin area, the facial skin of the person in the target image can be changed from an uneven state to a uniform state, which can improve the image processing effect and image aesthetics, better meet user needs, and improve user experience.

[0088] Corresponding to the embodiment of the aforementioned image processing method, the present disclosure also provides an image processing device, which can be applied in a terminal. Figure 4 As shown, Figure 4 FIG4 is a structural block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure. The image processing apparatus 400 includes:

[0089] The first determining module 401 is configured to determine the hair region and eyebrow region of a person in a target image showing a face;

[0090] The first matching module 402 is configured to match the color value of the hair region with the color value of the eyebrow region so that the difference between the color value of the hair region and the color value of the eyebrow region is within a first preset range.

[0091] In one embodiment, the first matching module 402 includes:

[0092] a first hair color determination unit, configured to determine a hair color value according to the hair region; the hair color being used to represent the hair color of a person displayed in the current target image;

[0093] The first color value setting unit is used to set the color value of the eyebrow area to the hair color value.

[0094] In another embodiment, the first matching module 402 includes:

[0095] a first eyebrow color determination unit, configured to determine an eyebrow color value based on the eyebrow region; the eyebrow color value being used to represent the eyebrow color of the person displayed in the current target image;

[0096] The second color value setting unit is used to set the color value of the hair area to the eyebrow color value.

[0097] In yet another embodiment, the first matching module 402 includes:

[0098] The first color value updating unit is configured to update the color value of the hair region or the color value of the eyebrow region when the difference between the color values of the hair region and the eyebrow region is not within the first preset range, so that the color value difference calculated based on the updated color value is within the first preset range.

[0099] In another embodiment, the first determining module 401 is configured to determine the hair region and eyebrow region of a person in a target image showing a face when receiving a user instruction for instructing to match hair color and eyebrow color; wherein the user instruction carries a target color value set by the user;

[0100] The first matching module 402 includes:

[0101] a target color value determining unit, configured to determine the target color values set by the user for the hair region and the eyebrow region according to the user instruction;

[0102] The third color value setting unit is configured to set the color values of the hair region and the eyebrow region to the target color values.

[0103] In one embodiment, the apparatus 400 may further include:

[0104] A second determining module is used to determine the eyelash area in the target image;

[0105] The second matching module is configured to match the color value of the eyelash region according to the color value of the hair region or the eyebrow region, so that the difference between the color value of the hair region or the eyebrow region and the color value of the eyelash region is within a second preset range.

[0106] In one embodiment, the apparatus 400 may further include:

[0107] A third determination module is used to determine the facial skin area and the neck area in the target image;

[0108] The third matching module is used to match the color values of the facial skin area and the neck area so that the difference between the color values of the facial skin area and the neck area is within a third preset range.

[0109] In one embodiment, the apparatus 400 may further include:

[0110] a fourth determining module, configured to determine the color values of pixels contained in the facial skin area in the target image;

[0111] a fifth determining module, configured to determine whether the color of the facial skin area is uniform based on the color value of the pixel point;

[0112] The first updating module is used to update the color value of the facial skin area when the color of the facial skin area is uneven, so as to make the color of the facial skin area uniform.

[0113] The implementation process of the functions and effects of each module and unit in the above-mentioned devices is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0114] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units.

[0115] Corresponding to the embodiment of the aforementioned image processing method, the present disclosure further provides an electronic device of an image processing apparatus, the electronic device comprising:

[0116] processor;

[0117] a memory for storing a computer program executable by the processor;

[0118] When the processor executes the program, the steps of the image processing method in any of the aforementioned embodiments are implemented.

[0119] like Figure 5 As shown, Figure 5 This is a block diagram of an electronic device that includes an image processing apparatus according to an exemplary embodiment of the present disclosure. The electronic device 500 may be a computer, mobile phone, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, or other terminal device.

[0120] Reference Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 501 , a memory 502 , a power component 503 , a multimedia component 504 , an audio component 505 , an input / output (I / O) interface 506 , a sensor component 507 , and a communication component 508 .

[0121] The processing component 501 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 501 may include one or more processors 509 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 501 may include one or more modules to facilitate interaction between the processing component 501 and other components. For example, the processing component 501 may include a multimedia module to facilitate interaction between the multimedia component 504 and the processing component 501.

[0122] The memory 502 is configured to store various types of data to support operations on the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0123] The power supply assembly 503 provides power to the various components of the electronic device 500. The power supply assembly 503 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.

[0124] The multimedia component 504 includes a screen that provides an output interface between the electronic device 500 and the user. The screen may include a touch panel (TP) implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 504 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0125] The audio component 505 is configured to output and / or input audio signals. For example, the audio component 505 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 502 or transmitted via the communication component 508. In some embodiments, the audio component 505 also includes a speaker for outputting audio signals.

[0126] The I / O interface 502 provides an interface between the processing component 501 and peripheral interface modules, such as a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0127] The sensor assembly 507 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 507 can detect the open / closed state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500. The sensor assembly 507 can also detect changes in the position of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and temperature changes of the electronic device 500. The sensor assembly 507 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 507 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 507 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, a temperature sensor, a photoelectric sensor, or a GPS sensor.

[0128] The communication component 508 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G LTE, 5G NR (5G NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 508 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 508 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0129] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described methods.

[0130] The implementation process of the functions and effects of each unit in the above electronic device is specifically described in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0131] For the electronic device embodiment, the electronic device embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution. Those of ordinary skill in the art can understand and implement the disclosed solution without inventive effort.

[0132] Corresponding to the embodiments of the aforementioned image processing method, the present disclosure also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by the processor 509 of the above-mentioned electronic device, the steps of the image processing method described in any of the aforementioned embodiments are implemented.

[0133] The present disclosure may take the form of a computer program product implemented on one or more storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage may be implemented by any method or technology. Information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0134] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.

[0135] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

[0136] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. An image processing method, characterized in that: The method comprises: Determine the hair region and eyebrow region of a person in a target image showing a face; Matching the color value of the hair region and the color value of the eyebrow region so that the difference between the color value of the hair region and the color value of the eyebrow region is within a first preset range; Determining a facial skin area and a neck area in the target image, where the facial skin area and the neck area belong to the same person in the target image; Matching the color values of the facial skin area and the neck area so that the difference between the color values of the facial skin area and the neck area is within a third preset range; The step of matching the color value of the hair region with the color value of the eyebrow region comprises: When the difference between the color value of the hair region and the color value of the eyebrow region is not within the first preset range, updating the color value of the hair region or the color value of the eyebrow region so that the color value difference calculated based on the updated color value is within the first preset range; Determining an eyelash region in the target image; The color value of the eyelash region is matched according to the color value of the hair region or the eyebrow region, so that the difference between the color value of the hair region or the eyebrow region and the color value of the eyelash region is within a second preset range.

2. The method according to claim 1, characterized in that The step of matching the color value of the hair region with the color value of the eyebrow region comprises: determining a hair color value according to the hair region; the hair color value is used to represent the hair color of the person displayed in the current target image; The color value of the eyebrow area is set to the hair color value.

3. The method according to claim 1, characterized in that The step of matching the color value of the hair region with the color value of the eyebrow region comprises: determining an eyebrow color value according to the eyebrow area; the eyebrow color value is used to represent the eyebrow color of the person displayed in the current target image; The color value of the hair area is set to the eyebrow color value.

4. The method according to claim 1, wherein The step of determining the hair region and eyebrow region of a person in a target image showing a face is performed upon receiving a user instruction for instructing to match the hair color and eyebrow color, wherein the user instruction carries a target color value set by the user; The step of matching the color value of the hair region with the color value of the eyebrow region comprises: determining the target color values set by the user for the hair area and the eyebrow area according to the user instruction; The color values of the hair area and the eyebrow area are both set to the target color values.

5. The method according to claim 1, wherein The method further comprises: Determining the color values of pixels in the facial skin area of the target image; Determining whether the color of the facial skin area is uniform according to the color value of the pixel point; If the color of the facial skin area is uneven, the color value of the facial skin area is updated to make the color of the facial skin area uniform.

6. An image processing device, characterized in that The device comprises: A first determining module is used to determine the hair area and eyebrow area of a person in a target image showing a face; a first matching module, configured to match the color value of the hair region with the color value of the eyebrow region so that the difference between the color value of the hair region and the color value of the eyebrow region is within a first preset range; The first matching module includes: a first color value updating unit configured to update the color value of the hair region or the color value of the eyebrow region when the difference between the color values of the hair region and the eyebrow region is not within the first preset range, so that the color value difference calculated based on the updated color value is within the first preset range; a third determining module, configured to determine a facial skin region and a neck region in the target image, wherein the facial skin region and the neck region belong to the same person in the target image; a third matching module, configured to match the color values of the facial skin area and the neck area so that the difference between the color values of the facial skin area and the neck area is within a third preset range; A second determining module is used to determine the eyelash area in the target image; The second matching module is configured to match the color value of the eyelash region according to the color value of the hair region or the eyebrow region, so that the difference between the color value of the hair region or the eyebrow region and the color value of the eyelash region is within a second preset range.

7. The device according to claim 6, characterized in that The first matching module includes: a first hair color determination unit, configured to determine a hair color value according to the hair region; the hair color being used to represent the hair color of a person displayed in the current target image; The first color value setting unit is used to set the color value of the eyebrow area to the hair color value.

8. The device according to claim 6, characterized in that The first matching module includes: a first eyebrow color determination unit, configured to determine an eyebrow color value based on the eyebrow region; the eyebrow color value being used to represent the eyebrow color of the person displayed in the current target image; The second color value setting unit is used to set the color value of the hair area to the eyebrow color value.

9. The device according to claim 6, characterized in that The first determination module is configured to determine the hair region and eyebrow region of a person in a target image showing a face when receiving a user instruction for instructing to match hair color and eyebrow color; wherein the user instruction carries a target color value set by the user; The first matching module includes: a target color value determining unit, configured to determine the target color values set by the user for the hair region and the eyebrow region according to the user instruction; The third color value setting unit is configured to set the color values of the hair region and the eyebrow region to the target color values.

10. The device according to claim 6, characterized in that The device further comprises: a fourth determining module, configured to determine the color values of pixels contained in the facial skin area in the target image; a fifth determining module, configured to determine whether the color of the facial skin area is uniform based on the color value of the pixel point; The first updating module is used to update the color value of the facial skin area when the color of the facial skin area is uneven, so as to make the color of the facial skin area uniform.

11. An electronic device, characterized in that: include: processor; a memory for storing a computer program executable by the processor; Wherein, when the processor executes the program, the steps of the method according to any one of claims 1 to 5 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Eyebrow generating device, eyebrow generation method, and program

    JP2015121841A

  • Image processing apparatus, image processing method, and program

    JP2017130976A