An image processing method, an image processing device, and a storage medium
By generating and fusing low-frequency and high-frequency component images, the problem of not being able to simultaneously modify skin blemishes and preserve detailed features in existing technologies is solved, thereby improving the visual effect of the image.
Patent Information
- Application Number
- CN202111101406.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-18
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2041-09-18
AI Technical Summary
Existing technologies, when smoothing images, cannot simultaneously preserve skin imperfections such as acne, blemishes, and moles, while maintaining details such as pores, thus affecting the visual effect and three-dimensionality of the image.
An initial low-frequency component image and an initial high-frequency component image of the image to be processed are generated, representing different features respectively. By smoothing the low-frequency component image and fusing it with the high-frequency component image, the flaw features are modified and the details are preserved to generate the first target image, which is then fused with the image to be processed to improve the visual effect.
By using a step-by-step fusion process, the visual effect of the image is improved, the detailed features of the skin area are preserved, and the three-dimensionality and visual performance of the image are enhanced.
Smart Images

Figure CN114049262B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to an image processing method, an image processing apparatus, and a storage medium. Background Technology
[0002] With the development of science and technology, image smoothing has become a well-known image processing method, and due to its wide range of applications, it has appeared in various scenarios of daily life.
[0003] In related technologies, smoothing is typically used to smooth skin areas in an image. However, when smoothing images including skin areas, it is often impossible to preserve details such as pores, which affects the three-dimensionality of the face and consequently the overall visual appeal of the image. Summary of the Invention
[0004] To overcome the problems existing in related technologies, this disclosure provides an image processing method, an image processing apparatus, and a storage medium.
[0005] According to a first aspect of the present disclosure, an image processing method is provided, comprising:
[0006] An initial low-frequency component image and an initial high-frequency component image of an image to be processed are generated; wherein, the image to be processed includes a skin region; the initial low-frequency component image is smoothed to obtain a smoothed target low-frequency component image; the image to be processed, the target low-frequency component image, and the initial high-frequency component image are subjected to a first fusion process to obtain a first target image; the image to be processed and the first target image are subjected to a second fusion process to obtain a second target image.
[0007] In one embodiment, the first fusion processing of the image to be processed, the target low-frequency component image, and the initial high-frequency component image to obtain the first target image includes: performing a third fusion processing on the image to be processed and the target low-frequency component image to generate a first fused image; and performing a fourth fusion processing on the first fused image and the initial high-frequency component image to generate the first target image.
[0008] In one embodiment, the step of performing a third fusion process on the image to be processed and the target low-frequency component image to generate a first fused image includes: obtaining a fusion ratio for the third fusion process on the image to be processed and the target low-frequency component image, wherein the fusion ratio is related to the degree of smoothing of the skin region; and performing a third fusion process on the image to be processed and the target low-frequency component image based on the fusion ratio to generate the first fused image.
[0009] In one embodiment, the first fused image and the initial high-frequency component image are subjected to a fourth fusion process to generate the first target image, including: for each pixel in the initial high-frequency component image, determining the product value between the pixel value and the target value; and the sum of the pixel values in the first fused image that are at the same position as the pixel and the product value; and determining the pixel value of the pixel at the same position in the first target image based on the product value corresponding to each pixel and the sum value.
[0010] In one embodiment, a second fusion process is performed on the image to be processed and the first target image to obtain a second target image, including: determining the probability that each pixel in the first target image belongs to skin; and performing a second fusion process on the image to be processed and the first target image based on the probability to obtain the second target image.
[0011] In one embodiment, determining the probability that a pixel belongs to skin for each pixel in the first target image includes: determining the matching degree between a target pixel and a pixel corresponding to a reference skin color, wherein the target pixel includes each pixel in the first target image; and determining the matching degree between the target pixel and the pixel corresponding to the reference skin color as the probability that the target pixel belongs to skin.
[0012] In one embodiment, determining the matching degree between the target pixel and the corresponding pixel of the reference skin tone includes: calling a U-channel color component model and a V-channel color component model, wherein the U-channel color component model is a Gaussian model determined based on the mean and variance of the U-channel color components of each pixel value in the skin tone sample set in the YUV color space, and the V-channel color component model is a Gaussian model determined based on the mean and variance of the V-channel color components of each pixel value in the skin tone sample set in the YUV color space; determining a first output value of the U-channel color component model based on the U-channel color component model and the U-channel color component of the target pixel, and determining a second output value of the V-channel color component model based on the V-channel color component model and the V-channel color component of the target pixel; and determining the product of the first output value and the second output value as the matching degree between the target pixel and the corresponding pixel of the reference skin tone.
[0013] In one embodiment, generating an initial low-frequency component image and an initial high-frequency component image of the image to be processed includes: performing Gaussian filtering on the image to be processed to obtain an initial low-frequency component image of the image to be processed; removing the initial low-frequency component image from the image to be processed to obtain a processed image after removal; and generating the initial high-frequency component image based on a brightness adjustment coefficient, a pixel value correction parameter, and the processed image after removal.
[0014] According to a second aspect of the present disclosure, an image processing apparatus is provided, comprising:
[0015] A generation unit is used to generate an initial low-frequency component image and an initial high-frequency component image of an image to be processed; wherein the image to be processed includes a skin region; a processing unit is used to smooth the initial low-frequency component image to obtain a smoothed target low-frequency component image; perform a first fusion process on the image to be processed, the target low-frequency component image, and the initial high-frequency component image to obtain a first target image; and perform a second fusion process on the image to be processed and the first target image to obtain a second target image.
[0016] In one embodiment, the processing unit performs a first fusion process on the image to be processed, the target low-frequency component image, and the initial high-frequency component image to obtain a first target image in the following manner: performing a third fusion process on the image to be processed and the target low-frequency component image to generate a first fused image; and performing a fourth fusion process on the first fused image and the initial high-frequency component image to generate the first target image.
[0017] In one embodiment, the processing unit performs a third fusion process on the image to be processed and the target low-frequency component image to generate a first fused image in the following manner: obtaining a fusion ratio for the third fusion process on the image to be processed and the target low-frequency component image, wherein the fusion ratio is related to the degree of smoothing of the skin region; and performing a third fusion process on the image to be processed and the target low-frequency component image based on the fusion ratio to generate the first fused image.
[0018] In one embodiment, the processing unit performs a fourth fusion process on the first fused image and the initial high-frequency component image to generate the first target image in the following manner: for each pixel in the initial high-frequency component image, the product value between the pixel value and the target value is determined; and the sum of the pixel values in the first fused image that are at the same position as the pixel and the product value is determined; based on the product value corresponding to each pixel and the sum value, the pixel value of the pixel at the same position in the first target image is determined.
[0019] In one embodiment, the processing unit performs a second fusion process on the image to be processed and the first target image in the following manner to obtain a second target image: for each pixel in the first target image, the probability that the pixel belongs to skin is determined; based on the probability, the image to be processed and the first target image are subjected to a second fusion process to obtain a second target image.
[0020] In one embodiment, the processing unit determines the probability that a pixel belongs to skin for each pixel in the first target image in the following manner: determining the matching degree between the target pixel and the corresponding pixel of the reference skin color, wherein the target pixel includes each pixel in the first target image; and determining the matching degree between the target pixel and the corresponding pixel of the reference skin color as the probability that the target pixel belongs to skin.
[0021] In one embodiment, the processing unit determines the matching degree between the target pixel and the corresponding pixel of the reference skin color as follows: It invokes a U-channel color component model and a V-channel color component model, wherein the U-channel color component model is a Gaussian model determined based on the mean and variance of the U-channel color components of each pixel value in the skin color sample set in the YUV color space, and the V-channel color component model is a Gaussian model determined based on the mean and variance of the V-channel color components of each pixel value in the skin color sample set in the YUV color space; based on the U-channel color component model and the U-channel color component of the target pixel, it determines a first output value of the U-channel color component model, and based on the V-channel color component model and the V-channel color component of the target pixel, it determines a second output value of the V-channel color component model; the product of the first output value and the second output value is determined as the matching degree between the target pixel and the corresponding pixel of the reference skin color.
[0022] In one embodiment, the processing unit generates an initial low-frequency component image and an initial high-frequency component image of the image to be processed in the following manner: performing Gaussian filtering on the image to be processed to obtain an initial low-frequency component image of the image to be processed; removing the initial low-frequency component image from the image to be processed to obtain a processed image after removal; and generating the initial high-frequency component image based on the brightness adjustment coefficient, pixel value correction parameters, and the processed image after removal.
[0023] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0024] Processor; memory used to store processor-executable instructions;
[0025] The processor is configured to execute the image processing method described in the first aspect or any embodiment of the first aspect.
[0026] According to a fourth aspect of the present disclosure, a storage medium is provided, the storage medium storing instructions that, when executed by a processor, enable the processor to perform the image processing method described in the first aspect or any embodiment of the first aspect.
[0027] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product including a computer program, which, when executed by a processor, implements the image processing method described in the first aspect or any embodiment of the first aspect.
[0028] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: an initial low-frequency component image and an initial high-frequency component image of an image to be processed, including a skin region, can be generated. Further, the initial low-frequency component image can be smoothed to obtain a smoothed target low-frequency component image. Since the initial low-frequency component image can characterize blemish features with low spatial color variation frequency, such as pimples, spots, and / or moles, and the initial high-frequency component image can characterize detail features with high spatial color variation frequency, such as pores, in the first target image obtained by fusing the image to be processed, the target low-frequency component image, and the initial high-frequency component image, blemish features such as pimples, spots, and / or moles are modified, while detail features such as pores are preserved, thus improving the visual effect of the first target image. Furthermore, the visual effect of the second target image obtained by fusing the image to be processed and the first target image is also improved.
[0029] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0030] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0031] Figure 1 This is a flowchart illustrating an image processing method according to an exemplary embodiment.
[0032] Figure 2 This is a flowchart illustrating a method for generating an initial low-frequency component image and an initial high-frequency component image of an image to be processed, according to an exemplary embodiment.
[0033] Figure 3 This is a flowchart illustrating a method for smoothing an initial low-frequency component image according to an exemplary embodiment.
[0034] Figure 4 This is a flowchart illustrating a method for generating a first target image according to an exemplary embodiment.
[0035] Figure 5 This is a flowchart illustrating a method for generating a first fused image according to an exemplary embodiment.
[0036] Figure 6This is a flowchart illustrating a method for generating a first target image by performing a fourth fusion process on a first fused image and an initial high-frequency component image according to an exemplary embodiment.
[0037] Figure 7 This is a flowchart illustrating a method for determining the matching degree between a target pixel and a corresponding pixel of a reference skin color, according to an exemplary embodiment.
[0038] Figure 8 This is a flowchart illustrating a method for determining the probability that a target pixel belongs to the skin, according to an exemplary embodiment.
[0039] Figure 9 This is a flowchart illustrating a method for performing a second fusion process on an image to be processed and a first target image to obtain a second target image, according to an exemplary embodiment.
[0040] Figure 10 This is a block diagram of an image processing apparatus according to an exemplary embodiment.
[0041] Figure 11 This is a block diagram of an electronic device for image processing according to an exemplary embodiment. Detailed Implementation
[0042] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure.
[0043] In the accompanying drawings, the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The described embodiments are some, but not all, of the embodiments of this disclosure. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure. The embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.
[0044] In recent years, significant progress has been made in research on technologies based on artificial intelligence, such as computer vision, deep learning, machine learning, image processing, and image recognition. Artificial intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies, and application systems to simulate and extend human intelligence. AI is a comprehensive discipline involving numerous technologies, including chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, and neural networks. Computer vision, as an important branch of AI, specifically enables machines to recognize the world. Computer vision technologies typically include face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, object detection, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, behavior recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, and robot navigation and localization. With the research and advancement of artificial intelligence technology, this technology has been applied in numerous fields, such as security, urban management, traffic management, building management, park management, facial recognition access control, facial recognition attendance, logistics management, warehouse management, robotics, intelligent marketing, computational photography, mobile imaging, cloud services, smart homes, wearable devices, autonomous driving, autonomous driving, smart healthcare, facial payment, facial unlocking, fingerprint unlocking, identity verification, smart screens, smart TVs, cameras, mobile internet, live streaming, beautification, makeup, medical aesthetics, and intelligent temperature measurement.
[0045] The image processing method provided in this disclosure can be applied to image processing scenarios. For example, it can be applied to scenarios involving skin smoothing of images including skin areas.
[0046] In related technologies, smoothing is typically used to smooth skin areas in an image. However, because this method directly smooths the original image, it cannot preserve details such as pores while correcting skin imperfections. This negatively impacts the visual quality of the smoothed image. For example, it reduces the three-dimensionality of a face image. It also results in the loss of details such as pores in the skin area.
[0047] The image processing method provided in this disclosure can generate an initial low-frequency component image and an initial high-frequency component image of an image to be processed, including a skin region. It can also smooth the initial low-frequency component image to obtain a smoothed target low-frequency component image. Since the initial low-frequency component image can characterize blemish features with low spatial color variation frequency, such as pimples, spots, and / or moles, and the initial high-frequency component image is used to characterize detail features with high spatial color variation frequency, such as pores, when generating the initial low-frequency component image and the initial high-frequency component image of the image to be processed, the initial low-frequency component image can be smoothed, and the image to be processed, the target low-frequency component image (the smoothed low-frequency component image), and the initial high-frequency component image can be fused step-by-step to modify blemish features such as pimples, spots, and / or moles in the first target image, while preserving detail features such as pores. This disclosure can improve the visual effect of the first target image, and further, by performing a second fusion process on the image to be processed and the first target image, the visual effect of the resulting second target image is also improved.
[0048] For ease of description, this disclosure refers to the fusion process performed on the image to be processed, the target low-frequency component image, and the initial high-frequency component image as the first fusion process, and the fusion process performed on the image to be processed and the first target image as the second fusion process. Furthermore, the image obtained by fusing the image to be processed, the target low-frequency component image, and the initial high-frequency component image is referred to as the first target image, and the image obtained by fusing the image to be processed and the first target image is referred to as the second target image.
[0049] Figure 1 This is a flowchart illustrating an image processing method according to an exemplary embodiment, such as... Figure 1 As shown, it includes the following steps.
[0050] In step S11, an initial low-frequency component image and an initial high-frequency component image of the image to be processed are generated.
[0051] The image to be processed includes skin regions. For example, the skin regions included in the image to be processed may include the face, neck, or torso.
[0052] In this embodiment of the disclosure, low-frequency and high-frequency components of the image to be processed can be extracted to generate an initial low-frequency component image and an initial high-frequency component image of the image to be processed. The initial low-frequency component image can characterize features with low spatial color variation frequency, while the high-frequency component image can characterize features with high spatial color variation frequency. For example, the initial low-frequency component image can characterize skin blemishes such as acne, spots, and / or moles, while the initial high-frequency component image can characterize skin detail features such as pores.
[0053] In step S12, the initial low-frequency component image is smoothed to obtain the smoothed target low-frequency component image.
[0054] For example, smoothing the initial low-frequency components can modify flawed features in the initial low-frequency component image.
[0055] In step S13, a first fusion process is performed on the image to be processed, the target low-frequency component image, and the initial high-frequency component image to obtain the first target image.
[0056] In step S14, a second fusion process is performed on the image to be processed and the first target image to obtain the second target image.
[0057] The second target image obtained by the image processing method provided in this embodiment of the present disclosure has improved the visual effect by modifying the blemishes of the skin area and preserving the details such as pores.
[0058] In this embodiment, various methods can be used to generate the initial low-frequency component image and the initial high-frequency component image of the image to be processed. In one embodiment, the initial low-frequency component image can be obtained by performing Gaussian filtering on the image to be processed. Further, the initial high-frequency component image can be obtained by removing the pixel information corresponding to each pixel position in the initial low-frequency component image for each pixel position in the image to be processed.
[0059] Figure 2 This is a flowchart illustrating a method for generating an initial low-frequency component image and an initial high-frequency component image of an image to be processed, according to an exemplary embodiment. Figure 2 As shown, it includes the following steps.
[0060] In step S21, the image to be processed is subjected to Gaussian filtering to obtain the initial low-frequency component image of the image to be processed.
[0061] In step S22, the initial low-frequency component image is removed from the image to be processed to obtain the image to be processed after removal.
[0062] For example, the image to be processed after removal can be represented by (SA). Where S represents the image to be processed and A represents the initial low-frequency component image.
[0063] In step S23, an initial high-frequency component image is generated based on the brightness adjustment coefficient, pixel value correction parameters, and the removed image to be processed.
[0064] For example, the initial high-frequency component image of the image to be processed can be obtained by the formula B = (SA)*L + 128 (denoted by B in the example). The brightness adjustment coefficient (denoted by L in the example) can be used to adjust the brightness value of the initial high-frequency component image to ensure its visual quality. Furthermore, the pixel value correction parameter (in the example, a value of 128) can correct the pixel values of each pixel in the initial high-frequency component image, keeping them within the range of 0-255 and reducing the possibility of pixel value overflow.
[0065] In this embodiment of the disclosure, the initial low-frequency component image and the initial high-frequency component image of the image to be processed can also be obtained by other means. For example, the image information of the image to be processed can be converted into frequency domain information, and then high-frequency information and low-frequency information can be extracted from the frequency domain information to obtain the initial high-frequency component image and the initial low-frequency component image of the image to be processed. This disclosure does not limit the specific method of generating the initial low-frequency component image and / or the initial high-frequency component image of the image to be processed.
[0066] In this embodiment of the disclosure, various methods such as median filtering, mean filtering, and edge-preserving filtering can be used to smooth the low-frequency component image. This disclosure does not specifically limit the method used for smoothing.
[0067] For example, to facilitate understanding of this disclosure, the following will use a surface blurring algorithm (mean filtering) as an example to illustrate the process of smoothing the initial low-frequency component image, as described in this disclosure. Figure 3 As shown.
[0068] Figure 3 This is a flowchart illustrating a method for smoothing an initial low-frequency component image according to an exemplary embodiment, such as... Figure 3 As shown, it includes the following steps.
[0069] In step S31, a pixel value convolution window is established in the initial low-frequency component image with the pixel to be processed as the window center.
[0070] The pixels to be processed may include all pixels in the initial low-frequency component image. In this embodiment, the established pixel value convolution window can be a pixel value convolution window of arbitrary size. For example, a pixel value convolution window with the pixel to be processed as the center and a window size of 3*3 pixels can be established.
[0071] In step S32, the pixel value of the pixel to be processed is used as the reference pixel value, the pixel value convolution value of all pixels within the pixel value convolution window is calculated, and the pixel value convolution value is used as the pixel value of the corresponding pixel position in the target low-frequency component image after smoothing.
[0072] For example, a pixel value convolution window can be established in the initial low-frequency component image, using the pixel to be processed as the center of the window. Further, using the pixel value of the pixel to be processed as the reference pixel value, the pixel value convolution value of all pixels within the pixel value convolution window is calculated, and this pixel value convolution value is determined as the pixel value in the target low-frequency component image corresponding to the pixel position of the pixel to be processed. For example, this can be done using... The initial low-frequency component image is smoothed in a certain way to obtain the target low-frequency component image (denoted as C in the example). Here, y represents a preset constant (in the example, the value of y can range from 0 to 255), which can be manually adjusted through algorithmic processing. c represents the pixel to be processed (i.e., the reference pixel) in the pixel value convolution window, and x... c x represents the pixel value of the pixel to be processed. i This represents the pixel values of all pixels in the convolution window, excluding the pixel to be processed. For example, if the convolution window for the pixel to be processed is 3x3 pixels, then x... i The values of x can be x1, x2, x3, x4, x5, x6, x7, and x8. Among them, x1 to x8 represent the pixel values of each pixel adjacent to the pixel to be processed within the pixel window.
[0073] In one example, the image to be processed and the target low-frequency component image can be fused to generate a first fused image. Then, the first fused image is fused with an initial high-frequency component image to generate a first target image. For ease of description, this disclosure refers to the fusion process performed on the image to be processed and the target low-frequency component image as a third fusion process, and the fusion process performed on the first fused image and the initial high-frequency component image as a fourth fusion process. Further, the image obtained by performing the third fusion process on the image to be processed and the target low-frequency component image is called the first fused image, and the image obtained by performing the fourth fusion process on the first fused image and the initial high-frequency component image is called the first target image.
[0074] Figure 4 This is a flowchart illustrating a method for generating a first target image according to an exemplary embodiment, such as... Figure 4 As shown, it includes the following steps.
[0075] In step S41, the image to be processed and the target low-frequency component image are subjected to a third fusion process to generate a first fused image.
[0076] In step S42, the first fused image and the initial high-frequency component image are subjected to a fourth fusion process to generate the first target image.
[0077] Since the image to be processed and the target low-frequency component image represent the unsmoothed image and the smoothed image, respectively, the smoothness of the first fused image can be adjusted by setting different mixing ratios when performing the third fusion process on the image to be processed and the target low-frequency component image. For example, the mixing ratio for the third fusion process on the image to be processed and the target low-frequency component image can be preset according to user needs or system default settings. Furthermore, the first fused image can be obtained by performing the third fusion process on the image to be processed and the target low-frequency component image using this mixing ratio.
[0078] Figure 5 This is a flowchart illustrating a method for generating a first fused image according to an exemplary embodiment, such as... Figure 5 As shown, it includes the following steps.
[0079] In step S411, the fusion ratio of the image to be processed and the target low-frequency component image for the third fusion processing is obtained.
[0080] The fusion ratio can be determined through one or a combination of methods, such as user input based on actual needs, pre-setting, and dynamic adjustment by the algorithm based on the actual scenario.
[0081] In this embodiment of the disclosure, the fusion ratio is related to the degree of smoothing of the skin region. Specifically, for the fusion weight allocated in the fusion ratio for the third fusion process, the fusion weight for matching the image to be processed is negatively correlated with the degree of smoothing of the skin region, while the fusion weight for matching the target low-frequency component image is positively correlated with the degree of smoothing of the skin region.
[0082] For example, if the fusion weight assigned to the target low-frequency component image is α, and the fusion weight assigned to the image to be processed is (1-α), then the fusion ratio for the third fusion process can be α:(1-α). In this case, since the higher the fusion weight α assigned to the target low-frequency component image, the higher the smoothing degree of the image, the fusion weight α assigned to the target low-frequency component image can approximately characterize the smoothing degree of the image after the third fusion process (i.e., the first fused image below).
[0083] In step S412, based on the fusion ratio, a third fusion process is performed on the image to be processed and the target low-frequency component image to generate a first fused image.
[0084] In one example, a third fusion process can be performed on the image to be processed (represented by S in this example) and the target low-frequency component image (represented by C in this example) using the formula E = S*(1-α) + C*α to obtain a first fused image (represented by E in this example). Here, (1-α) represents the fusion weight assigned to each pixel in the image to be processed S, and α represents the fusion weight assigned to each pixel in the target low-frequency component image C. It is understood that the value of α can range from 0 to 1. In one implementation, the fusion ratio can be adjusted by adjusting the value of α, thereby adjusting the smoothness of the first fused image E. For example, α can be adjusted to a higher value (in this example, α approaches 1), in which case the display effect of the first fused image E is closer to the display effect of the target low-frequency component image C. In other words, the smoothness of the first fused image E is higher. Alternatively, α can be adjusted to a lower value (in this example, α approaches 0), in which case the display effect of the first fused image E is closer to the display effect of the image to be processed S. In other words, the first fused image E has a lower degree of smoothing (skin smoothing).
[0085] The image processing method provided in this embodiment can adjust the smoothness of the first fused image by adjusting the fusion ratio. Since the second target image is obtained through the first fused image, it is equivalent to adjusting the smoothness of the second target image (the final image). This method can meet the user's needs for adjusting the skin smoothing level.
[0086] Furthermore, for example, various methods such as bright light, strong light, point light, or linear light can be used to perform a fourth fusion process on the first fused image and the initial high-frequency component image. To facilitate understanding of this disclosure, the following will use a linear light method as an example to describe the process of performing a fourth fusion process on the first fused image and the initial high-frequency image. Figure 6 As shown.
[0087] For ease of description, the constants used to calculate the pixel values of each pixel in the first target image are referred to as the target value and the second value in this embodiment of the disclosure.
[0088] Figure 6 This is a flowchart illustrating a method for generating a first target image by performing a fourth fusion process on a first fused image and an initial high-frequency component image according to an exemplary embodiment. Figure 6 As shown, it includes the following steps.
[0089] In step S421, for each pixel in the initial high-frequency component image, the product value between the pixel value and the target value is determined, as well as the sum of the pixel value and the product value between the pixel value and the pixel value in the first fused image that is at the same position as the pixel.
[0090] In this embodiment of the disclosure, the target value can be 2. For example, if the pixel value of a certain pixel in the initial high-frequency component image is B, then the product value between the pixel value and the target value can be expressed as B*2, and the sum of the pixel value (represented by E in the example) in the first fused image and the product value can be expressed as E+B*2.
[0091] In step S422, the pixel value of the pixel at the same position in the first target image is determined based on the product value and sum value corresponding to each pixel.
[0092] In one embodiment, the pixel value of a pixel at the same position in the first target image can be determined based on the product value and sum of the values corresponding to each pixel (denoted by F in the example). Here, E+B*2 represents the sum of the pixel value at the same position in the first fused image and the product value, and 255 represents the pixel value correction parameter for matching the first target image. By performing difference processing between this pixel value correction parameter and the obtained sum (denoted by E+B*2-255 in the example), the possibility of pixel value overflow in the first target image can be reduced.
[0093] In this embodiment of the disclosure, after obtaining the first fused image, the first fused image and the initial high-frequency component image can be subjected to a fourth fusion process using linear light to generate the first target image. Since linear light fusion has a superior fusion effect, this method can guarantee the visual quality of the first target image.
[0094] Typically, smoothing non-skin areas in an image can negatively impact the visual appearance of those areas.
[0095] In one example, the first target image can be pixel-filtered to identify the skin regions representing skin features and the non-skin regions representing other features. Further, the smoothing effect of the skin regions in the first target image is preserved, and the pixel values of the non-skin regions in the first target image are restored using the image to be processed, resulting in the second target image.
[0096] For example, the matching degree between the target pixel and the corresponding pixel of the reference skin color can be determined, and this matching degree can be used as the probability that the target pixel belongs to the skin. The target pixel can include all pixels in the first target image. Furthermore, based on the probability that the target pixel belongs to the skin, a second fusion process can be performed on the image to be processed and the first target image to obtain a second target image that retains the smoothing effect of the skin area and restores the pixel values of the non-skin areas.
[0097] In one implementation method, the following can be used: Figure 7 The method shown maps the target pixel to the YUV color space, and then determines the matching degree between the target pixel and the corresponding pixel of the reference skin color using a pre-built U-channel color component model and a V-channel color component model. For ease of description, this disclosure refers to the pixel selected in the first target image for determining the matching degree with the corresponding pixel of the reference skin color as the target pixel, the output value of the U-channel color component model as the first output value, and the output value of the V-channel color component model as the second output value.
[0098] Figure 7 This is a flowchart illustrating a method for determining the matching degree between a target pixel and a corresponding pixel of a reference skin tone, according to an exemplary embodiment. Figure 7 As shown, it includes the following steps.
[0099] In step S51, the U-channel color component model and the V-channel color component model are invoked.
[0100] The U-channel color component model or V-channel color component model can be constructed as follows: For example, multiple sampling points can be selected in a skin color sample set to obtain multiple pixel values matching these sampling points. Further, the target channel color component corresponding to each pixel value (for example, the target channel color component can be a U-channel color component or a V-channel color component) can be determined, and the mean and variance of the obtained multiple target channel color components can be calculated to determine the target channel color component model. It can be understood that the target channel color component model matches the target channel color component. For example, if the target channel color component is a U-channel color component, then the obtained target channel color component model is a U-channel color component model.
[0101] In this embodiment of the disclosure, the target channel color component model can be a Gaussian model. For example, it can be... The target channel color component model is determined by a method where μ represents the mean of multiple target channel color components, and σ represents the variance of multiple target channel color components. Furthermore, a U-channel color component model matching the U-channel color components can be obtained. And the V-channel color component model that matches the V-channel color components. Where, μ u σ represents the mean of the U-channel color components corresponding to multiple pixel values. u μ represents the variance of the U-channel color components corresponding to multiple pixel values. v σ represents the mean of the V channel color components corresponding to multiple pixel values. v It represents the variance of the V channel color components corresponding to multiple pixel values.
[0102] In step S52, based on the U-channel color component model and the U-channel color component of the target pixel, the first output value of the U-channel color component model is determined, and based on the V-channel color component model and the V-channel color component of the target pixel, the second output value of the V-channel color component model is determined.
[0103] The U-channel color component of the target pixel can be represented as u x The V channel color component of the target pixel can be represented as v x The U-channel color component model can be represented as G(u), and the V-channel color component model can be represented as G(v).
[0104] In one embodiment, the U-channel color component u of the target pixel can be... x As input, it is fed into the U-channel color component model G(u) so that the U-channel color component model G(u) outputs the first output value G(u). x In another embodiment, the V channel color component v of the target pixel can be... x As input, it is fed into the V-channel color component model G(v) so that the V-channel color component model G(v) outputs a second output value G(v). x ).
[0105] In step S53, the product of the first output value and the second output value is determined as the matching degree between the target pixel and the corresponding pixel of the reference skin color.
[0106] For example, this can be achieved by p = G(u x )G(v x The matching degree between the target pixel and the corresponding pixel of the reference skin color is determined by the method of G(u). x )G(vx ) represents the product of the first output value and the second output value, and p represents the matching degree between the target pixel and the corresponding pixel of the reference skin color.
[0107] In another embodiment, the matching degree between the target pixel and the corresponding pixel of the reference skin tone can be determined by mapping the target pixel to the RGB color space. For example, multiple sampling points are selected as reference pixels in a skin tone sample set, and then reference R channel color components, reference G channel color components, and reference B channel color components are set by comprehensively considering the RGB channel color components of multiple pixel values. Further, the R channel color component difference between the target pixel and the reference R channel color component, the G channel color component difference between the target pixel and the reference G channel color component, and the B channel color component difference between the target pixel and the reference B channel color component are determined respectively. Then, the matching degree between the target pixel and the corresponding pixel of the reference skin tone is determined by the R channel color component difference, G channel color component difference, and B channel color component difference. Of course, the matching degree between the target pixel and the corresponding pixel of the reference skin tone can also be determined by other methods, and this disclosure does not specifically limit the method of determining the matching degree between the target pixel and the corresponding pixel of the reference skin tone.
[0108] In this embodiment of the disclosure, when the matching degree between the target pixel and the corresponding pixel of the reference skin color is determined, the matching degree between the target pixel and the corresponding pixel of the reference skin color is determined as the probability that the target pixel belongs to the skin.
[0109] Figure 8 This is a flowchart illustrating a method for determining the probability that a target pixel belongs to skin, according to an exemplary embodiment. Figure 8 As shown, it includes the following steps.
[0110] In step S61, the matching degree between the target pixel and the corresponding pixel of the reference skin color is determined.
[0111] The target pixels include each pixel in the first target image.
[0112] In step S62, the matching degree between the target pixel and the corresponding pixel of the reference skin color is determined as the probability that the target pixel belongs to the skin.
[0113] The image processing method provided in this disclosure can determine the probability that each pixel in the first target image belongs to skin by the matching degree between each pixel in the first target image and the corresponding pixel of the reference skin color. Furthermore, based on the probability that each pixel in the first target image belongs to skin, a second fusion processing can be performed on the image to be processed and the first target image to obtain a second target image.
[0114] Figure 9 This is a flowchart illustrating a method for performing a second fusion process on an image to be processed and a first target image to obtain a second target image, according to an exemplary embodiment. Figure 9 As shown, it includes the following steps.
[0115] In step S71, for each pixel in the first target image, the probability that the pixel belongs to the skin is determined.
[0116] The process of determining the probability that each pixel in the first target image belongs to the skin has been described in the above embodiments and will not be repeated here.
[0117] In step S72, based on probability, a second fusion process is performed on the image to be processed and the first target image to obtain the second target image.
[0118] In this embodiment, the probability that each pixel in the first target image belongs to skin can be used as the fusion weight assigned to each pixel in the first target image during the second fusion processing. For example, if the probability that a certain pixel in the first target image belongs to skin is p, then the fusion weight corresponding to that pixel during the second fusion processing is p. In this case, the fusion weight corresponding to pixels located at the same position in the image to be processed is (1-p). In this case, the second fusion processing can be performed on each pixel in the first target image (represented by F in the example) and the image to be processed (represented by S in the example) using the method D = S*(1-p) + F*p to obtain the second target image (represented by D in the example). It can be understood that the value of p can range from 0 to 1.
[0119] For example, if p is a high value (for example, p approaches 1), it indicates that the target pixel has a higher probability of belonging to skin. In this case, the features represented by pixels in the second target image that are at the same pixel position as the target pixel are close to the features represented by the target pixel. In other words, the higher the probability that the target pixel belongs to skin, the smoother the pixels in the second target image that are at the same pixel position as the target pixel are. If p is a low value (for example, p approaches 0), it indicates that the probability that the target pixel belongs to skin is lower. In this case, the features represented by pixels in the second target image that are at the same pixel position as the target pixel are close to the features represented by pixels in the image to be processed that are at the same pixel position as the target pixel are. In other words, the lower the probability that the target pixel belongs to skin, the lower the smoothness of the pixels in the second target image that are at the same pixel position as the target pixel are, and the closer they are to the features represented when no smoothing processing is performed. This disclosure can preserve the smoothing effect of the skin region in the second target image while ensuring the visual effect of the non-skin region.
[0120] In the second target image obtained by the image processing method provided in this embodiment, the pixel values corresponding to the skin region are close to those corresponding to the skin region in the first target image, and the pixel values corresponding to the non-skin region in the second target image are close to those corresponding to the non-skin region in the image to be processed. Specifically, the closeness of the pixel values corresponding to the skin region in the second target image to those corresponding to the skin region in the first target image can be understood as the pixel value difference between the two images being smaller than the pixel value difference between the two images. Similarly, the closeness of the pixel values corresponding to the non-skin region in the second target image to those corresponding to the non-skin region in the image to be processed can be understood as the pixel value difference between the two images being smaller than the pixel value difference between the two images. The image processing method provided in this disclosure can smooth (skin-smoothing) the skin area in the image to be processed, obtaining a second target image with a "skin-smoothing" display effect. Furthermore, skin imperfections such as acne, blemishes, and / or moles in the skin area of the second target image are improved, while detailed features such as pores are preserved, thus enhancing the visual effect of the skin area.
[0121] In one example, an initial low-frequency component image of the image to be processed can be generated using a Gaussian filtering algorithm. Then, by adjusting the brightness coefficient and pixel value correction parameters, the initial low-frequency component image is extracted from the image to be processed, resulting in an initial high-frequency component image. Furthermore, a surface blurring algorithm can be used to smooth the initial low-frequency component image, yielding a target low-frequency component image. In this case, the fusion ratio for the third fusion processing of the image to be processed and the target low-frequency component image is obtained, and this ratio is used to perform the third fusion processing on the image to be processed and the target low-frequency component image, resulting in a first fused image. Further, a fourth fusion processing can be performed on the first fused image and the initial high-frequency image using linear light, resulting in a first target image. In this case, the U-channel color components and V-channel color components of each pixel in the first target image are determined. The obtained U-channel color components are input into a pre-built U-channel color component model to obtain a first output value, and the obtained V-channel color components are input into a V-channel color component model to obtain a second output value. For example, the product of the first output value and the second output value of each pixel in the first target image can be determined as the matching degree between each pixel in the first target image and the corresponding pixel of the reference skin color. The matching degree between each pixel in the first target image and the corresponding pixel of the reference skin color is determined as the probability that each pixel in the first target image belongs to the skin. This probability is then used as the fusion ratio allocated to each pixel when performing the second fusion process on the image to be processed and the first target image, thereby obtaining the second target image.
[0122] The image processing method provided in this disclosure can acquire an image to be processed, including a skin region, and generate an initial low-frequency component image and an initial high-frequency component image of the image to be processed. Further, the initial low-frequency component image can be smoothed to obtain a target low-frequency component image. In the skin region of the first target image obtained by performing a first fusion process on the image to be processed, the target low-frequency component image, and the initial high-frequency component image, blemishes such as pimples, spots, and / or moles are modified (smoothed), while detailed features such as pores are preserved, significantly improving the visual effect of the image. Furthermore, the smoothness of the image can be adjusted by adjusting the mixing ratio when performing a third fusion process on the target low-frequency component image and the image to be processed. The initial high-frequency image is then fused to the first mixed image using linear light, further enhancing the visual effect of the obtained first target image. In addition, this disclosure can determine the probability that each pixel in the first target image belongs to the skin region, and based on the probability that each pixel in the first target image belongs to the skin region, determine the fusion ratio allocated to each pixel when performing a second fusion process on the first target image and the image to be processed, thereby performing the second fusion process on the first target image and the image to be processed. In this case, the skin area in the final second target image is displayed after smoothing (skin smoothing), while the non-skin area is displayed before smoothing (skin smoothing). This method can bring users a better visual experience and meet their usage needs.
[0123] Based on the same concept, embodiments of this disclosure also provide an image processing apparatus.
[0124] It is understood that the image processing apparatus provided in this disclosure includes hardware structures and / or software modules corresponding to each function in order to achieve the above-mentioned functions. In conjunction with the units and algorithm steps of the various examples disclosed in this disclosure, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of this disclosure.
[0125] Figure 10 This is a block diagram of an image processing apparatus according to an exemplary embodiment. (Refer to...) Figure 10 The device 100 includes a generation unit 101 and a processing unit 102.
[0126] The generation unit 101 is used to generate an initial low-frequency component image and an initial high-frequency component image of the image to be processed. The image to be processed includes a skin region. The processing unit 102 is used to smooth the initial low-frequency component image to obtain a smoothed target low-frequency component image. A first fusion process is performed on the image to be processed, the target low-frequency component image, and the initial high-frequency component image to obtain a first target image. A second fusion process is performed on the image to be processed and the first target image to obtain a second target image.
[0127] In one embodiment, the processing unit 102 performs a first fusion process on the image to be processed, the target low-frequency component image, and the initial high-frequency component image to obtain a first target image: a third fusion process is performed on the image to be processed and the target low-frequency component image to generate a first fused image. A fourth fusion process is performed on the first fused image and the initial high-frequency component image to generate the first target image.
[0128] In one embodiment, the processing unit 102 performs a third fusion process on the image to be processed and the target low-frequency component image to generate a first fused image, including: obtaining a fusion ratio for the third fusion process on the image to be processed and the target low-frequency component image, wherein the fusion ratio is related to the degree of smoothing of the skin region; and performing the third fusion process on the image to be processed and the target low-frequency component image based on the fusion ratio to generate the first fused image.
[0129] In one embodiment, the processing unit 102 performs a fourth fusion process on the first fused image and the initial high-frequency component image to generate a first target image in the following manner: For each pixel in the initial high-frequency component image, the product value between the pixel value and the target value is determined. The sum of the product values between the pixel values and the corresponding pixel values in the first fused image is also determined. Based on the product values and sum values corresponding to each pixel, the pixel value of the pixel at the same position in the first target image is determined.
[0130] In one embodiment, the processing unit 102 performs a second fusion process on the image to be processed and the first target image to obtain a second target image in the following manner: for each pixel in the first target image, the probability that the pixel belongs to skin is determined. Based on the probability, the second fusion process is performed on the image to be processed and the first target image to obtain the second target image.
[0131] In one embodiment, the processing unit 102 determines the probability that a pixel belongs to skin for each pixel in the first target image in the following manner: determining the matching degree between the target pixel and the corresponding pixel of the reference skin color, wherein the target pixel includes each pixel in the first target image. The matching degree between the target pixel and the corresponding pixel of the reference skin color is determined as the probability that the target pixel belongs to skin.
[0132] In one embodiment, the processing unit 102 determines the matching degree between the target pixel and the corresponding pixel of the reference skin tone as follows: It invokes the U-channel color component model and the V-channel color component model. The U-channel color component model is a Gaussian model determined based on the mean and variance of the U-channel color components of each pixel value in the skin tone sample set in the YUV color space. The V-channel color component model is also a Gaussian model determined based on the mean and variance of the V-channel color components of each pixel value in the skin tone sample set in the YUV color space. Based on the U-channel color component model and the U-channel color component of the target pixel, a first output value of the U-channel color component model is determined. Based on the V-channel color component model and the V-channel color component of the target pixel, a second output value of the V-channel color component model is determined. The product of the first output value and the second output value is determined as the matching degree between the target pixel and the corresponding pixel of the reference skin tone.
[0133] In one embodiment, the processing unit 102 generates an initial low-frequency component image and an initial high-frequency component image of the image to be processed in the following manner: Gaussian filtering is applied to the image to be processed to obtain the initial low-frequency component image. The initial low-frequency component image is removed from the image to be processed to obtain the image to be processed after removal. Based on the brightness adjustment coefficient, pixel value correction parameters, and the image to be processed after removal, the initial high-frequency component image is generated.
[0134] The image processing apparatus provided in this disclosure can generate an initial low-frequency component image and an initial high-frequency component image of an image to be processed, and can smooth the initial low-frequency component. Furthermore, by obtaining a fusion ratio, a third fusion process is performed between the smoothed target low-frequency component image and the image to be processed to obtain a first fused image. In this process, different fusion ratios correspond to different degrees of image smoothing; therefore, the smoothness of the image can be adjusted by regulating the fusion ratio. Further, a fourth fusion process is performed between the first fused image and the initial high-frequency image using linear light to ensure the visual effect of the image after the fourth fusion process (the first target image). In addition, the probability of each pixel in the first target image belonging to skin can be determined, and different fusion ratios can be assigned to pixels with different probabilities. Then, a second fusion process is performed between the first target image and the image to be processed to obtain a second target image. In the final second target image, the visual effect of the skin region is the smoothed visual effect, and the visual effect of the non-skin region is the non-skin region visual effect in the image to be processed. This method can improve the visual effect of the smoothed (skin-smoothing) image, satisfying the user experience.
[0135] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0136] like Figure 11 As shown, one embodiment of this disclosure provides an electronic device 200. The electronic device 200 includes a memory 201, a processor 202, and an input / output (I / O) interface 203. The memory 201 is used to store instructions. The processor 202 is used to execute the image processing method of this disclosure embodiment by calling the instructions stored in the memory 201. The processor 202 is connected to both the memory 201 and the I / O interface 203, for example, via a bus system and / or other forms of connection mechanism (not shown). The memory 201 can be used to store programs and data, including the program for the image processing method involved in the embodiments of this disclosure. The processor 202 executes various functional applications and data processing of the electronic device 200 by running the program stored in the memory 201.
[0137] In this embodiment of the disclosure, the processor 202 may be implemented in at least one of the following hardware forms: digital signal processor (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 202 may be one or a combination of several of the following: central processing unit (CPU) or other processing units with data processing capability and / or instruction execution capability.
[0138] The memory 201 in this embodiment may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD).
[0139] In this embodiment of the disclosure, the I / O interface 203 can be used to receive input instructions (such as numeric or character information, and to generate key signal inputs related to user settings and function control of the electronic device 200), and can also output various information (such as images or sounds) to the outside. In this embodiment of the disclosure, the I / O interface 203 may include one or more of the following: a physical keyboard, function keys (such as volume control keys, power buttons, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, and a touch panel.
[0140] In some embodiments, this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, perform any of the methods described above.
[0141] In some embodiments, this disclosure provides a computer program product comprising a computer program that, when executed by a processor, performs any of the methods described above.
[0142] Although the operations are described in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the operations shown to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.
[0143] The methods and apparatus disclosed herein can be implemented using standard programming techniques, utilizing rule-based logic or other logic to implement various method steps. It should also be noted that the terms "apparatus" and "module" as used herein and in the claims are intended to include implementations using one or more lines of software code and / or hardware implementations and / or devices for receiving input.
[0144] Any step, operation, or procedure described herein may be performed or implemented using one or more hardware or software modules, either alone or in combination with other devices. In one embodiment, the software module is implemented using a computer program product comprising a computer-readable medium containing computer program code, which is executable by a computer processor to perform any or all of the described steps, operations, or procedures.
[0145] The foregoing description of embodiments of this disclosure has been provided for purposes of illustration and description. The foregoing description is not exhaustive and is not intended to limit this disclosure to the exact form disclosed; various modifications and variations may be made in accordance with the foregoing teachings, or may be derived from practice of this disclosure. These embodiments were chosen and described to illustrate the principles of this disclosure and its practical application, enabling those skilled in the art to utilize this disclosure in various implementations and modifications suitable for the particular purpose conceived.
[0146] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0147] It is understood that in this disclosure, "multiple" refers to two or more, and other quantifiers are similar. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. The singular forms "a," "the," and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.
[0148] It is further understood that the terms "first," "second," etc., are used to describe various types of information, but this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another, and do not indicate a specific order or degree of importance. In fact, the expressions "first," "second," etc., are completely interchangeable. For example, without departing from the scope of this disclosure, first information can also be referred to as second information, and similarly, second information can also be referred to as first information.
[0149] It can be further understood that, unless otherwise specified, "connection" includes both direct connections where no other components exist between the two parties and indirect connections where other components exist between them.
[0150] It is further understood that although operations are described in a specific order in the accompanying drawings in the embodiments of this disclosure, this should not be construed as requiring these operations to be performed in the specific order or serial order shown, or requiring all of the shown operations to be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.
[0151] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and the disclosure in practice. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the scope of the claims.
[0152] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. An image processing method, characterized by, The image processing method comprises: generating an initial low-frequency component image and an initial high-frequency component image of a to-be-processed image; wherein the to-be-processed image comprises a skin region; performing smoothing processing on the initial low-frequency component image to obtain a target low-frequency component image after smoothing processing; performing first fusion processing on the to-be-processed image, the target low-frequency component image and the initial high-frequency component image to obtain a first target image; performing second fusion processing on the to-be-processed image and the first target image to obtain a second target image; wherein the second fusion processing on the to-be-processed image and the first target image to obtain the second target image comprises: determining, for each pixel in the first target image, a probability that the pixel belongs to skin; based on the probability, performing second fusion processing on the to-be-processed image and the first target image to obtain the second target image.
2. The image processing method of claim 1, wherein, The first fusion processing on the to-be-processed image, the target low-frequency component image and the initial high-frequency component image to obtain the first target image comprises: performing third fusion processing on the to-be-processed image and the target low-frequency component image to generate a first fusion image; performing fourth fusion processing on the first fusion image and the initial high-frequency component image to generate the first target image.
3. The image processing method of claim 2, wherein, The third fusion processing on the to-be-processed image and the target low-frequency component image to generate the first fusion image comprises: obtaining a fusion ratio for the third fusion processing on the to-be-processed image and the target low-frequency component image, the fusion ratio being related to a degree of smoothing processing on the skin region; based on the fusion ratio, performing third fusion processing on the to-be-processed image and the target low-frequency component image to generate the first fusion image.
4. The image processing method of claim 2, wherein, The fourth fusion processing on the first fusion image and the initial high-frequency component image to generate the first target image comprises: determining, for each pixel in the initial high-frequency component image, a product value between a pixel value of the pixel and a target value; and a sum value between a pixel value of a pixel in the first fusion image at a same position as the pixel and the product value; based on the product value and the sum value corresponding to each pixel, determining a pixel value of a pixel at the same position in the first target image. The determination of the probability that each pixel in the first target image belongs to skin comprises:
5. The image processing method of claim 1, wherein, determining a matching degree between a target pixel and a reference skin color corresponding pixel, the target pixel comprising each pixel in the first target image; determining the matching degree between the target pixel and the reference skin color corresponding pixel as the probability that the target pixel belongs to skin. The determination of the matching degree between the target pixel and the reference skin color corresponding pixel comprises:
6. The image processing method of claim 5, wherein, calling a U channel color component model and a V channel color component model, the U channel color component model being a Gaussian model determined based on a mean value and a variance of U channel color components of pixel values in a YUV color space in a skin color sample set, the V channel color component model being a Gaussian model determined based on a mean value and a variance of V channel color components of pixel values in the YUV color space in the skin color sample set; determining a first output value of the U channel color component model based on the U channel color component model and a U channel color component of the target pixel, and determining a second output value of the V channel color component model based on the V channel color component model and a V channel color component of the target pixel; determining a product value between the first output value and the second output value as a matching degree between the target pixel and a reference skin color corresponding pixel.
7. The image processing method of claim 1, wherein, generating an initial low frequency component image and an initial high frequency component image of the image to be processed, comprising: performing Gaussian filtering processing on the image to be processed to obtain an initial low frequency component image of the image to be processed; removing the initial low frequency component image from the image to be processed to obtain a removed image to be processed; generating the initial high frequency component image based on a brightness adjustment coefficient, a pixel value correction parameter and the removed image to be processed.
8. An image processing apparatus characterized by comprising: The image processing apparatus comprises: a generating unit configured to generate an initial low frequency component image and an initial high frequency component image of an image to be processed, wherein the image to be processed comprises a skin region; a processing unit configured to perform smoothing processing on the initial low frequency component image to obtain a target low frequency component image after smoothing processing, perform fusion processing on the image to be processed, the target low frequency component image after smoothing processing and the initial high frequency component image to obtain a first target image, and perform fusion processing on the image to be processed and the first target image to obtain a second target image; The processing unit performs second fusion processing on the image to be processed and the first target image in the following manner to obtain the second target image: for each pixel in the first target image, determining a probability that the pixel belongs to skin; and based on the probability, performing second fusion processing on the image to be processed and the first target image to obtain the second target image.
9. An electronic device, comprising: comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the image processing method of any one of claims 1 to 7.
10. A storage medium, characterized by The storage medium has instructions stored therein, and when the instructions in the storage medium are executed by a processor, the processor can execute the image processing method of any one of claims 1 to 7.
11. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program is executed by a processor to implement the image processing method of any one of claims 1 to 7.
Citation Information
Patent Citations
Image processing method and apparatus and electronic device
WO2014174347A1