A dermabrasion treatment method, device, mobile terminal and storage medium

By adjusting the filtering intensity through the weighted image data after detection and feature enhancement, it solves the problem of poor flexibility of edge-preserving filtering in mobile terminal devices, improves the effect and performance of skin resurfacing, and is suitable for real-time video beauty processing in complex environments.

CN112597911BActive Publication Date: 2024-10-29BIGO TECH PTE LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202011566237.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-25
Publication Date
2024-10-29
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

When the performance of devices such as mobile terminals is limited, the flexibility of edge-preserving filtering is poor, resulting in low filtering quality for skin resurfacing in various scenarios, making it difficult to effectively remove skin defects and preserve the edges of facial features.

Method used

By detecting the original face data, the feature dimensions of the brightness face data are improved and mapped into weighted image data. The weighted image data is used to adjust the filtering intensity in the edge-preserving filtering process. The face image data is used to limit the processing range and realize adaptive adjustment. , improve the flexibility of filtering processing.

Benefits of technology

It improves the effect and performance of microdermabrasion processing, is suitable for complex and diverse collection environments, avoids the problem of blurry foreground when the background is complex, and realizes real-time microdermabrasion processing under limited equipment performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112597911B_ABST
    Figure CN112597911B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a skin resurfacing method, device, mobile terminal and storage medium. The method includes: collecting original image data, detecting original face data in the original image data, the original face data having brightness face data representing brightness, improving the feature dimension of the brightness face data, obtaining feature face data, mapping the feature face data into weighted image data, and when edge-preserving filtering is performed on the original image data, using the weighted image data to adjust the strength of edge preservation to obtain target image data. This embodiment can improve the effect of skin resurfacing while ensuring the performance of skin resurfacing, and makes it suitable for complex and diverse acquisition environments. In the case of limited performance of devices such as mobile terminals, real-time skin resurfacing can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of computer vision, and in particular to a dermabrasion processing method, device, mobile terminal and storage medium. Background Art

[0002] With the rapid development of mobile Internet and mobile terminals, video data in mobile terminals have become a common information carrier in human activities, such as live broadcasts and video calls. They contain a lot of information about objects and have become one of the ways for people to obtain original information from the outside world.

[0003] For these video data, users usually choose beauty processing. Skin resurfacing is one of the commonly used beauty processing. Skin resurfacing is to smooth the skin area and remove blemishes such as wrinkles, spots, and acne marks in the skin area. In this process, the edges and high-contrast areas of the facial features are retained as much as possible.

[0004] When the performance of devices such as mobile terminals is limited, edge-preserving filters such as fast guided filtering algorithms and bilateral filtering are usually used to achieve skin smoothing. However, edge-preserving filters use fixed parameters, have poor flexibility, and have low filtering quality in many scenarios. Summary of the invention

[0005] The embodiments of the present invention provide a skin resurfacing method, device, mobile terminal and storage medium to solve the problem of how to improve the flexibility of edge-preserving filtering when the performance of a mobile terminal or other device is limited.

[0006] In a first aspect, an embodiment of the present invention provides a method for microdermabrasion treatment, comprising:

[0007] Collecting raw image data;

[0008] Detecting original face data in the original image data, wherein the original face data includes brightness face data indicating brightness;

[0009] Improving the characteristic dimension of the brightness face data to obtain characteristic face data;

[0010] Mapping the characteristic face data into weighted image data;

[0011] When edge-preserving filtering is performed on the original image data, the strength of edge-preserving is adjusted using the weighted image data to obtain target image data.

[0012] In a second aspect, an embodiment of the present invention further provides a dermabrasion treatment device, comprising:

[0013] The original image data acquisition module is used to acquire the original image data;

[0014] An original face data detection module, used for detecting original face data in the original image data, wherein the original face data includes brightness face data representing brightness;

[0015] A feature dimension enhancement module, used to enhance the feature dimension of the brightness face data to obtain feature face data;

[0016] A weighted image data mapping module, used for mapping the characteristic face data into weighted image data;

[0017] The edge-preserving filtering processing module is used to adjust the strength of edge preservation using the weighted image data when performing edge-preserving filtering processing on the original image data to obtain target image data.

[0018] In a third aspect, an embodiment of the present invention further provides a mobile terminal, the mobile terminal comprising:

[0019] one or more processors;

[0020] a memory for storing one or more programs,

[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the microdermabrasion method as described in the first aspect.

[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the microdermabrasion method as described in the first aspect is implemented.

[0023] In this embodiment, original image data is collected, original face data is detected in the original image data, the original face data has brightness face data representing brightness, the feature dimension of the brightness face data is improved, feature face data is obtained, and the feature face data is mapped to weighted image data. When edge-preserving filtering is performed on the original image data, the strength of edge-preserving is adjusted using the weighted image data to obtain target image data. The processing range is limited by introducing face image data, and the strong edge of the face area is used to adaptively adjust the weighted image data, which greatly improves the flexibility of edge-preserving filtering. The problem of foreground blurring when the background area is complex can be avoided. The feature dimension of the brightness face data is improved to distinguish the edges of defects and facial features in the face area. The processing of the weighted image data is relatively simple, and the optimization of the adaptive edge-preserving filtering in the skin grinding process is achieved at a low cost of calculation. That is, this embodiment can improve the effect of the skin grinding process while ensuring the performance of the skin grinding process, and make it suitable for complex and diverse acquisition environments. In the case of limited performance of devices such as mobile terminals, real-time skin grinding can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A flow chart of a microdermabrasion method provided in Embodiment 1 of the present invention;

[0025] Figure 2 This is a comparative example diagram of high-frequency information provided in the first embodiment of the present invention;

[0026] Figure 3 is a schematic diagram of a mapping function provided in Embodiment 1 of the present invention;

[0027] Figure 4 A schematic structural diagram of a dermabrasion treatment device provided in Embodiment 2 of the present invention;

[0028] Figure 5 A schematic diagram of the structure of a mobile terminal provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0029] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0030] Embodiment 1

[0031] Figure 1 This is a flowchart of a skin resurfacing method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case where face data is used as prior knowledge and edge-preserving filtering is performed adaptively. The method can be performed by a skin resurfacing device, which can be implemented by software and / or hardware and can be configured in a mobile terminal, such as a mobile phone, a tablet computer, a smart wearable device (such as a smart watch, smart glasses, etc.), etc., and specifically includes the following steps:

[0032] Step 101: Collect original image data.

[0033] In this embodiment, the video data waiting for skin resurfacing processing generally refers to video data generated, transmitted or played in a real-time business scenario.

[0034] Generally speaking, the video data may be subjected to skin smoothing processing in a mobile terminal that generates the video data. At this time, the camera of the mobile terminal may be turned on to collect the video data.

[0035] Of course, in addition to performing skin refining processing on the video data in the mobile terminal that generates the video data, skin refining processing may also be performed on the video data in the mobile terminal that plays the video data, and this embodiment does not impose any limitation on this.

[0036] For example, in a live broadcast business scenario, the video data waiting for skin smoothing processing may refer to the video data used to carry the live broadcast content. The mobile terminal logged in by the anchor user generates the video data, and the video data is distributed through the live broadcast platform to the devices logged in by each audience user for playback. At this time, the video data is usually subjected to skin smoothing processing on the mobile terminal logged in by the anchor user.

[0037] For another example, in a video call business scenario, the video data waiting for skin smoothing processing may refer to the video data used to carry the call content. The mobile terminal logged in by the user initiating the call generates the video data, and the video data is sent to the devices logged in by each user invited to the call for playback. At this time, the video data is usually smoothed on the mobile terminal logged in by the user initiating the call.

[0038] For another example, in a business scenario of video conferencing, the video data waiting for skin smoothing processing may refer to the video data used to carry the content of the conference. The mobile terminal logged in by the user who is speaking generates the video data, and the video data is sent to the devices logged in by each user participating in the conference for playback. At this time, the mobile terminal logged in by the user who is speaking usually performs skin smoothing processing on the video data.

[0039] In addition to video data with real-time requirements such as live broadcasts, video calls, and video conferences, the video data awaiting skin resurfacing processing may also refer to video data generated in business scenarios with lower real-time requirements, such as short videos, etc. This embodiment does not impose any restrictions on this.

[0040] In this embodiment, the video data contains multiple frames of image data, which are recorded as P1, P2, ..., P t-1 , P t , P t+1 ,……,P n , where t and n are positive integers, t+1<n. Since the video data is generated in real time, n increases continuously as the video data is generated until the video data is completely generated. For the sake of distinction, the image data can be referred to as original image data.

[0041] Step 102: Detect original face data in the original image data.

[0042] In different business scenarios, video data is usually collected of users. Therefore, multiple frames of original image data of the video data usually contain the user's character image. The so-called character image may refer to the pixel points used to represent the character in the original image data.

[0043] The character image at least includes facial data (pixel points) for representing the face. In addition, it may also include hair data (pixel points) for representing hair, body data (pixel points) for representing the torso, limb data (pixel points) for representing limbs, and so on. The embodiment of the present invention is not limited to this.

[0044] Among them, face data, body data, limb data, etc. may include skin data (pixel points) used to represent the skin.

[0045] In this embodiment, face detection can be performed on multiple frames of original image data respectively to identify original face data contained in the original image data. The original face data is used as a high-quality anchor point to capture high-quality skin data.

[0046] In some cases, the original face data is represented by face key points, that is, given the face data, the key areas of the face are located, including eyebrows, eyes, nose, mouth, facial contours, etc.

[0047] In other cases, a range of a specified shape may be generated based on facial key points, and the original facial data may be represented by the range, wherein the shape includes a rectangle, an ellipse, etc. The rectangular range may also be referred to as a face frame.

[0048] In the specific implementation, the following method can be used to perform face detection on multi-frame image data:

[0049] 1. Use artificially extracted features, such as Haar features, use the features to train classifiers, and use the classifiers for face detection.

[0050] 2. Inherit face detection from general object detection algorithms, for example, using Faster R-CNN to detect faces.

[0051] 3. Use cascaded convolutional neural networks, for example, Cascade CNN (Cascaded Convolutional Neural Networks), MTCNN (Multi-task Cascaded Convolutional Networks).

[0052] These methods for implementing face detection can be integrated into the application module, and the application module can be directly called to perform face detection on image data. These methods for implementing face detection can also be integrated in the SDK (Software Development Kit). The SDK serves as the assembly data of the application. The application can request the SDK to perform face detection on multiple frames of image data. The SDK detects the original face data in the image data and returns the face data to the application.

[0053] If the application is a system application supporting the camera, the system application usually provides an API (Application Program Interface) as a face detection interface for these methods of implementing face detection. For example, in the Android system, two face detection interfaces android.media.FaceDetector and android.media.FaceDetector.Face are provided. In the iOS system, two face detection interfaces AVCaptureMetadataOutput and CIDetector are provided.

[0054] In this case, the face detection interface provided by the camera can be called to request detection of original face data in multiple frames of original image data captured by the camera, and receive one or more face frames returned by the face detection interface. The face frame is a rectangular frame that can be used to frame the original face data, that is, the original face data is located in the face frame.

[0055] The face detection interface provided by the system application has hardware support, and the face frame is calibrated based on a few face key points (2 face key points). It has fast speed, low performance consumption, and the accuracy can meet the requirements.

[0056] In addition, if there are multiple face data in the original image data, the areas of the multiple original face data can be counted separately. If the original face data is framed by a face frame with a width of w and a height of h, then the area of ​​the face data S = w×h.

[0057] The areas of each face data are compared, and the n (n is a positive integer, such as 3) face data with the largest area are extracted. Due to the imaging characteristics of the camera and the method of recalling face data, the description of the original face data with a larger area is more accurate, that is, the n original face data with the largest area are clearer, and users pay more attention to the skin smoothing effect of the n original face data with the largest area. Selecting the n original face data with the largest area can ensure the subsequent skin smoothing effect while reducing the amount of calculation.

[0058] Step 103: Improve the feature dimension of the brightness face data to obtain feature face data.

[0059] In the original image data, in addition to the edges of facial features such as eyes, nose, and mouth, there may also be the edges of blemishes such as wrinkles, spots, and acne marks. In low-dimensional space, there is less difference between the edges of facial features such as eyes, nose, and mouth and the edges of blemishes such as wrinkles, spots, and acne marks, and the probability of being separable is lower.

[0060] In this embodiment, the original facial data includes brightness facial data representing brightness. For example, if the original image data is in YUV format, Y represents brightness (Luminance or Luma), that is, grayscale value, UV represents chrominance (Chrominance or Chroma), that is, the pixels under the Y channel constitute the original brightness facial data, and the pixels under the U channel and the V channel constitute the original chrominance facial data.

[0061] Of course, in addition to the YUV format, the original image data can also be data in other formats, such as HSL (H represents hue, S represents saturation, and L represents brightness), that is, the pixels under the L channel constitute the original brightness face data, etc. This embodiment does not limit this.

[0062] Since the user's eyes are more sensitive to brightness information, weighted image data can be generated based on brightness facial data. For brightness facial data, the original brightness facial data can be mapped to a high-dimensional space, thereby improving the feature dimension of the brightness facial data and obtaining feature facial data. The probability that the feature facial data can be separable is increased, that is, the difference between the edges of facial features such as eyes, nose, and mouth and the edges of blemishes such as wrinkles, spots, and acne marks is increased, so that the edges of facial features such as eyes, nose, and mouth and the edges of blemishes such as wrinkles, spots, and acne marks can be separable.

[0063] In one embodiment of the present invention, step 103 may include the following steps:

[0064] Step 1031: filter the brightness face data to obtain first candidate face data.

[0065] In this embodiment, the brightness face data may be filtered using algorithms such as box filtering (mean filtering) and Gaussian filtering to obtain the first candidate face data, thereby maintaining the edge and reducing noise and smoothing.

[0066] Furthermore, the scale adapted to the brightness face data can be set according to the actual situation of the brightness face data to filter the brightness face data, while taking into account both quality and efficiency, that is, while ensuring the filtering effect, reducing the amount of calculation and reducing the calculation time.

[0067] The so-called scale may refer to the size of the filter radius, that is, the larger the scale, the larger the filter radius, and conversely, the smaller the scale, the smaller the filter radius.

[0068] Specifically, a filter window (also known as filter, kernel, template, etc.) can be determined, and the size of the filter window is positively correlated with the resolution of the original image data. That is, the larger the resolution of the original image data, the larger the filter window, and at this time, the stronger the filtering (the lower the cutoff frequency of the low pass, the flatter the result); conversely, the smaller the resolution of the original image data, the smaller the filter window, and at this time, the weaker the filtering (the higher the cutoff frequency of the low pass, the sharper the result).

[0069] The brightness face data is filtered using a filter window to obtain first candidate face data.

[0070] If the brightness face data is filtered at a larger scale, more ideal smoothing information can be obtained, but its structural information is also lost accordingly. If the brightness face data is filtered at a smaller scale, clearer structural information can be obtained.

[0071] Step 1032: Take the absolute value of the difference between the brightness face data and the first candidate face data to obtain the second candidate face data.

[0072] Subtract the first candidate face data from the original image (i.e., brightness face data), take the absolute value of the difference between the two, and obtain the second candidate face data. Some high-frequency areas and areas with relatively large change rates can be obtained. These areas are often the edges of facial features such as eyes, nose, and mouth, rather than the edges of blemishes such as wrinkles, spots, and acne marks.

[0073] Step 1033: input the second candidate face data into a preset kernel function for processing to output feature face data.

[0074] According to pattern recognition theory, patterns that are linearly inseparable in low-dimensional space may become linearly separable through nonlinear mapping to high-dimensional feature space. However, if this technology is used directly for classification or regression in high-dimensional space, there will be problems such as determining the form and parameters of the nonlinear mapping function and the dimension of the feature space. The biggest obstacle is the "curse of dimensionality" that exists when operating in high-dimensional feature space.

[0075] Assume x, z∈X, X belongs to the R(n) space, and the nonlinear function Φ realizes the mapping from the input space X to the feature space F, where F belongs to R(m), n<<m.

[0076] According to the kernel function:

[0077] K(x,z)=<Φ(x),Φ(z)>

[0078] Among them, <, > is the inner product, and K(x, z) is the kernel function.

[0079] It can be seen that the kernel function transforms the inner product operation of the m-dimensional high-dimensional space into the kernel function calculation of the n-dimensional low-dimensional input space, thereby solving the problems such as the "dimensionality curse" in the calculation of the high-dimensional feature space and greatly reducing the amount of calculation.

[0080] In a specific implementation, the kernel function includes a linear kernel function, a polynomial kernel function, a Gaussian kernel function, an exponential kernel function, a Laplace kernel function, and the like.

[0081] In this embodiment, the second candidate face data in the low-dimensional space may be input into a preset kernel function for processing, thereby outputting feature face data in the high-dimensional space.

[0082] Taking the polynomial kernel function as an example, the preset second coefficient is added to the product of the brightness value of the second candidate face data and the preset first coefficient to obtain the adjustment value. The adjustment value is used as the base and the preset third coefficient is used as the exponent to output the brightness value of the feature face data.

[0083] In this example, the kernel function is processed as follows:

[0084] k(x)=(ax+b) c

[0085] Wherein, x is the brightness value of the second candidate face data, a is the first coefficient, b is the second coefficient, c is the third coefficient, and optionally, c is a positive integer greater than 2.

[0086] In another embodiment of the present invention, step 103 may include the following steps:

[0087] Step 1034: downsample the brightness face data.

[0088] In this embodiment, the original brightness image data may be downsampled by a nearest neighbor method, a bilinear interpolation method, or the like, so as to reduce the brightness face data and reduce the computing resources occupied by subsequent processing of the brightness face data.

[0089] It should be noted that if the computing resources of the mobile terminal are sufficient, the brightness face data may not be downsampled, and this embodiment does not impose any restrictions on this.

[0090] In one case, the downsampling scale is a default empirical value.

[0091] In another case, the downsampling scale is adaptively adjusted based on the brightness face data.

[0092] Specifically, the mapping relationship between the resolution and the downsampling multiple can be pre-set, and the multiple is positively correlated with the resolution, that is, the larger the resolution, the larger the multiple, and vice versa, the smaller the resolution, the smaller the multiple, so that the amount of calculation and time consumption can be reduced as much as possible while meeting the accuracy requirements.

[0093] For example, for a resolution of 640×480 or less, the down-sampling resolution may be set to 2 times, and for a resolution of more than 640×480, the down-sampling resolution may be set to 4 times.

[0094] For the current brightness face data, the resolution of the brightness face data can be queried. In the mapping relationship, a multiple is set based on the resolution of the brightness face data, so that the brightness face data is downsampled according to the multiple.

[0095] Step 1035: filter the down-sampled brightness face data to obtain first candidate face data.

[0096] If downsampling is completed, the brightness face data after downsampling can be filtered using algorithms such as box filtering (mean filtering) and Gaussian filtering to obtain the first candidate face data.

[0097] Step 1036: Take the absolute value of the difference between the down-sampled brightness face data and the first candidate face data to obtain second candidate face data.

[0098] The down-sampled brightness face data is used as the original image, the first candidate face data is subtracted from the original image (ie, the down-sampled brightness face data), and the absolute value of the difference between the two is taken to obtain the second candidate face data.

[0099] Step 1037: input the second candidate face data into a preset kernel function for processing to output feature face data.

[0100] Step 1038: Perform upsampling on the feature face data to match the downsampling.

[0101] If the brightness face data is downsampled first, then the feature face data can be upsampled accordingly by using the nearest neighbor method, bilinear interpolation method, etc., so that the feature face data can be restored to the size before downsampling for subsequent processing.

[0102] It should be noted that if the computing resources of the mobile terminal are sufficient and the brightness face data is not downsampled first, then after the feature face data is generated, upsampling of the feature face data can be ignored, and this embodiment does not impose any restrictions on this.

[0103] In order to enable those skilled in the art to better understand the embodiment of the present invention, the method for extracting high-frequency areas using a kernel function in the present embodiment is described below with specific examples.

[0104] like Figure 2 As shown, for the same frame of image data, the left side is the high-frequency information without kernel function mapping, and the right side is the high-frequency information (feature face data) mapped using the kernel function in this embodiment, wherein the higher the grayscale of the pixel (the more white it is), the higher the probability that the pixel belongs to the edge, and the lower the grayscale (the more black it is), the lower the probability that the pixel belongs to the edge.

[0105] For the high-frequency information not mapped by the kernel function, in the face area, it is not possible to distinguish well the edges of facial features such as eyes, nose, and mouth from the edges of blemishes such as wrinkles, spots, and acne marks. In particular, it is difficult to distinguish the differences on both sides of the nose, forehead and other areas. The high-frequency information mapped by the kernel function in this embodiment (feature facial data) can well distinguish the edges of facial features such as eyes, nose, and mouth from the edges of blemishes such as wrinkles, spots, and acne marks. While maximizing the removal of the edges of blemishes such as wrinkles, spots, and acne marks, the edges of facial features such as eyes, nose, and mouth are retained.

[0106] Step 104: Map the feature face data into weighted image data.

[0107] Since the edges of facial features such as eyes, nose, and mouth, as well as the edges of blemishes such as wrinkles, spots, and acne marks can be distinguished in the feature face data (i.e., the face area), the feature face data is mapped to weighted image data through a preset mapping function, which can be expressed as:

[0108] Γ I (i) = f(M i )

[0109] Where f is the mapping function, M i is the brightness value of the i-th pixel in the feature face data, Γ I (i) is the weight of the i-th pixel in the feature face data.

[0110] Different weights can be configured for the edges of facial features such as eyes, nose, and mouth, and the edges of blemishes such as wrinkles, spots, and acne marks. That is, the weights of the edges of facial features such as eyes, nose, and mouth are greater than the weights of the edges of blemishes such as wrinkles, spots, and acne marks, thereby highlighting the edges of facial features such as eyes, nose, and mouth. This edge is also called a strong edge, which suppresses the edges of blemishes such as wrinkles, spots, and acne marks.

[0111] In one example, a mapping function can be determined. The mapping function can be generated by counting the brightness values ​​of pixels in different samples such as the edges of facial features such as eyes, nose, and mouth, and the edges of facial features such as eyes, nose, and mouth in high-dimensional space. The mapping function can be used to identify edge data based on brightness values, that is, the input of the mapping function is the brightness value in the high-bit space, and the output is the weight value. At this time, the distribution of pixels in different samples as strong edges at a certain brightness value can be counted, thereby configuring corresponding weights, and fitting these brightness values ​​and their weights into a mapping function.

[0112] In order to maintain universality, the mapping function can refer to the facial data of users of different races, age groups, and skin colors, and can also refer to facial data under different lighting conditions. Therefore, the mapping function is relatively broad and relatively accurate.

[0113] Figure 3 As shown, in the coordinate system where the mapping function is located, the horizontal coordinate (horizontal axis) is the brightness value (X) and the vertical coordinate (vertical axis) is the weight value (P).

[0114] The mapping function includes a first mapping segment (with a horizontal coordinate of [x0, x1]) and a second mapping segment (with a horizontal coordinate of [x1, x2]) connected in sequence, wherein the weight value in the first mapping segment increases from 0 to a specified value T (such as 1), and the weight value in the second mapping segment is the specified value T (such as 1).

[0115] Furthermore, the second mapping segment is a line segment, and the first mapping segment is a curve, which can be fitted by using a polynomial function or the like.

[0116] Of course, the above mapping function is only used as an example. When implementing the embodiment of the present invention, other mapping functions can be set according to actual conditions. For example, the mapping function includes a first mapping segment, a second mapping segment, and a third mapping segment connected in sequence, wherein the weight value in the first mapping segment increases from 0 to a specified value (such as 1), the weight value of the second mapping segment is a specified value (such as 1), and the weight value of the third mapping segment decreases from a specified value (such as 1) to 0, and so on. The embodiment of the present invention does not limit this. In addition, in addition to the above mapping function, those skilled in the art can also use other mapping functions according to actual needs, and the embodiment of the present invention does not limit this.

[0117] For the current feature face data, the brightness value of each pixel in the feature face data can be queried, and the brightness value of each pixel in the feature face data can be substituted into the mapping function to map it to the weight value of the pixel in the weighted image data, that is, the horizontal axis in the coordinate system where the mapping function is located marks the brightness value of each pixel of the feature face data. If the brightness value of the pixel in the feature face data is outside the mapping function, the weight value of the pixel is 0. If the brightness value of the pixel in the feature face data is within the mapping function, the mapping function can be used to find the weight value corresponding to the brightness value on the vertical axis as the weight value of the pixel.

[0118] Step 105 : When edge-preserving filtering is performed on the original image data, the strength of edge-preserving is adjusted using the weighted image data to obtain target image data.

[0119] In this embodiment, edge-preserving filtering is applied to perform skin smoothing on the original face data, the weighted image data is combined with the original image data, and the strength of edge preservation is adjusted to protect non-skin-colored areas, thereby obtaining target image data after skin smoothing.

[0120] Taking weighted guided filtering as an example, weighted guided filtering uses the regularization parameter ∈ to control the strength of edge preservation. When the variance of a pixel is much larger than ∈, the pixel is considered to be on a strong edge, and the pixel of the original image data can be used directly; when the variance of a pixel is much smaller than ∈, the pixel is considered to be in a flat area, and the mean of other pixels around the pixel can be used. However, this ∈ is a global setting and may not be applicable to some scenes.

[0121] In some technologies, the weighted guided filter is improved, and the variance is used to measure whether there is a strong edge in the current original image data. The variance is used to adaptively adjust the weighted guided filter. The adjustment process can be understood as follows: for areas with smaller variance, the filtering effect remains unchanged, and for areas with larger variance, the filtering effect is appropriately adjusted, thereby achieving the effect of adaptively adjusting the edge preservation strength.

[0122] The operation steps of the improved weighted guided filtering are as follows:

[0123] 1. Define the adaptive coefficient

[0124]

[0125] Among them, ρ 2 (i) is the variance of the global pixel, ρ 2 (p) is the variance of the local pixel N, and θ is a constant.

[0126] 2. The energy function of guided filtering becomes

[0127]

[0128] 3. The solution of the coefficient becomes

[0129]

[0130] Steps 2 and 3 can be understood as using a preset filter window |w| to traverse the guide image data and the original image data to calculate the average value μ of the pixels located in the filter window |w| in the guide image data. k , variance σ k , in the feature image data, calculate the average value of the pixels in the filter window |w|

[0131] Among them, i represents the pixel point in the filter window |w|, k is the midpoint of the filter window |w|, and p i is the pixel point in the original image data traversed, I i is the pixel point in the traversed guide image data, ∈ is the regularization parameter, a k is the first coefficient, b k is the second coefficient.

[0132] In the improved weighted guided filtering, the global variance is used as a benchmark and the variance of the current pixel is used for adjustment. Since it takes into account the overall information, it may be very helpful in the global filtering algorithm, but it is easy to cause problems for the local filtering algorithm such as skin resurfacing:

[0133] If the texture of the background area is more complex, then the edge-preserving position is the background, while the edge-preserving effect is lost for the face area, which can easily lead to blurred foreground. Moreover, it is difficult to define the strong edge of the face area as the edge of a defect or the edge of a part to be retained. Therefore, after the improvement, there are still some situations that cannot be handled when the weighted guided filter is applied to the skin refining process.

[0134] In this embodiment, weighted guided filtering is applied to determine reference image data, which may be the original image data itself or more reasonable image data generated based on the reference image data, such as image data after brightening and / or denoising the brightness image data separated from the original image data based on the Retinex model. This embodiment does not impose any restrictions on this.

[0135] The reference image data is used as the guide image data to filter the original image data to obtain the target image data, wherein the filtering process has a regularization parameter ∈ and the weight image data is used as the custom coefficient Γ I (i), used to adjust the regularization parameter ∈.

[0136] Compared with the improved weighted guided filtering, this embodiment introduces face image data to limit the range, and uses the strong edges of the face area to adaptively adjust the weighted image data, which can better avoid the problem of blurred foreground when the background area is more complex in the improved weighted guided filtering; through the introduction of kernel functions, the data that is inseparable in one-dimensional space is mapped to a high-dimensional space, and the edges of defects and facial features in the face area are separated; the optimization of the adaptive guided filtering in the skin smoothing process is achieved at a low computational cost; in summary, this embodiment can improve the effect of the skin smoothing process while ensuring the performance of the skin smoothing process, and make it suitable for complex and diverse acquisition environments, thereby improving the image quality after real-time video beauty processing.

[0137] In this embodiment, original image data is collected, original face data is detected in the original image data, the original face data has brightness face data representing brightness, the feature dimension of the brightness face data is improved, feature face data is obtained, and the feature face data is mapped to weighted image data. When edge-preserving filtering is performed on the original image data, the strength of edge-preserving is adjusted using the weighted image data to obtain target image data. The processing range is limited by introducing face image data, and the strong edge of the face area is used to adaptively adjust the weighted image data, which greatly improves the flexibility of edge-preserving filtering. The problem of foreground blurring when the background area is complex can be avoided. The feature dimension of the brightness face data is improved to distinguish the edges of defects and facial features in the face area. The processing of the weighted image data is relatively simple, and the optimization of the adaptive edge-preserving filtering in the skin grinding process is achieved at a low cost of calculation. That is, this embodiment can improve the effect of the skin grinding process while ensuring the performance of the skin grinding process, and make it suitable for complex and diverse acquisition environments. In the case of limited performance of devices such as mobile terminals, real-time skin grinding can be achieved.

[0138] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0139] Embodiment 2

[0140] Figure 4 This is a structural block diagram of a dermabrasion treatment device provided in the second embodiment of the present invention, which may specifically include the following modules:

[0141] The original image data acquisition module 401 is used to acquire original image data;

[0142] An original face data detection module 402, configured to detect original face data in the original image data, wherein the original face data includes brightness face data indicating brightness;

[0143] A feature dimension enhancement module 403 is used to enhance the feature dimension of the brightness face data to obtain feature face data;

[0144] A weighted image data mapping module 404, used to map the characteristic face data into weighted image data;

[0145] The edge-preserving filtering processing module 405 is used to adjust the strength of edge preservation using the weighted image data when performing edge-preserving filtering processing on the original image data to obtain target image data.

[0146] In one embodiment of the present invention, the original face data detection module 402 includes:

[0147] A face detection interface calling module, used to call the face detection interface provided by the camera to request to detect original face data in the original image data collected by the camera;

[0148] The face frame receiving module is used to receive one or more face frames returned by the face detection interface, and the face frames are used to frame the original face data.

[0149] In one embodiment of the present invention, it also includes:

[0150] An area statistics module, configured to respectively count the areas of a plurality of original face data if there are a plurality of original face data in the original image data;

[0151] The area selection module is used to extract the n original face data with the largest area.

[0152] In one embodiment of the present invention, the feature dimension enhancement module 403 includes:

[0153] A first candidate face data generating module, used for filtering the brightness face data to obtain first candidate face data;

[0154] A second candidate facial data generating module, configured to obtain second candidate facial data by taking an absolute value of a difference between the brightness facial data and the first candidate facial data;

[0155] The kernel function processing module is used to input the second candidate human face data into a preset kernel function for processing to output feature human face data.

[0156] In one embodiment of the present invention, the first candidate face data generating module includes:

[0157] A filter window determination module, used to determine a filter window, wherein the size of the filter window is positively correlated with the resolution of the original image data;

[0158] A filter window filtering module is used to filter the brightness face data using the filter window to obtain the first candidate face data.

[0159] In one embodiment of the present invention, the feature dimension improving module 403 further includes:

[0160] A downsampling module is used to perform downsampling on the brightness face data.

[0161] In one embodiment of the present invention, the downsampling module comprises:

[0162] A resolution query module, used to query the resolution of the brightness face data;

[0163] A magnification setting module, used to set the magnification based on the resolution, wherein the magnification is positively correlated with the resolution;

[0164] The adaptive sampling module is used to downsample the brightness face data according to the multiple.

[0165] In one embodiment of the present invention, the feature dimension improving module 403 further includes:

[0166] An up-sampling module is used to perform up-sampling on the characteristic face data to match the down-sampling.

[0167] In one embodiment of the present invention, the kernel function processing module includes:

[0168] an adjustment value calculation module, configured to add a preset second coefficient to the product of the brightness value of the second candidate human face data and the preset first coefficient to obtain an adjustment value;

[0169] The brightness value output module is used to output the brightness value of the characteristic face data by taking the adjustment value as the base and the preset third coefficient as the exponent.

[0170] In one embodiment of the present invention, the weight image data mapping module 404 includes:

[0171] A mapping function determination module, used to determine a mapping function, wherein the abscissa of the mapping function is a brightness value and the ordinate is a weight value, the mapping function comprises a first mapping segment and a second mapping segment connected in sequence, the weight value in the first mapping segment increases from 0 to a specified value, and the weight value in the second mapping segment is a specified value;

[0172] The brightness value mapping module is used to substitute the brightness value of each pixel in the feature face data into the mapping function to map it into the weight value of the pixel in the weight image data.

[0173] In one embodiment of the present invention, the edge preserving filtering processing module 405 includes:

[0174] A reference image data determination module, used to determine reference image data;

[0175] The guided filtering processing module is used to filter the image face data using the reference image data as the guiding image data to obtain the target image data. The filtering process has a regularization parameter, and the weight image data is used to adjust the regularization parameter.

[0176] The dermabrasion treatment device provided in the embodiment of the present invention can execute the dermabrasion treatment method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0177] Embodiment 3

[0178] Figure 5 A schematic diagram of the structure of a mobile terminal provided in Embodiment 3 of the present invention. Figure 5 A block diagram of an exemplary mobile terminal 12 suitable for use in implementing embodiments of the present invention is shown. Figure 5 The mobile terminal 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0179] like Figure 5 As shown, the mobile terminal 12 is in the form of a general purpose computing device. The components of the mobile terminal 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0180] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0181] The mobile terminal 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the mobile terminal 12, including volatile and non-volatile media, removable and non-removable media.

[0182] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The mobile terminal 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0183] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0184] The mobile terminal 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the mobile terminal 12, and / or any device that enables the mobile terminal 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the mobile terminal 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the mobile terminal 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the mobile terminal 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0185] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the dermabrasion processing method provided in the embodiment of the present invention.

[0186] Embodiment 4

[0187] Embodiment 4 of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned dermabrasion treatment method are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0188] Among them, computer-readable storage media may include, for example, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, 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 above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.

[0189] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A microdermabrasion method, characterized in that: include: Collecting raw image data; Detecting original face data in the original image data, wherein the original face data includes brightness face data indicating brightness; Improving the characteristic dimension of the brightness face data to obtain characteristic face data; Mapping the characteristic face data into weighted image data; When edge-preserving filtering is performed on the original image data, the strength of edge-preserving is adjusted using the weighted image data to obtain target image data.

2. The method according to claim 1, characterized in that The detecting original face data in the original image data comprises: Calling a face detection interface provided by a camera to request detection of original face data in the original image data collected by the camera; Receive one or more face frames returned by the face detection interface, where the face frames are used to frame original face data.

3. The method according to claim 1, characterized in that Also includes: If there are multiple original face data in the original image data, counting the areas of the multiple original face data respectively; Extract the n original face data with the largest area.

4. The method according to claim 1, characterized in that The step of improving the characteristic dimension of the brightness face data to obtain characteristic face data includes: Performing filtering processing on the brightness face data to obtain first candidate face data; Taking an absolute value of a difference between the brightness face data and the first candidate face data to obtain second candidate face data; The second candidate face data is input into a preset kernel function for processing to output feature face data.

5. The method according to claim 4, characterized in that The filtering process of the brightness face data to obtain first candidate face data includes: Determine a filter window, wherein the size of the filter window is positively correlated with the resolution of the original image data; The brightness face data is filtered using the filter window to obtain first candidate face data.

6. The method according to claim 4, characterized in that Before filtering the brightness face data to obtain the first candidate face data, improving the feature dimension of the brightness face data to obtain feature face data further includes: Downsampling is performed on the brightness face data.

7. The method according to claim 6, characterized in that The downsampling the brightness face data comprises: Query the resolution of the brightness face data; Setting a multiple based on the resolution, the multiple being positively correlated with the resolution; The brightness face data is downsampled according to the multiple.

8. The method according to claim 6, characterized in that After the second candidate human face data is input into a preset kernel function for processing to output characteristic human face data, the characteristic dimension of the brightness human face data is increased to obtain characteristic human face data, further comprising: Upsampling matching the downsampling is performed on the feature face data.

9. The method according to claim 4, characterized in that The step of inputting the second candidate face data into a preset kernel function for processing to output feature face data comprises: Adding a preset second coefficient to the product of the brightness value of the second candidate human face data and the preset first coefficient to obtain an adjustment value; The adjustment value is used as a base and the preset third coefficient is used as an exponent to output the brightness value of the characteristic face data.

10. The method according to any one of claims 1 to 9, characterized in that: Mapping the characteristic face data into weighted image data comprises: Determine a mapping function, wherein the abscissa of the mapping function is a brightness value and the ordinate is a weight value, the mapping function comprises a first mapping segment and a second mapping segment connected in sequence, the weight value in the first mapping segment increases from 0 to a specified value, and the weight value in the second mapping segment is a specified value; The brightness value of each pixel in the feature face data is substituted into the mapping function to map it into the weight value of the pixel in the weight image data.

11. The method according to any one of claims 1 to 9, characterized in that: When performing edge-preserving filtering processing on the original image data, using the weighted image data to adjust the strength of edge-preserving to obtain target image data includes: determining reference image data; The image face data is filtered using the reference image data as guide image data to obtain target image data, the filtering process has a regularization parameter, and the weight image data is used to adjust the regularization parameter.

12. A microdermabrasion device, characterized in that: include: The original image data acquisition module is used to acquire the original image data; An original face data detection module, used for detecting original face data in the original image data, wherein the original face data includes brightness face data representing brightness; A feature dimension enhancement module, used to enhance the feature dimension of the brightness face data to obtain feature face data; A weighted image data mapping module, used for mapping the characteristic face data into weighted image data; The edge-preserving filtering processing module is used to adjust the strength of edge preservation using the weighted image data when performing edge-preserving filtering processing on the original image data to obtain target image data.

13. A mobile terminal, characterized in that: The mobile terminal comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the microdermabrasion method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the microdermabrasion method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Automatic illumination compensation method and system of video image

    CN102611851A

  • Augmented reality device low in power consumption

    CN108446639A

  • Face evaluation method and related product

    CN109816628A

  • Light supplement adjusting method and device, electronic equipment and storage medium

    CN111447374A

  • Video denoising method and device, mobile terminal and storage medium

    CN111614867A