Image processing method and device
By extracting and adjusting the low-frequency light and shadow layer information in the skin image, the problem of time-consuming and cost-effective processing in commercial photography is solved, and efficient and economical skin grinding effect is achieved, especially suitable for high-precision image editing scenes.
Patent Information
- Application Number
- CN202310704463.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2043-06-14
AI Technical Summary
In commercial photography, post-processing is time-consuming and costly. The existing skin grinding algorithms are not effective in high-precision image scenarios, and AI training models require a lot of data and computing power.
By extracting the low-frequency light and shadow layer information in the skin image, adjusting the color value and reducing transparency, the skin wear effect is achieved. This method is divided into four steps: acquiring the image to be processed, extracting the low-frequency light and shadow layer information, adjusting the color value and reducing transparency.
It realizes an economical automatic cloud-based photo editing solution, which has fast photo editing speed and can retain texture layer information in high-precision image scenarios, with better results.
Smart Images

Figure CN116612046B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, specifically computer vision, augmented reality, virtual reality, deep learning and other technical fields. Background Art
[0002] In commercial photography, post-processing is a labor-intensive and time-consuming job that requires a long period of technical accumulation by professional photo retouchers. However, the cost of professional photo retouchers is relatively high, and different photo retouchers have different photo retouching styles. The quality of photo retouching is affected by aesthetics and work status.
[0003] In the process of retouching a captured portrait image, a skin smoothing algorithm may be used to smooth the skin area of the portrait in the portrait image, thereby giving the skin a smooth and delicate appearance.
[0004] If the high- and low-frequency skin smoothing method is used, there will be some loss of the high-frequency texture layer, and the effect is poor in high-precision image scenes. If the neutral gray skin smoothing method is used, the high-frequency layer is not processed, and if the texture layer needs skin smoothing, it cannot be met. If the AI training model solution is used, a large amount of scene data and computing power are required, and the model training takes a long time, which is costly. Summary of the invention
[0005] The present disclosure provides an image processing method, apparatus, device, storage medium and computer program product.
[0006] According to a first aspect of the present disclosure, an image processing method is provided, comprising: acquiring a skin image to be processed; extracting low-frequency light and shadow layer information from the skin image; adjusting the color value of the skin image according to the low-frequency light and shadow layer information to obtain a mixed image; and reducing the transparency of the mixed image to obtain a skin resurfacing image.
[0007] According to a second aspect of the present disclosure, an image processing device is provided, comprising: an acquisition unit, configured to acquire a skin image to be processed; an extraction unit, configured to extract low-frequency light and shadow layer information from the skin image; an adjustment unit, configured to adjust the color value of the skin image according to the low-frequency light and shadow layer information to obtain a mixed image; and a reduction unit, configured to reduce the transparency of the mixed image to obtain a skin resurfacing image.
[0008] According to a third aspect of the present disclosure, an electronic device for image processing is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the methods described in the first aspect.
[0009] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to the first aspect.
[0010] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements any one of the methods according to the first aspect when executed by a processor.
[0011] The image processing method and device provided by the embodiments of the present disclosure adjust the color value of the original image by extracting the light and shadow layer information, providing an economical automatic cloud-based image retouching solution with a fast image retouching speed. It can achieve the beautification effect of multiple people at the same time. The skin refining effect can retain the texture as much as possible in the texture layer, and evenly process the light and shadow layer, and the texture layer information can also be adjusted. The effect is better in the high-precision image retouching scene.
[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0014] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
[0015] Figure 2 is a flow chart of an embodiment of an image processing method according to the present disclosure;
[0016] Figure 3 is a rendering of the image processing method according to the present disclosure;
[0017] Figure 4 is a flowchart of another embodiment of the image processing method according to the present disclosure;
[0018] Figure 5 is a schematic structural diagram of an embodiment of an image processing device according to the present disclosure;
[0019] Figure 6 It is a structural diagram of a computer system of an electronic device suitable for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0021] Figure 1 An exemplary system architecture 100 is shown to which embodiments of the image processing method or image processing apparatus of the present disclosure can be applied.
[0022] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0023] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as photo editing applications, beauty applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0024] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with cameras, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) players, laptop computers and desktop computers, etc. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0025] The server 105 may be a server that provides various services, such as a background image processing server that provides image editing support for images displayed on the terminal devices 101, 102, and 103. The background image processing server may analyze and process the received image editing request, and feed back the processing result (e.g., the image after editing) to the terminal device.
[0026] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, multiple software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0027] It should be noted that the image processing method provided in the embodiment of the present disclosure can be executed by the terminal devices 101, 102, 103, or by the server 105. Accordingly, the image processing apparatus can be provided in the terminal devices 101, 102, 103, or in the server 105. No specific limitation is made here.
[0028] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0029] Continue to refer Figure 2 , shows a process 200 of an embodiment of an image processing method according to the present disclosure. The image processing method comprises the following steps:
[0030] Step 201, obtaining a skin image to be processed.
[0031] In this embodiment, the execution subject of the image processing method (for example Figure 1 The server shown in the figure can receive the user image from the terminal used by the user to perform photo editing through a wired connection or a wireless connection. The original user image can be segmented through an existing segmentation model to segment the skin area, and the pixels corresponding to the skin area form a skin image. The skin image may include the skin of the face area and may also include the skin of other areas. If the face area needs to be processed separately, the skin image may be a skin image that does not include the face area.
[0032] Step 202: extract low-frequency light and shadow layer information from the skin image.
[0033] In this embodiment, the low-frequency light and shadow layer information, that is, the color value of each pixel of the light and shadow layer, can be extracted from the skin image by Gaussian filtering. The light and shadow layer is the low-frequency layer, which mainly shows the light and shadow of the picture. We will use the low-frequency layer to control the overall coordination, change the light and shadow of the skin, and the distribution of color blocks, so that the light and dark transition of the skin is natural and not so abrupt. The texture layer is the high-frequency layer, which mainly reflects the texture and texture of the skin, and the texture layer is modified. Operations are performed separately at two levels, and the high and low frequencies do not affect each other.
[0034] Step 203, adjusting the color value of the skin image according to the low-frequency light and shadow layer information to obtain a mixed image.
[0035] In this embodiment, the color value of each pixel in the low-frequency light and shadow layer information is converted into an adjustment coefficient between 0 and 1. The conversion method can be 1-normalized value, taking the inverse, etc., so that the adjustment coefficient is negatively correlated with the color value. The larger the color value, the smaller the adjustment coefficient. The color value of each pixel in the skin image is multiplied by the adjustment coefficient of the pixel, and the adjusted color value is calculated to obtain a mixed image. In this way, the light and shadow can be weakened.
[0036] Step 204, reducing the transparency of the mixed image to obtain a skin smoothing image.
[0037] In this embodiment, the transparency of the mixed image can be reduced by using an existing filter template to obtain a smoothed image.
[0038] The above-mentioned embodiments of the present disclosure provide a method that has a high degree of overall skin smoothing effect, which preserves the contour of the limb edges and the contour of the skin surface. The high-frequency layer and the low-frequency layer have a good separation effect, and the amplitude values of the two layers can be adjusted independently to achieve the target effect. It retains more details and is suitable for high-precision image retouching scenarios. For specific effects, please refer to Figure 3 As shown, Figure 3 The original image is on the left in the middle, and the retouched image is on the right. The dark spots on the body are significantly lighter, the skin tone is more even, and there is no loss of texture.
[0039] In some optional implementations of the present embodiment, the color value of the skin image is adjusted according to the low-frequency light and shadow layer information to obtain a mixed image, including: normalizing the low-frequency light and shadow layer information to obtain a normalized value; generating an adjustment coefficient based on the normalized value; and multiplying the color value of the skin image by the adjustment coefficient to obtain a mixed image. The color value of each pixel in the low-frequency light and shadow layer information is normalized and converted into a normalized value between 0 and 1. The adjustment coefficient of each pixel = 1-normalized value, the color value of each pixel in the skin image is multiplied by the adjustment coefficient of the pixel, and the adjusted color value is calculated to obtain a mixed image. This can weaken the light and shadow.
[0040] In some optional implementations of this embodiment, the step of obtaining the skin image to be processed includes: identifying a skin region and a face region and a body region in the skin region from the user image to be processed; and determining the body region as the skin image to be processed. In this way, only the skin of the body can be resurfaced according to the above method, while the skin of the face can be processed separately. Different precisions of image retouching can be implemented for the face and body. This reduces the time for image retouching and improves the user experience.
[0041] In some optional implementations of this embodiment, the method further includes: performing beautification processing on the face area. The face area can be processed by existing beautification tools, such as whitening, face thinning, etc. However, the body area is not processed to prevent the body image from being distorted and deformed, resulting in the failure of photo editing.
[0042] In some optional implementations of this embodiment, the method further includes: adjusting the skin color of the skin-grinding image. The skin color can be adjusted after skin-grinding, for example, by tanning, etc., so as to refine the skin image and improve the user experience.
[0043] Further references Figure 4 , which shows a process 400 of another embodiment of an image processing method. The process 400 of the image processing method includes the following steps:
[0044] Step 401, obtaining a skin image to be processed.
[0045] In this embodiment, the execution subject of the image processing method (for example Figure 1 The server shown in the figure can receive the user image from the terminal used by the user to perform photo editing through a wired connection or a wireless connection. The original user image can be segmented through an existing segmentation model to segment the skin area, and the skin area corresponds to the skin image. The skin image may include the skin of the face area and may also include the skin of other areas. If the face area needs to be processed separately, the skin image may be a skin image that does not include the face area.
[0046] Step 402: remove the high-frequency texture layer information in the skin image by using a surface filtering method, leaving the low-frequency light and shadow layer information and the skin information as a first surface filtering result.
[0047] In this embodiment, for the processing method of directly processing large areas of light and shadow without processing texture, the first step is to extract light and shadow layer information.
[0048] This solution uses two layers of surface filtering to extract light and shadow information. The calculation method is as follows:
[0049]
[0050] After the above calculation, the high-frequency texture layer is removed, leaving the low-frequency light and shadow layer information and skin information. The first surface filtering result of each pixel is SurfaceBlurLess(x,y). Among them, (x,y) represents the pixel coordinates, color(x,y) represents the color value of the pixel, and xi, yj are sampling intervals. In the above formula, the radius of the surface filter is 20 and the threshold is 38. If the radius is 5, the threshold can be set to 78. The threshold is negatively correlated with the radius. Increasing the radius can make the skin resurfacing effect more delicate.
[0051] Step 403: remove the high-frequency texture layer information and the low-frequency light and shadow layer information in the skin image by using a surface filtering method, leaving the skin information as a second surface filtering result.
[0052] In this embodiment, the original skin image is subjected to surface filtering by the following formula:
[0053]
[0054] After the above calculation, the low-frequency light and shadow layer is evenly mixed with the skin color, and the high-frequency texture layer information and the low-frequency light and shadow layer information are removed, leaving the skin information. The second surface filtering result of each pixel is SurfaceBlurMore(x,y). Among them, (x,y) represents the pixel coordinates, color(x,y) represents the color value of the pixel, and xi, yj are sampling intervals. In the above formula, the radius of the surface filter is 20 and the threshold is 8. If the radius is 5, the threshold can be set to 28. The threshold is negatively correlated with the radius. Increasing the radius can make the skin resurfacing effect more delicate.
[0055] Step 404 , subtract the first surface filtering result from the second surface filtering result to obtain low-frequency light and shadow layer information.
[0056] In this embodiment, the low-frequency light and shadow layer information is calculated by the following formula:
[0057] ShadeMask(x,y)=SurfaceBlurMore(x,y)-SurfaceBlurLess(x,y)
[0058] The above formula can be used to calculate the low-frequency light and shadow layer information. The double-layer surface filtering scheme works better when extracting the light and shadow layer. The low-frequency light and shadow layer information of each pixel is ShadeMask(x,y).
[0059] Step 405: adjust the color value of the skin image according to the low-frequency light and shadow layer information to obtain a mixed image.
[0060] In this embodiment, after obtaining the light and shadow layer information, the color value of the original image is adjusted.
[0061] Blend(x,y)=input(x,y)*(1-ShadeMask(x,y) / 255)
[0062] In the above formula, input(x,y) is the color value of the pixel (x,y) in the original image, and ShadeMask(x,y) / 255 is normalized. 1-ShadeMask(x,y) / 255 is the adjustment coefficient of the pixel (x,y). Multiply the color value of each pixel in the original image by the adjustment coefficient of the pixel to get the color value of the pixel in the mixed image Blend(x,y). After calculation, the light and shadow layers are evenly smoothed, and the high-frequency texture layer is completely retained.
[0063] Step 406, reducing the transparency of the mixed image to obtain a smoothed image.
[0064] Steps 405-406 are substantially the same as steps 203-204, and thus will not be described in detail.
[0065] from Figure 4 It can be seen that Figure 2 Compared with the corresponding embodiments, the process 400 of the image processing method in this embodiment embodies the surface filtering method to extract low-frequency light and shadow layer information. This scheme better protects the skin edge contour during the skin resurfacing process, focuses on adjusting the light and shadow layer, and achieves better high-precision image skin resurfacing effect.
[0066] In some optional implementations of this embodiment, the surface filtering method performs convolution calculation at a predetermined sampling interval. The traditional surface filtering method performs convolution calculation pixel by pixel within a radius, while the present application can perform convolution by sampling pixel points within a larger range, and the sampling interval can be fixed, for example, 2, 3. Large-range convolution can make the skin texture more delicate.
[0067] In some optional implementations of this embodiment, the sampling interval is proportional to the proportion of the face in the skin image. The sampling interval can be adjusted according to the proportion of the face in the skin image, and the larger the proportion, the larger the sampling interval. This realizes the adaptive convolution kernel size for different images. This can make the skin resurfacing effect more delicate.
[0068] In some optional implementations of the present embodiment, the color value of the skin image is adjusted according to the low-frequency light and shadow layer information to obtain a mixed image, including: subtracting the first surface filtering result from the color value of the skin image to obtain a high-frequency image; multiplying the color value of the high-frequency image by a preset coefficient less than 1 to obtain a high-frequency adjustment image; normalizing the low-frequency light and shadow layer information to obtain a normalized value; generating an adjustment coefficient based on the normalized value; and multiplying the color value of the high-frequency adjustment image by the adjustment coefficient to obtain a mixed image.
[0069] The color value of the high-frequency image obtained by the surface filtering method is multiplied by a coefficient less than 1 to adjust the texture layer so that the high-frequency adjustment image is weakened. The color value of each pixel in the mixed image is then calculated using the following formula:
[0070] Blend(x,y)=input(x,y)*(1-ShadeMask(x,y) / 255)
[0071] In the above formula, input(x,y) is the color value of the pixel (x,y) in the high-frequency adjustment image, and ShadeMask(x,y) / 255 is normalized. 1-ShadeMask(x,y) / 255 is the adjustment coefficient of the pixel (x,y). Multiplying the color value of each pixel in the high-frequency adjustment image by the adjustment coefficient of the pixel, we get the color value of the pixel in the mixed image Blend(x,y). After calculation, the light and shadow layers are evenly smoothed, and the high-frequency texture layer is completely retained.
[0072] First weaken the high-frequency texture layer, and then weaken the low-frequency light and shadow layer. This will make the skin more delicate and the skin smoothing effect better.
[0073] In some optional implementations of this embodiment, reducing the transparency of the mixed image to obtain the skin resurfacing image includes: taking an average value of the color value of the mixed image and the second surface filtering result to obtain the skin resurfacing image.
[0074] At this time, the high-frequency texture layer has not been processed. This solution performs an average processing on the high-frequency texture layer and reduces its transparency
[0075]
[0076] The above formula is the calculation method for reducing the transparency of the high-frequency layer, and BlendFull(x,y) is the color value of each pixel in the smoothed image. By reducing the transparency of the high-frequency layer, the skin texture is improved and the texture and pores are weakened.
[0077] In some optional implementations of this embodiment, reducing the transparency of the mixed image to obtain the skin resurfacing image includes: performing mixed interpolation processing on the mixed image according to the second surface filtering result to obtain the skin resurfacing image.
[0078] The high-frequency texture layer is mixed and interpolated twice, and its transparency is reduced.
[0079] BlendFull(x, y)=0.2*surfaceBlurMore(x, y)+0.4*Blend(x, y)+0.4*color(x, y)
[0080] The above formula is the simplified calculation method for reducing the transparency of the high-frequency layer, and color(x,y) is the color value of the pixel in the original image. It can make the skin smoothing effect more natural and better textured.
[0081] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an image processing device, and the device embodiment is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0082] like Figure 5 As shown, the image processing device 500 of this embodiment includes: an acquisition unit 501, an extraction unit 502, an adjustment unit 503, and a reduction unit 504. The acquisition unit 501 is configured to acquire a skin image to be processed; the extraction unit 502 is configured to extract low-frequency light and shadow layer information from the skin image; the adjustment unit 503 is configured to adjust the color value of the skin image according to the low-frequency light and shadow layer information to obtain a mixed image; the reduction unit 504 is configured to reduce the transparency of the mixed image to obtain a skin resurfacing image.
[0083] In this embodiment, the specific processing of the acquisition unit 501, the extraction unit 502, the adjustment unit 503, and the reduction unit 504 of the image processing device 500 can refer to Figure 2 Corresponding to step 201, step 202, step 203, and step 204 in the embodiment.
[0084] In some optional implementations of this embodiment, the extraction unit 502 is further configured to: remove the high-frequency texture layer information in the skin image through a surface filtering method, leaving the low-frequency light and shadow layer information and the skin information as a first surface filtering result; remove the high-frequency texture layer information and the low-frequency light and shadow layer information in the skin image through a surface filtering method, leaving the skin information as a second surface filtering result; subtract the first surface filtering result from the second surface filtering result to obtain the low-frequency light and shadow layer information.
[0085] In some optional implementations of this embodiment, the surface filtering method performs convolution calculations at a predetermined sampling interval.
[0086] In some optional implementations of this embodiment, the sampling interval is proportional to the proportion of the human face in the skin image.
[0087] In some optional implementations of this embodiment, the adjustment unit 503 is further configured to: normalize the low-frequency light and shadow layer information to obtain a normalized value; generate an adjustment coefficient based on the normalized value; and multiply the color value of the skin image by the adjustment coefficient to obtain a mixed image.
[0088] In some optional implementations of this embodiment, the adjustment unit 503 is further configured to: subtract the first surface filtering result from the color value of the skin image to obtain a high-frequency map; multiply the color value of the high-frequency map by a preset coefficient less than 1 to obtain a high-frequency adjustment map; normalize the low-frequency light and shadow layer information to obtain a normalized value; generate an adjustment coefficient based on the normalized value; multiply the color value of the high-frequency adjustment map by the adjustment coefficient to obtain a mixed map.
[0089] In some optional implementations of this embodiment, the reducing unit 504 is further configured to: take an average value of the color value of the mixed image and the second surface filtering result to obtain a skin resurfacing image.
[0090] In some optional implementations of this embodiment, the reducing unit 504 is further configured to: perform mixed interpolation processing on the mixed image according to the second surface filtering result to obtain a skin resurfacing image.
[0091] In some optional implementations of this embodiment, the acquisition unit 501 is further configured to: identify a skin area and a face area and a body area in the skin area from the user image to be processed; and determine the body area as the skin image to be processed.
[0092] In some optional implementations of this embodiment, the device 500 further includes a beautification unit (not shown in the drawings) configured to perform beautification processing on the face region.
[0093] In some optional implementations of this embodiment, the device 500 further includes a color adjustment unit (not shown in the drawings) configured to adjust the skin color of the skin resurfacing image.
[0094] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0095] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0096] An electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in process 200 or process 400.
[0097] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method described in process 200 or process 400.
[0098] A computer program product includes a computer program, wherein the computer program implements the method described in process 200 or process 400 when executed by a processor.
[0099] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0100] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0101] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0102] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as image processing methods. For example, in some embodiments, the image processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the image processing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the image processing method in any other appropriate manner (e.g., by means of firmware).
[0103] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0104] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0105] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0106] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0107] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0108] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0109] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0110] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An image processing method, comprising: Acquire a skin image to be processed; Extracting low-frequency light and shadow layer information from the skin image; Adjusting the color value of the skin image according to the low-frequency light and shadow layer information to obtain a mixed image includes: normalizing the color value of each pixel in the low-frequency light and shadow layer information to obtain a normalized value; generating an adjustment coefficient based on the normalized value; multiplying the color value of the skin image by the adjustment coefficient to obtain a mixed image, wherein the larger the color value of each pixel in the low-frequency light and shadow layer information, the smaller the adjustment coefficient; The transparency of the mixed image is reduced to obtain a smoothed image.
2. The method according to claim 1, wherein: The step of extracting low-frequency light and shadow layer information from the skin image comprises: Removing high-frequency texture layer information in the skin image by a surface filtering method, leaving low-frequency light and shadow layer information and skin information as a first surface filtering result; The high-frequency texture layer information and the low-frequency light and shadow layer information in the skin image are removed by a surface filtering method, and the skin information is left as a second surface filtering result; The first surface filtering result is subtracted from the second surface filtering result to obtain low-frequency light and shadow layer information.
3. The method according to claim 2, wherein: The surface filtering method performs convolution calculation at a predetermined sampling interval.
4. The method according to claim 3, wherein: The sampling interval is proportional to the proportion of the human face in the skin image.
5. The method according to claim 2, wherein: The step of multiplying the color value of the skin image by the adjustment coefficient to obtain a mixed image comprises: Subtract the first surface filtering result from the color value of the skin image to obtain a high-frequency map; Multiplying the color value of the high-frequency image by a preset coefficient less than 1 to obtain a high-frequency adjustment image; The color value of the high-frequency adjustment image is multiplied by the adjustment coefficient to obtain a mixed image.
6. The method according to claim 2, wherein: The step of reducing the transparency of the mixed image to obtain a skin resurfacing image includes: An average value of the color value of the mixed image and the second surface filtering result is taken to obtain a skin resurfacing image.
7. The method according to claim 2, wherein: The step of reducing the transparency of the mixed image to obtain a skin resurfacing image includes: The mixed image is subjected to mixed interpolation processing according to the second surface filtering result to obtain a skin resurfacing image.
8. The method according to claim 1, wherein: The step of obtaining a skin image to be processed comprises: Identify a skin area and a face area and a body area in the skin area from the user image to be processed; The body region is determined as a skin image to be processed.
9. The method according to claim 8, wherein: The method further comprises: Perform beauty processing on the face area.
10. The method according to claim 1, wherein: The method further comprises: Adjust the skin tone of the resurfaced image.
11. An image processing device, comprising: An acquisition unit, configured to acquire a skin image to be processed; an extraction unit, configured to extract low-frequency light and shadow layer information from the skin image; An adjustment unit is configured to adjust the color value of the skin image according to the low-frequency light and shadow layer information to obtain a mixed image, including: normalizing the color value of each pixel in the low-frequency light and shadow layer information to obtain a normalized value; generating an adjustment coefficient based on the normalized value; multiplying the color value of the skin image by the adjustment coefficient to obtain a mixed image, wherein the larger the color value of each pixel in the low-frequency light and shadow layer information, the smaller the adjustment coefficient; The reducing unit is configured to reduce the transparency of the mixed image to obtain a resurfaced image.
12. The device according to claim 11, wherein The extraction unit is further configured to: Removing high-frequency texture layer information in the skin image by a surface filtering method, leaving low-frequency light and shadow layer information and skin information as a first surface filtering result; Removing high-frequency texture layer information and low-frequency light and shadow layer information in the skin image by a surface filtering method, leaving skin information as a second surface filtering result; The first surface filtering result is subtracted from the second surface filtering result to obtain low-frequency light and shadow layer information.
13. The device according to claim 12, wherein: The surface filtering method performs convolution calculation at a predetermined sampling interval.
14. The device according to claim 13, wherein: The sampling interval is proportional to the proportion of the human face in the skin image.
15. The device according to claim 12, wherein: The adjustment unit is further configured to: Subtract the first surface filtering result from the color value of the skin image to obtain a high-frequency map; Multiplying the color value of the high-frequency image by a preset coefficient less than 1 to obtain a high-frequency adjustment image; The color value of the high-frequency adjustment image is multiplied by the adjustment coefficient to obtain a mixed image.
16. The device according to claim 12, wherein: The lowering unit is further configured to: An average value of the color value of the mixed image and the second surface filtering result is taken to obtain a resurfacing image.
17. The device according to claim 12, wherein: The lowering unit is further configured to: The mixed image is subjected to mixed interpolation processing according to the second surface filtering result to obtain a skin resurfacing image.
18. The device according to claim 11, wherein The acquisition unit is further configured to: Identify a skin area and a face area and a body area in the skin area from the user image to be processed; The body region is determined as a skin image to be processed.
19. The device according to claim 18, wherein: The device further comprises a beauty unit configured to: Perform beauty processing on the face area.
20. The device according to claim 11, wherein The device further comprises a color mixing unit configured to: Adjust the skin tone of the resurfaced image.
21. An electronic device for image processing, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.
22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.
23. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Image beautifying method and device and mobile terminal
CN105956576A
Skin beautifying processing method and device for human face in picture and electronic equipment
CN111754424A
Convolutional neural network skin processing method and processing device based on human body analysis prior support
CN114549332A