Image processing method and device
By adjusting the color parameters of the character area in the image, the problem of beauty processing causing changes in the background area is solved, the combination of beauty and background protection is achieved, and the viewing effect and user satisfaction of the image are improved.
Patent Information
- Application Number
- CN202011537692.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-23
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2040-12-23
AI Technical Summary
When beauty treatment of characters in an image, the prior art tends to change the color and clear state of the background area, affecting the viewing effect of the image and reducing user satisfaction.
By obtaining the image to be processed, determining the character area, and adjusting the color parameters of the character area, ensuring that the background area remains in its original state, thus achieving the combination of beauty treatment and background protection.
It effectively ensures the viewing effect of the image, improves user satisfaction, and makes the image processing results more in line with users' beauty needs and background protection requirements.
Smart Images

Figure CN112488965B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method and device. Background Art
[0002] In the related art, a simple and easy-to-operate global image processing is used to quickly process the character image in the image. This will cause the background area in the image to change its original presentation state due to the adjustment of the character image, thereby affecting the viewing effect of the image and reducing user satisfaction. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present application hope to provide an image processing method and device, which can beautify the characters in the image while ensuring that the background area in the image remains in its original state, thereby ensuring the viewing effect of the image and further improving user satisfaction.
[0004] To achieve the above purpose, the technical solution of this application is implemented as follows:
[0005] The present application provides an image processing method, the method comprising:
[0006] Acquire the image to be processed including the object to be beautified;
[0007] Determine a portrait area occupied by the object to be beautified in the image to be processed;
[0008] The color parameters of the portrait area are adjusted to obtain a target image.
[0009] The embodiment of the present application also provides an image processing device, the image processing device comprising: an acquisition module, a determination module and an adjustment module;
[0010] The acquisition module is used to acquire an image to be processed including an object to be beautified;
[0011] The determining module is used to determine the portrait area occupied by the object to be beautified in the image to be processed;
[0012] The adjustment module is used to adjust the color parameters of the portrait area to obtain a target image.
[0013] The embodiment of the present application also provides an image processing device, the image processing device comprising: a processor, a memory and a communication bus;
[0014] The communication bus is used to realize the communication connection between the processor and the memory;
[0015] The processor is used to execute the program in the memory to implement any of the above-mentioned image processing methods.
[0016] Based on the foregoing embodiments, an embodiment of the present application provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of any of the above-mentioned image processing methods.
[0017] The disclosed embodiments of the present application disclose an image processing method and device. First, an image to be processed whose content includes an object to be beautified is obtained; secondly, a portrait area occupied by the object to be beautified in the image to be processed is determined; finally, the color parameters of the portrait area are adjusted to obtain a target image; in this way, by adjusting the color parameters of the portrait area in the image to be processed, the person in the image can be beautified while the background area in the image remains in its original state, thereby ensuring the viewing effect of the image and thus improving user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flowchart of an image processing method provided in an embodiment of the present application;
[0019] Figure 2 A flowchart of another image processing method provided in an embodiment of the present application;
[0020] Figure 3 A flowchart of another image processing method provided in an embodiment of the present application;
[0021] Figure 4 A flowchart of another image processing method provided in an embodiment of the present application;
[0022] Figure 5 A flowchart of an image processing method provided in an embodiment of the present application;
[0023] Figure 6 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0024] Figure 7 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the present application.
[0026] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0027] With the rapid popularization of smart terminals, taking photos with smart terminals has become a way of life; at the same time, in order to pursue the demand for high-quality images, beauty technology has gradually become a common function in applications using image acquisition devices in smart terminals; among them, beauty technology mainly performs skin smoothing and whitening on the characters in the image; in related technologies, when beautifying the characters in the image, it is necessary not only to consider people of different skin colors, but also to consider the user's satisfaction with the characters in the image after the skin smoothing and whitening processing.
[0028] In the related art, when performing beauty processing on images with people, the following solutions are usually adopted:
[0029] 1. Use skin color detection method to protect non-skin areas.
[0030] 2. Use global skin resurfacing and whitening method.
[0031] 3. Beautify only faces.
[0032] The above solutions have the following problems: 1. The skin color detection method is easily affected by light intensity and shadow, resulting in false detection and missed detection, especially for dark skin. The detection effect is not ideal; 2. The use of global skin smoothing and whitening will cause a large area of the background area to change its original color and clarity, which cannot achieve the effect that satisfies the user; 3. If the face is blocked and when the hand appears in the image, no corresponding processing is performed.
[0033] Based on the above problems, the present application provides an image processing method, which is applied to an image processing device. Figure 1 As shown, the method comprises the following steps:
[0034] Step 101: Obtain an image to be processed whose content includes an object to be beautified.
[0035] In the embodiment of the present application, the image processing device may be any electronic device with data processing capability.
[0036] Among them, the image processing device can collect the image to be processed based on its own internal image acquisition device, or the image processing device can parse specific video information to obtain multiple frames of images to be processed; it can also be that the image processing device receives the image to be processed sent by a device or terminal that can interact with the image acquisition device. This application does not impose any limitation on the source of the image to be processed.
[0037] It should be noted that the image to be processed may be one image or two or more images, and the present application does not impose any limitation on the number of images to be processed.
[0038] The size of the image to be processed, the color presented, etc. are not limited in this application.
[0039] In an embodiment of the present application, the picture content of the image to be processed includes but is not limited to objects to be beautified; wherein, the number of objects to be beautified may be one, two or more; and the objects to be beautified may be people, plants, etc. In the following embodiments of the present application, the objects to be beautified are taken as people as an example for explanation.
[0040] In a feasible implementation, the information presented by the image to be processed is about a staff member working in an office.
[0041] In another feasible implementation, the information presented by the image to be processed is pedestrians walking in the park.
[0042] In yet another feasible implementation, the information presented by the image to be processed is a driver driving on the road.
[0043] Based on this, this application does not impose any limitation on the object to be beautified in the image to be processed and the environmental information of the object to be beautified.
[0044] Among them, the object to be beautified can be located in the foreground area, middle ground area and background area of the image to be processed; at the same time, the object to be beautified is located at any position in the top, middle and bottom of the image to be processed, and this application does not make any limitation on this.
[0045] It should be noted that the posture information and facial expression information of the object to be beautified in the image to be processed are not limited in this application.
[0046] Among them, the image format of the image to be processed includes but is not limited to: bitmap (Bitmap, BMP) format, Joint Photographic Experts Group (Joint Photographic Experts Group, JPEG) format, Portable Network Graphics (Portable Network Graphics, PNG) format and Joint Photographic Experts Group (Joint Photographic Expert Group, JPG) format, etc. This application does not impose any limitations on this.
[0047] Step 102: Determine the portrait area occupied by the subject to be beautified in the image to be processed.
[0048] In the embodiment of the present application, the image processing device needs to determine the portrait area occupied by the object to be beautified in the image to be processed.
[0049] It should be noted that the portrait area is the image information occupied by the portrait range of the object to be beautified in the image to be processed.
[0050] In a feasible implementation manner, the portrait area determined by the image processing device includes the head area and limb area of the object to be beautified.
[0051] In another feasible implementation manner, the portrait area determined by the image processing device includes the head area and the hand area of the subject to be beautified.
[0052] In yet another feasible implementation, the portrait region determined by the image processing device includes the entire body region of the subject to be beautified.
[0053] In an embodiment of the present application, the image processing device can perform regional segmentation of the image to be processed through portrait segmentation technology to obtain the portrait area occupied by the object to be beautified in the image to be processed; wherein, the portrait segmentation technology used in the present application can directly and accurately segment the picture content of the image to be processed to obtain the portrait area and the background area.
[0054] It should be noted that before acquiring the portrait area, the image processing device can also pre-process the image to be processed, such as normalizing the pixel values of the image to be processed, adjusting the size of the image to be processed, etc. The specific implementation details of the pre-processing of the image to be processed are not limited in this application.
[0055] Step 103: Adjust the color parameters of the portrait area to obtain a target image.
[0056] In the embodiment of the present application, the image processing device adjusts the color parameters of the portrait area according to preset rules to obtain a target image.
[0057] In a feasible implementation, the image processing device adjusts the color parameters of the portrait area to obtain a target area, and uses the target area to replace the portrait area in the image to be processed to obtain a target image.
[0058] In another feasible implementation, the image processing device adjusts the color parameters of the portrait area to obtain a target area, and covers the portrait area in the image to be processed with the target area at a ratio of 1:1 to the portrait area to obtain a target image.
[0059] It should be noted that the color parameters include but are not limited to: brightness parameter and noise parameter; the brightness parameter refers to the brightness of the image, and the unit can be candela per square meter (cd / m 2 ) or nits; the noise parameter refers to the unnecessary and redundant interference information in the image data.
[0060] In the embodiment of the present application, the adjustment performed by the image processing device on the color parameters of the portrait area includes increasing or decreasing the value corresponding to the color parameter, and the present application does not impose any limitation on this.
[0061] Among them, there is a corresponding relationship between the target image and the image to be processed, that is, the color parameters of the object to be beautified in the target image are different from the color parameters of the object to be beautified in the image to be processed; at the same time, the background area of the image to be processed, that is, the part other than the portrait area, can be exactly the same as the target image.
[0062] Accordingly, the image processing device may perform preprocessing or beautification processing on the background area other than the portrait area in the target image, and the degree of beautification and the specific implementation details of the preprocessing are not limited in this application.
[0063] It should be noted that the embodiment of the present application adjusts the color parameters of the portrait area in the image to be processed, thereby avoiding the global skin smoothing and whitening used in the related technology, which causes the background area of the image to change its original color and clarity. It can ensure that the background area in the image to be processed is not affected by the beauty technology and presents the original color and clarity, thereby ensuring the user's beauty needs and ensuring that the overall presentation effect of the image to be processed conforms to the original environmental information.
[0064] The image processing method provided in the embodiment of the present application first obtains an image to be processed whose content includes an object to be beautified; secondly, determines a portrait area occupied by the object to be beautified in the image to be processed; finally, adjusts the color parameters of the portrait area to obtain a target image; in this way, by adjusting the color parameters of the portrait area in the image to be processed, the person in the image can be beautified while the background area in the image remains in its original state, thereby ensuring the viewing effect of the image and thereby improving user satisfaction.
[0065] Based on the above embodiments, the present application provides an image processing method, which is applied to an image processing device. Figure 1 and Figure 2 The steps shown are explained below:
[0066] Step 201: Use a portrait segmentation model to perform region segmentation on the image to be processed to determine the portrait region.
[0067] In an embodiment of the present application, the portrait segmentation model may be trained based on a sample image, and the portrait segmentation model used for image region division may be trained to obtain a trained portrait segmentation model.
[0068] Among them, the training process of the portrait segmentation model can be achieved in the following way: the image processing device inputs the acquired picture content including the sample image with the labeled object to be beautified into the portrait segmentation model used for image region division to divide the sample image into image regions; at the same time, the label of each sample image and the sample image information after region division are compared to obtain an output result, and a loss function of the portrait segmentation model is generated based on the output result, the network parameters of the portrait segmentation model are adjusted based on the loss function, and the sample image information is input into the portrait segmentation model again to obtain the corresponding loss function, and the training is repeated until the final loss function meets the preset convergence condition. At this time, the portrait segmentation model is a trained portrait segmentation model.
[0069] It should be noted that the portrait segmentation model trained with sample images is used in the embodiment of the present application, that is, the trained portrait segmentation model has high robustness and can better perform region segmentation on the image to be processed and determine a more accurate portrait region.
[0070] Among them, the portrait segmentation technology adopted by the portrait segmentation model belongs to a small branch of the semantic segmentation technology; at the same time, the portrait segmentation technology is generally obtained by further fine segmentation on the result of semantic segmentation; thus, in the embodiment of the present application, the portrait segmentation technology is used to divide the image to be processed into regions to obtain the portrait region. Compared with the semantic segmentation technology, the segmented region is more refined. For example, within the feasible range, the hair of the object to be beautified in the image to be processed can be distinguished.
[0071] Accordingly, the portrait area obtained by the portrait segmentation technology is more accurate and segmented than that obtained by the semantic segmentation technology. In other words, it can enable the image processing device to obtain more accurate specific information of the object to be beautified in the portrait area based on the portrait segmentation model.
[0072] It should be noted that the portrait segmentation model has many applications in real-life scenarios, such as background blur, portrait stylization, background replacement, and adding special effects.
[0073] The algorithms used in the portrait segmentation model include but are not limited to: Portrait Fully Convolutional Networks (PortraitFCN) and Semantic Human Matin (SHM).
[0074] In a feasible implementation, the image processing device can adjust the size of the image to be processed to a preset size, and input the image to be processed adjusted to the preset size into the portrait segmentation model for image region segmentation, so that the portrait segmentation model can accurately process the image to be processed.
[0075] In another feasible implementation, the image processing device may adjust the pixels of the image to be processed, and input the adjusted image to be processed into the portrait segmentation model for image region segmentation, so that the portrait segmentation model can quickly and accurately process the image to be processed.
[0076] In another feasible implementation, the image processing device can adjust the pixels and size of the image to be processed at the same time, and input the adjusted image to be processed into the portrait segmentation model for image region segmentation, so that the portrait segmentation model can quickly and accurately process the image to be processed.
[0077] When the image to be processed includes two or more objects to be beautified, the image processing device can accurately and quickly divide the portrait area corresponding to each object to be beautified.
[0078] It should be noted that the embodiment of the present application uses a portrait segmentation model to perform region segmentation on the image to be processed, eliminating the need to detect the key points of the object to be beautified in the image to be processed, such as: limb key points such as knees, feet, hands, and head key points such as eyes, mouth, and nose, one by one, making the processing simpler and faster, and its implementation process is equivalent to performing fine segmentation again on the result of semantic segmentation to obtain the required area, namely the portrait area; this can make the determined portrait area more accurate.
[0079] Step 202: Adjust the color parameters of the portrait area to obtain a target area.
[0080] In the embodiment of the present application, the image processing device can extract the determined portrait area from the image to be processed, and adjust the color parameters of the portrait area separately to obtain the adjusted portrait area, namely the target area.
[0081] It should be noted that, except for the color parameters, the target area and the portrait area can be the same in other aspects.
[0082] In a feasible implementation, the image processing device may be implemented by executing the following steps 202a to 202e:
[0083] Step 202a: perform facial key point detection on the portrait area to determine the face area and the limb area.
[0084] In an embodiment of the present application, the image processing device inputs the portrait area into a facial key point detection model, and further divides the portrait area based on the facial key point detection model to determine the facial area and limb area of the object to be beautified.
[0085] In a feasible implementation, the image processing device directly detects the key points of the face, wherein the key points of the face include detecting the nose, eyes, mouth, forehead, face and eyebrows of the object to be beautified, and performs key face detection on the portrait area to determine the face area and the limb area.
[0086] In another feasible implementation, the image processing device may perform facial key point detection on the portrait area based on several iconic areas of the face, such as the cheek area, the nose area, and the eye area, so as to determine the face area and the limb area.
[0087] It should be noted that the limb area is all areas in the portrait area except the face area; among them, the limb area and the face area may have overlapping parts. This application does not impose any restrictions on whether there is overlap between the face area and the limb area, and the size of the overlapping area.
[0088] Step 202b: determine the first attribute parameter of the face region and the second attribute parameter of the limb region.
[0089] In the embodiment of the present application, the image processing device obtains the first attribute parameter of the face area and the second attribute parameter of the limb area based on the respectively obtained face area and limb area.
[0090] Among them, the first attribute parameter includes but is not limited to: facial expression of the object to be beautified, facial skin color of the object to be beautified, gender of the object to be beautified, age range of the object to be beautified, and facial ornament information of the object to be beautified such as glasses, earrings and nose rings.
[0091] The second attribute parameter includes, but is not limited to: posture information of the limbs of the subject to be beautified, fatness information of the subject to be beautified, height information of the subject to be beautified, and clothing information of the subject to be beautified.
[0092] It should be noted that the first attribute parameter may also be a face adjustment parameter determined based on the facial area of the object to be beautified, and the face adjustment parameter includes but is not limited to: a face brightness parameter and a face noise parameter; accordingly, the second attribute parameter may also be a limb adjustment parameter determined based on the limb area of the object to be beautified, and the limb adjustment parameter includes but is not limited to: a limb brightness parameter and a limb noise parameter.
[0093] The facial brightness parameter and the limb brightness parameter may be the same or different; correspondingly, the facial noise parameter and the limb noise parameter may be the same or different.
[0094] It should be noted that the facial brightness parameter and the limb brightness parameter can be adjusted according to the brightness of the pictures presented by the facial area and the limb area respectively; correspondingly, the facial noise parameter and the limb noise parameter can be adjusted according to the interference information presented by the facial area and the limb area respectively.
[0095] Step 202c: Based on the first attribute parameter, adjust the color parameter of the face area to obtain an identified face area.
[0096] In the embodiment of the present application, the image processing device adjusts the color parameters of the face area in sequence based on the first attribute parameters, such as the above-mentioned face brightness parameter and face noise parameter, to obtain an adjusted identified face area.
[0097] It should be noted that, relative to the face region, the color parameters corresponding to the identified face region, such as the brightness parameter and the noise parameter, have changed. Correspondingly, the degree of change of the brightness parameter and the noise parameter is determined based on the first attribute parameter.
[0098] Step 202d: Based on the second attribute parameter, adjust the color parameter of the limb area to obtain the marked limb area.
[0099] In the embodiment of the present application, the image processing device sequentially adjusts the color parameters of the limb area based on the second attribute parameters, such as the limb brightness parameter and the limb noise parameter mentioned above, to obtain an adjusted identified limb area.
[0100] It should be noted that the color parameters corresponding to the marked limb area, such as the brightness parameter and the noise parameter, have changed relative to the limb area. Correspondingly, the degree of change of the brightness parameter and the noise parameter is determined based on the second attribute parameter.
[0101] Step 202e: replace the face region with the identified face region, and replace the limb region with the identified limb region, to obtain the target region.
[0102] In an embodiment of the present application, the image processing device replaces the face area with the identified face area, and replaces the limb area with the identified limb area, and combines the identified face area and the identified limb area according to a preset rule to obtain a target area.
[0103] Among them, when there is overlap between the face area and the limb area in the portrait area, first, the image processing device can integrate the first attribute parameter and the second attribute parameter, or assign weight coefficients corresponding to the first attribute parameter and the second attribute parameter, and then the image processing device generates a third attribute parameter based on the first attribute parameter, the weight coefficient of the first attribute parameter, the second attribute parameter and the weight coefficient of the second attribute parameter; wherein the third attribute parameter includes but is not limited to: a brightness adjustment parameter and a noise adjustment parameter; then the image processing device adjusts the color parameters of the overlapping area based on the brightness adjustment parameter and the noise adjustment parameter to obtain a marked overlapping area.
[0104] It should be noted that in the embodiment of the present application, the color parameters of the face area and the limb area of the portrait area are adjusted based on their corresponding attribute parameters, so that the color parameters of the face area and the limb area in the adjusted portrait area are more matched with the attribute information of the object to be beautified, thereby improving user satisfaction.
[0105] Step 203: Use the target area to replace the portrait area in the image to be processed to obtain the target image.
[0106] In a feasible implementation, the image processing device uses the target area after the color parameters are adjusted to replace the portrait area in the image to be processed in a ratio of 1:1 with the portrait area to obtain the target image.
[0107] In another feasible implementation, the image processing device may cover the portrait area in the image to be processed with the target area after the color parameters are adjusted in a ratio of 1:1 with the portrait area to obtain the target image.
[0108] It should be noted that in the embodiment of the present application, corresponding adjustments are made to the color parameters of the face area and the limb area of the portrait area respectively, which can avoid the situation in the related art where only the face of the object to be beautified is beautified, resulting in poor viewing effect because other limbs are not beautified, thereby improving user satisfaction with image beautification.
[0109] It should be noted that in the embodiment of the present application, a portrait segmentation model is used to obtain the portrait area in the image to be processed, and relevant color parameters of the obtained portrait area are adjusted. This can ensure that the background area in the image to be processed is not affected by any beautification technology, and realize beautification processing of the beautification object. It can ensure the original effect of the background area while beautifying the character, thereby improving the user's satisfaction with the image beautification.
[0110] The image processing method provided in the embodiment of the present application first uses a portrait segmentation model to determine the portrait area occupied by the object to be beautified in the image to be processed; secondly, the portrait area is further divided to obtain the corresponding face area and limb area; then, the color parameters corresponding to the face area and the limb area are adjusted to obtain the target image; in this way, by adjusting the color parameters of the portrait area in the image to be processed, the person in the image can be beautified while the background area in the image remains in its original state, thereby ensuring the viewing effect of the image and thus improving user satisfaction.
[0111] Based on the above embodiment, when the image processing device performs step 103, that is, the image processing device adjusts the color parameters of the portrait area, obtaining the target image can be achieved in a variety of ways. The embodiment of the present application provides the following two implementation methods:
[0112] It should be noted that in the embodiments of the present application, the image processing device includes but is not limited to the following two implementations:
[0113] In the first implementation, refer to Figures 1 to 3 The steps shown are explained below:
[0114] Step 301: Acquire attribute information of an object to be beautified and / or posture information of the object to be beautified and / or scene information of an image to be processed.
[0115] In an embodiment of the present application, the image processing device analyzes the image to be processed to obtain attribute information of the object to be beautified in the image to be processed, and / or posture information of the object to be beautified, and / or scene information of the image to be processed.
[0116] The attribute information of the object to be beautified includes, but is not limited to, age information, skin color information, height information, gender information, facial expression, and fatness information of the object to be beautified.
[0117] The posture information of the object to be beautified includes but is not limited to: limb presentation information, head presentation information, etc. of the object to be beautified; meanwhile, the posture information of the object to be beautified may be information such as the object to be beautified is standing, half squatting, standing, and bending over.
[0118] The scene information of the image to be processed may be scene information of the background area of the image to be processed, such as park scene information, office scene information, and home environment information.
[0119] It should be noted that when there are two or more objects to be beautified, the image processing device can not only obtain the attribute information of the objects to be beautified, and / or the posture information of the objects to be beautified, and / or the scene information of the image to be processed, but also obtain the interaction information between two or more objects to be beautified; wherein the interaction information includes but is not limited to the interaction information of the spatial positions of two or more objects to be beautified.
[0120] Step 302: Determine a first adjustment parameter based on attribute information of the object to be beautified and / or posture information of the object to be beautified and / or scene information of the image to be processed.
[0121] The first adjustment parameter includes a first noise adjustment parameter and a first brightness adjustment parameter.
[0122] In an embodiment of the present application, the image processing device analyzes the attribute information of the object to be beautified, and / or the posture information of the object to be beautified, and / or the scene information of the image to be processed to determine the first adjustment parameter.
[0123] In a feasible implementation manner, the image processing device may analyze any one parameter among the attribute information of the object to be beautified, the posture information of the object to be beautified, and the scene information of the image to be processed, and determine the first adjustment parameter.
[0124] In another feasible implementation manner, the image processing device may analyze any two parameters among the attribute information of the object to be beautified, the posture information of the object to be beautified, and the scene information of the image to be processed, and determine the first adjustment parameter.
[0125] In yet another feasible implementation, the image processing device analyzes attribute information of the object to be beautified, posture information of the object to be beautified, and scene information of the image to be processed to determine the first adjustment parameter.
[0126] In another feasible implementation, the image processing device sets weight coefficients for the attribute information of the beautification object, the posture information of the beautification object, and the scene information of the image to be processed, and determines the first adjustment parameter according to preset rules based on the corresponding weight coefficients.
[0127] The first adjustment parameter includes but is not limited to a first noise adjustment parameter and a first brightness adjustment parameter; the specific values of the first noise adjustment parameter and the first brightness adjustment parameter are not limited in this application.
[0128] It should be noted that the first brightness adjustment parameter may be used to adjust the brightness of the image presented in the portrait area; correspondingly, the first noise adjustment parameter may be used to adjust the interference information presented in the portrait area.
[0129] Accordingly, when the image processing device adjusts the color parameters of the portrait area in step 103 provided in the above embodiment to obtain the target image, it can also be implemented by the following step 303:
[0130] Step 303: Based on the first noise adjustment parameter and the first brightness adjustment parameter, adjust the color parameter of the portrait area to obtain a target image.
[0131] In the embodiment of the present application, the image processing device adjusts the color parameters of the portrait area based on the first noise adjustment parameter and the first brightness adjustment parameter to obtain a target image.
[0132] In a feasible implementation, the image processing device first adjusts the noise parameter of the portrait area based on the first noise adjustment parameter to obtain the first area; secondly, the image processing device adjusts the brightness parameter of the first area based on the first brightness adjustment parameter to obtain the target image.
[0133] In the second implementation, refer to Figure 1 , Figure 2 as well as Figure 4 The steps shown are explained below:
[0134] Step 401: Obtain position information of a portrait region in an image to be processed, and / or area ratio information between the portrait region and the image to be processed.
[0135] In an embodiment of the present application, the image processing device analyzes the image to be processed to obtain position information of the portrait area in the image to be processed and / or area ratio information between the portrait area and the image to be processed.
[0136] Among them, the position information of the portrait area in the image to be processed includes but is not limited to: the position information of the foreground area, the middle area and the background area in the image to be processed, and the position information of the top, middle, bottom, left and right directions of the image to be processed.
[0137] Among them, the area ratio information between the portrait area and the image to be processed can be the ratio of the area of the portrait area to the area of the image to be processed; at the same time, the area ratio information can be displayed in the form of numbers, percentages, etc., and the specific display form of the area ratio information is not limited in this application.
[0138] Step 402: Determine a second adjustment parameter based on the position information and / or the area ratio information.
[0139] The second adjustment parameter includes a second noise adjustment parameter and a second brightness adjustment parameter.
[0140] In an embodiment of the present application, the image processing device determines a second adjustment parameter based on the position information and / or the area ratio information; wherein the second adjustment parameter includes but is not limited to: a second noise adjustment parameter and a second brightness adjustment parameter.
[0141] It should be noted that the second noise adjustment parameter in the second adjustment parameters may be the same as or different from the first noise adjustment parameter in the first adjustment parameters; accordingly, the second brightness adjustment parameter in the second adjustment parameters may be the same as or different from the first brightness adjustment parameter in the first adjustment parameters.
[0142] In a feasible implementation manner, the image processing device may analyze any one parameter of the position information and the area ratio information to determine the second adjustment parameter.
[0143] In another feasible implementation manner, the image processing device may analyze two parameters of the position information and the area ratio information to determine the second adjustment parameter.
[0144] In another feasible implementation, the image processing device may first set the weight coefficients corresponding to the position information and the area ratio information, and then determine the second adjustment parameter based on the position information, the weight coefficient of the position information, the area ratio information, and the weight coefficient of the area ratio information.
[0145] It should be noted that the second brightness adjustment parameter may be used to adjust the brightness of the image presented in the portrait area; correspondingly, the second noise adjustment parameter may be used to adjust the interference information presented in the portrait area.
[0146] Accordingly, when the image processing device adjusts the color parameters of the portrait area in step 103 provided in the above embodiment to obtain the target image, it can also be implemented by the following step 403:
[0147] Step 403: Based on the second noise adjustment parameter and the second brightness adjustment parameter, the color parameter of the portrait area is adjusted to obtain a target image.
[0148] In the embodiment of the present application, the image processing device adjusts the color parameters of the portrait area based on the second noise adjustment parameter and the second brightness adjustment parameter to obtain the target image.
[0149] In a feasible implementation, the image processing device first adjusts the noise parameter of the portrait area based on the second noise adjustment parameter to obtain the first area; secondly, the image processing device adjusts the brightness parameter of the first area based on the second brightness adjustment parameter to obtain the target image.
[0150] It should be noted that in the embodiment of the present application, the image processing device can adjust the color parameters of the portrait area based on relevant information of the image to be processed, such as: attribute information of the object to be beautified, posture information of the object to be beautified, scene information of the image to be processed, position information of the portrait area in the image to be processed, and area ratio information between the portrait area and the image to be processed, etc., thereby realizing the adjustment of color parameters based on diversified parameters and providing users with a variety of schemes for adjusting color parameters. In this way, the phenomenon that the skin color detection method used in the related art has unsatisfactory detection effect for dark skin color and is easily affected by light intensity and shadow can be avoided. In other words, a rich and diverse beauty scheme can be provided, which can increase the probability of improving users' beauty satisfaction with the image to be processed.
[0151] The image processing method provided in the embodiment of the present application; first, a portrait segmentation model is used to determine the portrait area occupied by the object to be beautified in the image to be processed; secondly, based on the relevant information of the image to be processed, such as: attribute information of the object to be beautified, posture information of the object to be beautified, scene information of the image to be processed, position information of the portrait area in the image to be processed, and area ratio information between the portrait area and the image to be processed, etc., the color parameters of the portrait area are adjusted to obtain a target image; in this way, the color parameters of the portrait area in the image to be processed are adjusted through a variety of parameter information, so that the characters in the image are beautified while the background area in the image is kept in its original state, so that the viewing effect of the image can be guaranteed while enriching the beauty scheme, thereby improving user satisfaction.
[0152] Based on the above embodiments, after executing step 103, the image processing device in the embodiment of the present application may further execute other steps to enrich the image processing method of the present solution. Three implementation plans are given below:
[0153] It should be noted that in the embodiments of the present application, the steps performed by the image processing device include but are not limited to the following three implementation schemes:
[0154] The first implementation scheme provided in the present application example is:
[0155] Step A1: determine the outline of the portrait area.
[0156] In the embodiment of the present application, the image processing device can also determine the outline of the portrait area based on the portrait area obtained by the portrait segmentation model.
[0157] The outline of the portrait area may represent line information of the portrait appearance of the subject to be beautified in the image to be processed.
[0158] It should be noted that the outline of the portrait area may be a dividing line between the portrait area and the background area in the image to be processed; wherein the pixel value of the dividing line may be a real number between [-1, 1].
[0159] Step A2: In the portrait area, the definition of the contour is enhanced to obtain an enhanced target image.
[0160] In the embodiment of the present application, the image processing device can enhance the clarity of the contour in the portrait area to obtain an enhanced target image.
[0161] In a feasible implementation, the image processing device may enhance the clarity of the contour based on the pixel values in the portrait area to obtain an enhanced target image.
[0162] In another feasible implementation, the image processing device may enhance the clear area of the contour based on the pixel values of the background area excluding the portrait area in the image to be processed to obtain an enhanced target image.
[0163] It should be noted that, in the embodiment of the present application, the clarity of the contour area of the portrait area is enhanced, which can improve the presentation effect of the portrait area in the target image.
[0164] The second implementation scheme provided in the examples of this application:
[0165] Step B1: Acquire special effect information that matches the facial information and / or posture information of the object to be beautified.
[0166] In a feasible implementation, the image processing device analyzes the obtained target image to obtain facial information and / or posture information of the object to be beautified.
[0167] In another feasible implementation manner, the image processing device analyzes the portrait area or the image to be processed to obtain facial information and / or posture information of the object to be beautified.
[0168] Among them, facial information refers to information such as the emotions, skin color, and weight of the subject to be beautified; correspondingly, posture information refers to information such as standing, sitting, lying, and walking of the subject to be beautified.
[0169] It should be noted that the special effect information matched with the facial information and / or posture information includes: text information, video information, music information, picture information, etc.
[0170] In a feasible implementation, if the facial information of the object to be beautified indicates that the object is in a happy state, the special effect information matching it may be a smiley face symbol, a piece of happy music, text indicating happiness, and the like.
[0171] In another feasible implementation, if the posture information of the object to be beautified indicates that the object to be beautified is in a walking state, the special effect information matched therewith may be text indicating walking, a piece of music related to walking, or a video of walking.
[0172] In another feasible implementation, if the facial expression of the object to be beautified indicates that the object is in a sad state, and the posture information indicates that the object is in a half-squatting state, the special effects information that matches it may be a picture of an animal in a half-squatting state or a crying emoticon, etc.
[0173] It should be noted that the special effect information can be one or two or more, and this application does not impose any limitation on the specific number and form of expression of the special effect information.
[0174] Step B2: based on the special effect information, update the target image to obtain a target special effect image.
[0175] In the embodiment of the present application, the image processing device updates the target image based on the determined special effect information to obtain a target special effect image.
[0176] Among them, the image processing device can set the special effect information at any position such as the top, middle, bottom, left and right of the target image; at the same time, the image processing device can also set the special effect information in the portrait area and / or background area of the target image according to a preset strategy to obtain the target special effect image.
[0177] It should be noted that the embodiments of the present application are based on adding special effect information to the target image, which can enhance the interest of the target image and enrich the picture information of the target image.
[0178] A third implementation scheme provided by an embodiment of the present application: when the picture content of the target image includes identification information, the identification information is blurred to different degrees to at least obtain an identification image that does not reflect the identification information.
[0179] Among them, the identification information can uniquely identify the object to be beautified.
[0180] In an embodiment of the present application, the image processing device analyzes the target image and / or the image to be processed, and when it is determined that the picture content of the target image finally generated includes identification information, the identification information needs to be blurred to varying degrees to obtain a corresponding identification image.
[0181] The identification information can uniquely identify the object to be beautified, that is, the identification information can be the name of the object to be beautified, the ID card information of the object to be beautified, etc.
[0182] Among them, different degrees of blur processing include but are not limited to hiding, blurring, mosaicing, encrypting and shielding the identification information. The specific form of blur processing is not limited in this application.
[0183] In an embodiment of the present application, the image processing device may perform blur processing to varying degrees based on the attribute information of the identification information.
[0184] It should be noted that the image processing device performs different degrees of blurring on the identification information in the target image that can uniquely identify the object to be beautified, thereby protecting the personal privacy information of the object to be beautified.
[0185] Based on the above embodiment, in the embodiment of the present application, when there are at least two objects to be beautified in the image to be processed, the image processing device adjusts the color parameters of the portrait area to obtain the target area when executing step 202 in the above embodiment, which can be achieved by the following steps D1 to D3:
[0186] Step D1: Obtain location information of at least two objects to be beautified.
[0187] In an embodiment of the present application, the image processing device obtains the position information of each object to be beautified respectively; wherein, the position information of any two objects to be beautified in the image to be processed may partially overlap or may be completely different, and the present application does not impose any limitation on this.
[0188] Step D2: based on the position information, determine the position area of each object to be beautified in the image to be processed.
[0189] In an embodiment of the present application, the image processing device uses a portrait segmentation model to perform region segmentation on the image to be processed based on the position information of each object to be beautified, so as to determine the position area of each object to be beautified in the image to be processed; wherein the position area can be any position area in the image to be processed.
[0190] Step D3: Adjust the color parameters of each position area to obtain the target area.
[0191] In the embodiment of the present application, the image processing device adjusts the color parameters of each position area to obtain the target area.
[0192] In a feasible implementation method, the image processing device obtains basic information of each object to be beautified; wherein the basic information includes but is not limited to: facial information, posture information, skin color information, age information and gender information of the object to be beautified. Based on the basic information of each object to be beautified, the image processing device adjusts the color parameters of the position area of each object to be beautified to obtain an adjusted position area, i.e., the target area.
[0193] In another feasible implementation method, the image processing device obtains the facial area and limb area of each object to be beautified; and determines the facial attribute parameters to be adjusted of the facial area of each object to be beautified, and the limb attribute parameters to be adjusted of the limb area of each object to be beautified; then, based on the facial attribute parameters to be adjusted of the facial area of each object to be beautified, the color parameters of the facial area of each object to be beautified are adjusted to obtain the identified facial area of each object to be beautified; correspondingly, based on the limb attribute parameters to be adjusted of the limb area of each object to be beautified, the color parameters of the limb area of each object to be beautified are adjusted to obtain the identified limb area of each object to be beautified; finally, the image processing device replaces the facial area of each object to be beautified corresponding to the position area with the identified facial area of each object to be beautified, and replaces the limb area of each object to be beautified corresponding to the position area with the identified limb area of each object to be beautified, to obtain the target area.
[0194] Among them, when there are at least two objects to be beautified, the image processing device adjusts the color parameters of their respective corresponding portrait areas. It can also be based on the background parameters of the image to be processed, the position information of the objects to be beautified in the image to be processed, the area ratio information of the position areas corresponding to the objects to be beautified and the image to be processed, etc. This application does not impose any limitations on this.
[0195] Accordingly, the parameters for adjusting the color parameters of the position area of each object to be beautified can be the same or different; at the same time, the image processing device can adjust the noise parameters and brightness parameters of the position area of each object to be beautified; and in the present application, the clarity of the outline of each object to be beautified can also be enhanced, that is, when the number of objects to be beautified in the present application is at least two, the implementation plans of the image processing device can be the same or different, and this application does not make any limitation on this.
[0196] It should be noted that in the embodiment of the present application, when there are at least two objects to be beautified, the image processing device adjusts the portrait area of each object to be beautified in the image to be processed based on various relevant information, which can simultaneously meet the needs of multiple objects to be beautified, thereby improving the user's satisfaction with image beautification.
[0197] In the embodiments of the present application, the image format corresponding to the image obtained by the image processing device when executing any step includes but is not limited to: bitmap (Bitmap, BMP) format, Joint Photographic Experts Group (Joint Photographic Experts Group, JPEG) format, Portable Network Graphics (Portable Network Graphics, PNG) format, Joint Photographic Expert Group (Joint Photographic Expert Group, JPG) format, etc., and the present application does not impose any limitation on this.
[0198] Based on this, Figure 5 A flow chart of an image processing method provided in an embodiment of the present application is shown; wherein an original image 501, i.e., the picture content in the embodiment of the present application includes an image to be processed of an object to be beautified; a portrait segmentation result diagram 502, i.e., an intermediate effect diagram in which the image processing device in the embodiment of the present application divides the image to be processed, i.e., the original image 501, into a portrait area and a background area using a portrait segmentation model; a beautification effect diagram 503, i.e., a target image obtained after adjusting the color parameters of the portrait area in the portrait segmentation result diagram 502 in the embodiment of the present application; wherein the original image 501 includes: an object to be beautified 5011 and background information 5012; correspondingly, the portrait segmentation result diagram 502 includes: a portrait area 5021 and a background area 5022 of the object to be beautified; and the beautification effect diagram 503 includes: an object after beautification 5031 and background information 5032.
[0199] It should be noted that the background area 5022 in 502 is a beauty mask; wherein, the mask representation needs to protect the background area to avoid operations on it. In this way, the beauty mask is obtained by portrait segmentation, and the internal area is subjected to skin smoothing and whitening processing. This can ensure that when the face is partially blocked or people of various skin colors enter the scene, the beauty processing is still stable and effective, thereby improving the user experience.
[0200] Based on the above embodiments, the present application also provides an image processing device 6, which can be applied to Figures 1 to 4 In an image processing method provided in a corresponding embodiment, referring to Figure 6 As shown, the image processing device 6 may include: an acquisition module 61, a determination module 62 and an adjustment module 63, wherein:
[0201] An acquisition module 61 is used to acquire an image to be processed whose content includes an object to be beautified;
[0202] A determination module 62 is used to determine a portrait area occupied by the subject to be beautified in the image to be processed;
[0203] The adjustment module 63 is used to adjust the color parameters of the portrait area to obtain a target image.
[0204] In other embodiments of the present application, the determination module 62 is further configured to perform region segmentation on the image to be processed by using a portrait segmentation model to determine the portrait region.
[0205] In other embodiments of the present application, the adjustment module 63 is further used to adjust the color parameters of the portrait area to obtain a target area; and replace the portrait area in the image to be processed with the target area to obtain a target image.
[0206] In other embodiments of the present application, the adjustment module 63 is also used to detect facial key points in the portrait area to determine the facial area and the limb area; determine a first attribute parameter of the facial area and a second attribute parameter of the limb area; based on the first attribute parameter, adjust the color parameter of the facial area to obtain an identified facial area; based on the second attribute parameter, adjust the color parameter of the limb area to obtain an identified limb area; replace the facial area with the identified facial area, and replace the limb area with the identified limb area to obtain the target area.
[0207] In other embodiments of the present application, the acquisition module 61 is further used to acquire attribute information of the object to be beautified and / or posture information of the object to be beautified and / or scene information of the image to be processed;
[0208] Correspondingly, the determination module 62 is further used to determine the first adjustment parameter based on the attribute information of the object to be beautified and / or the posture information of the object to be beautified and / or the scene information of the image to be processed; wherein the first adjustment parameter includes a first noise adjustment parameter and a first brightness adjustment parameter;
[0209] Correspondingly, the adjustment module 63 is further used to adjust the color parameter of the portrait area based on the first noise adjustment parameter and the first brightness adjustment parameter to obtain a target image.
[0210] In other embodiments of the present application, the acquisition module 61 is further used to acquire position information of the portrait region in the image to be processed, and / or area ratio information between the portrait region and the image to be processed;
[0211] Accordingly, the determination module 62 is further configured to determine a second adjustment parameter based on the position information and / or the area ratio information; wherein the second adjustment parameter includes a second noise adjustment parameter and a second brightness adjustment parameter;
[0212] Correspondingly, the adjustment module 63 is further used to adjust the color parameters of the portrait area based on the second noise adjustment parameter and the second brightness adjustment parameter to obtain a target image.
[0213] In other embodiments of the present application, the adjustment module 63 is further used to determine the outline of the portrait area; in the portrait area, the clarity of the outline is enhanced to obtain an enhanced target image.
[0214] In other embodiments of the present application, the adjustment module 63 is further used to obtain special effect information that matches the facial information and / or posture information of the object to be beautified; based on the special effect information, the target image is updated to obtain a target special effect image.
[0215] In other embodiments of the present application, the adjustment module 63 is also used to blur the identification information to different degrees when the picture content of the target image includes identification information, so as to at least obtain an identification image that does not reflect the identification information; wherein the identification information can uniquely identify the object to be beautified.
[0216] It should be noted that the specific implementation process of the steps executed by each module in this embodiment can be referred to Figures 1 to 4 The implementation process of the image processing method provided in the corresponding embodiment will not be repeated here.
[0217] The image processing device provided in the embodiment of the present application; first, a portrait segmentation model is used to determine the portrait area occupied by the object to be beautified in the image to be processed; secondly, based on the relevant information of the image to be processed, such as: attribute information of the object to be beautified, posture information of the object to be beautified, scene information of the image to be processed, position information of the portrait area in the image to be processed, and area ratio information between the portrait area and the image to be processed, etc., the color parameters of the portrait area are adjusted to obtain a target image; in this way, the color parameters of the portrait area in the image to be processed are adjusted through a variety of parameter information, so that the characters in the image are beautified while the background area in the image is kept in its original state, so that the viewing effect of the image can be guaranteed while enriching the beauty scheme, thereby improving user satisfaction.
[0218] Based on the above embodiments, the embodiments of the present application further provide an image processing device 7, which can be applied to Figures 1 to 4 In an image processing method provided in a corresponding embodiment, referring to Figure 7 As shown, the image processing device 7 may include: a processor 71, a memory 72 and a communication bus 73, wherein:
[0219] The communication bus 73 is used to implement the communication connection between the processor 71 and the memory 72 .
[0220] The processor 71 is used to execute the program of the image processing method stored in the memory 72 to achieve the reference Figures 1 to 4 The corresponding embodiment provides an image processing method.
[0221] The image processing device provided in the embodiment of the present application; first, adopts a portrait segmentation model to determine the portrait area occupied by the object to be beautified in the image to be processed; secondly, based on the relevant information of the image to be processed, such as: attribute information of the object to be beautified, posture information of the object to be beautified, scene information of the image to be processed, position information of the portrait area in the image to be processed, and area ratio information between the portrait area and the image to be processed, etc., adjusts the color parameters of the portrait area to obtain a target image; in this way, the color parameters of the portrait area in the image to be processed are adjusted through a variety of parameter information, so that the characters in the image are beautified while the background area in the image remains in its original state, thereby ensuring the viewing effect of the image while enriching the beauty scheme, thereby improving user satisfaction.
[0222] Based on the foregoing embodiments, the embodiments of the present application provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following. Figures 1 to 4 The corresponding embodiments provide steps of the image processing method.
[0223] It should be noted that the above-mentioned computer-readable storage medium can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0224] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0225] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0226] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0227] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0228] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0229] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0230] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An image processing method, the method comprising: Acquire a to-be processed image including a subject to be beautified; Determine a portrait area occupied by the object to be beautified in the image to be processed; Adjusting the color parameters of the portrait area to obtain a target image; The step of adjusting the color parameters of the portrait area to obtain a target image includes: Based on the first noise adjustment parameter, the interference information presented in the portrait area is adjusted, and based on the first brightness adjustment parameter, the brightness of the picture presented in the portrait area is adjusted to obtain the target image; the first noise adjustment parameter and the first brightness adjustment parameter are both determined based on the information of the object to be beautified; wherein, the information of the object to be beautified includes at least one of the following: posture information of the object to be beautified and scene information of the image to be processed.
2. According to the method of claim 1, the step of determining the portrait area occupied by the object to be beautified in the image to be processed comprises: A portrait segmentation model is used to perform region segmentation on the image to be processed to determine the portrait region.
3. The method according to claim 1, wherein adjusting the color parameters of the portrait area to obtain a target image comprises: Adjusting the color parameters of the portrait area to obtain a target area; The target area is used to replace the portrait area in the image to be processed to obtain the target image.
4. The method according to claim 3, wherein the adjusting the color parameters of the portrait area to obtain the target area comprises: Performing facial key point detection on the portrait area to determine the face area and the limb area; Determine a first attribute parameter of the face region and a second attribute parameter of the limb region; Based on the first attribute parameter, adjusting the color parameter of the face area to obtain an identified face area; Based on the second attribute parameter, adjusting the color parameter of the limb area to obtain a marked limb area; The face region is replaced by the identified face region, and the limb region is replaced by the identified limb region, to obtain the target region.
5. The method according to claim 1, before adjusting the color parameters of the portrait area to obtain the target image, the method further comprises: Acquiring attribute information of the object to be beautified and / or posture information of the object to be beautified and / or scene information of the image to be processed; Based on the attribute information of the object to be beautified and / or the posture information of the object to be beautified and / or the scene information of the image to be processed, a first adjustment parameter is determined; wherein the first adjustment parameter includes a first noise adjustment parameter and a first brightness adjustment parameter.
6. The method according to claim 1, before adjusting the color parameters of the portrait area to obtain the target image, the method further comprises: Acquire position information of the portrait region in the image to be processed, and / or area ratio information between the portrait region and the image to be processed; Based on the position information and / or the area ratio information, determining a second adjustment parameter; wherein the second adjustment parameter includes a second noise adjustment parameter and a second brightness adjustment parameter; Accordingly, the color parameters of the portrait area are adjusted to obtain a target image, including: Based on the second noise adjustment parameter and the second brightness adjustment parameter, the color parameter of the portrait area is adjusted to obtain the target image.
7. The method according to claim 1, after adjusting the color parameters of the portrait area to obtain the target image, the method further comprises: Determining the outline of the portrait area; In the portrait area, the clarity of the outline is enhanced to obtain the enhanced target image.
8. The method according to claim 1, after adjusting the color parameters of the portrait area to obtain the target image, the method further comprises: Acquire special effect information matching the facial information and / or posture information of the object to be beautified; Based on the special effect information, the target image is updated to obtain a target special effect image.
9. The method according to claim 1, after adjusting the color parameters of the portrait area to obtain the target image, the method further comprises: In the case where the target image includes identification information, blurring the identification information to different degrees to at least obtain an identification image that does not reflect the identification information; The identification information can uniquely identify the object to be beautified.
10. An image processing device, comprising: Acquire modules, determine modules, and adjust modules; The acquisition module is used to acquire an image to be processed including an object to be beautified; The determining module is used to determine the portrait area occupied by the object to be beautified in the image to be processed; The adjustment module is used to adjust the color parameters of the portrait area to obtain a target image; The adjustment module is further used to adjust the interference information presented in the portrait area based on a first noise adjustment parameter, and to adjust the brightness of the picture presented in the portrait area based on a first brightness adjustment parameter, so as to obtain the target image; the first noise adjustment parameter and the first brightness adjustment parameter are both determined based on the information of the object to be beautified; wherein the information of the object to be beautified includes at least one of the following: posture information of the object to be beautified and scene information of the image to be processed.
Citation Information
Patent Citations
Human body beautification method and device and electronic device based on depth
CN106991654A
Image processing method and device, electronic equipment and computer readable storage medium
CN107808137A