Wrinkle detection method and device and computer readable storage medium

Through filtering and skeleton extraction technology, combined with black hat algorithm and Frangi filtering algorithm, the problem of wrinkle detection being susceptible to plaque, acne marks and hair interference in traditional image processing is solved, and high-precision wrinkle detection is achieved.

CN119850612AActive Publication Date: 2025-04-18SUZHOU UNIV

Patent Information

Application Number
CN202510327506.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-04-18
Estimated Expiration
2045-03-19

AI Technical Summary

Technical Problem

The existing wrinkle detection methods based on traditional image processing are susceptible to factors such as plaques, acne marks and hair, resulting in low accuracy of the detection results.

Method used

Filtering and skeleton extraction technology are used, combined with black hat algorithm and Frangi filtering algorithm, and by calculating the circularity, overlapping area and grayscale values of the connecting domain, plaques, acne marks and hair interference are removed, and high-precision wrinkle images are obtained.

Benefits of technology

The accuracy of wrinkle detection is improved, effectively removes interfering factors of plaques, acne marks and hair, and obtains detection results that are closer to the distribution of facial wrinkles on the actual human face.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850612A_ABST
    Figure CN119850612A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image detection, and relates to a wrinkle detection method and device and a computer readable storage medium. Processing the to-be-detected face image to obtain a grayscale image; filtering the grayscale image, and performing skeleton extraction on the filtered image to obtain a first wrinkle to-be-screened image; processing the grayscale image by using a black cap algorithm to obtain a hair area in the grayscale image; removing a connected domain of which the roundness is greater than or equal to a first preset threshold value in the first wrinkle to-be-screened image to obtain a second wrinkle to-be-screened image; and based on the coordinate of each connected domain in the second wrinkle to-be-screened image, calculating the overlapping area of the connected domains and the hair region, removing the connected domains of which the overlapping area is greater than or equal to a second preset threshold value to obtain a target wrinkle image, and obtaining a wrinkle detection result based on the target wrinkle image. According to the scheme, through comparing the features between the wrinkles and various face interference factors, the connected domains in the image after skeleton extraction are effectively screened, and the wrinkle detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image detection technology, and in particular to a wrinkle detection method, device and computer-readable storage medium. Background Art

[0002] Wrinkle detection technology plays an important role in the fields of skin medical diagnosis and health management, and has significant application value. Existing wrinkle detection methods are mainly divided into two categories: indirect detection and direct detection. Indirect detection prepares silicone samples of the skin and performs microscopic detection or texture analysis on the silicone samples. However, this method requires obtaining accurate skin physical parameters, such as skin roughness, skin curvature, etc., and then preparing silicone samples based on these parameters. The operation is complicated and time-consuming, and the similarity between silicone samples and real skin will affect the accuracy of the detection results. Direct detection refers to wrinkle detection technology based on computer vision. Skin images are analyzed through image processing technology to extract wrinkle features for wrinkle detection. It does not require invasive operations on the skin and is efficient and non-invasive. Therefore, it has gradually become a research hotspot.

[0003] Wrinkle detection technology based on computer vision is mainly divided into two categories: deep learning and traditional image processing methods. The deep learning method uses skin images of different races, ages and skin types to train the neural network model, so that the model learns the mapping relationship between various skin images and wrinkles, and uses the trained model to obtain information such as the location, depth and area of ​​wrinkles in the skin image to be detected; in order to enable the model to learn enough features, it is often necessary to collect skin images of all types, but the number of people of different races, ages and skin types is huge and widely distributed, and it is difficult to fully collect these data, which will lead to low wrinkle detection accuracy for skin images that the model has not learned; and as more and more image data is collected, the model also requires a lot of computing resources and time for training; in addition, since the wrinkle detection task is applied to beauty and medical scenarios, it has high requirements for the stability and interpretability of the detection results, and the detection results of the deep learning model are based on the overall performance after training with a large amount of data. Its internal calculation process and decision-making mechanism are difficult to intuitively understand and explain, so it is difficult to provide users with intuitive and clear result explanations. For the above reasons, although the wrinkle detection method based on deep learning has made progress in the research field, it is still not widely popularized in practical applications.

[0004] Traditional image processing methods mainly rely on manually designed features and extract wrinkle-related information through mathematical models. They have the advantages of high detection efficiency, low implementation difficulty, and stable and predictable results. Therefore, they are widely used in various wrinkle detection scenarios. Specifically, this method first uses feature enhancement technology to preprocess the skin image to highlight the texture structure in the skin image, then uses edge detection operators to extract the boundary features of wrinkles, or uses filtering technology to extract the ridge structure in the skin image, and finally extracts wrinkle features through morphological filtering. For example, the patent with publication number CN115937952A discloses a facial wrinkle detection method based on multi-polarization states. By shooting a human face with a device connected to a skin detector, parallel skew images and cross skew images are obtained, and the parallel skew images and cross skew images are filtered using Frangi filtering technology. Finally, the filtered image is skeleton extracted to obtain the final wrinkle image. Although filtering images using filtering technology can enhance the linear structure in the image, in actual skin images, wrinkles, plaques, acne marks, and hair also show certain linear characteristics. Therefore, in addition to enhancing the linear structure at the wrinkle location, the filtering process will also enhance the linear structure at the plaques, acne marks, and hair, resulting in the final extracted wrinkle image containing not only wrinkles, but also plaques, acne marks, and hair, reducing the accuracy of wrinkle detection results.

[0005] In summary, the existing wrinkle detection methods based on traditional image processing are easily interfered by factors such as plaques, acne marks and hair, and have the problem of low detection result accuracy. Summary of the invention

[0006] To this end, the technical problem to be solved by the present invention is to overcome the problem that the wrinkle detection method based on traditional image processing in the prior art is easily interfered by factors such as plaques, acne marks and hair, resulting in low accuracy of the detection result.

[0007] In order to solve the above technical problems, the present invention provides a wrinkle detection method, comprising: Collecting a face image to be detected, and processing the face image to be detected to obtain a grayscale image; Filtering the grayscale image and performing skeleton extraction on the filtered image to obtain a first wrinkle screening image; processing the grayscale image using a black hat algorithm to obtain a hair region in the grayscale image; Based on the perimeter and area of ​​each connected domain in the first wrinkle screening image, the circularity of the connected domain is calculated, and the connected domains whose circularity is greater than or equal to a first preset threshold are removed to obtain a second wrinkle screening image; Based on the coordinates of each connected domain in the second wrinkle image to be screened, the overlapping area between the connected domain and the hair area is calculated, and the connected domains with overlapping areas greater than or equal to a second preset threshold are removed to obtain a target wrinkle image, and the wrinkle detection result of the face image to be detected is obtained based on the connected domains in the target wrinkle image.

[0008] Preferably, after obtaining the target wrinkle image, the method further includes: The grayscale value of each connected domain in the target wrinkle image is obtained, and the connected domains whose grayscale values ​​are less than or equal to a third preset threshold are removed.

[0009] Preferably, obtaining the grayscale value of each connected domain in the target wrinkle image includes: The grayscale values ​​of all pixels in the connected domain are obtained, the minimum K grayscale values ​​are averaged, and the calculated average value is used as the grayscale value of the connected domain.

[0010] Preferably, the grayscale image is filtered using a Frangi filtering algorithm, which specifically includes: Calculating the gradient of the grayscale image in the vertical direction to obtain a vertical gradient map; Scaling the vertical gradient image until the grayscale value of the vertical gradient image is within a preset range to obtain a scaled bit image; Calculating a relative grayscale smoothness descriptor of the bit image, and substituting the relative grayscale smoothness descriptor into a negative correlation linear regression equation to calculate a scale parameter of a Frangi filtering algorithm; The grayscale image is filtered based on a scale parameter of the Frangi filtering algorithm.

[0011] Preferably, the calculation formula of the relative grayscale smoothness descriptor is: , , in, Relative grayscale smoothness descriptor representing a bit image; Represents the second-order moment of the bit image; Indicates grayscale; Indicates the number of gray levels; Indicates Gray levels; Indicates the average grayscale of a bit image; express Probability in the normalized histogram; The calculation formula of the scale parameter of the Frangi filtering algorithm is: , in, Represents the scale parameter of the Frangi filter algorithm; represents a negative correlation coefficient, ; represents the initial scale parameter.

[0012] Preferably, the value range of the first preset threshold is [0.1, 0.4]; and / or The value range of the second preset threshold is [0.2, 0.6].

[0013] Preferably, the value range of the third preset threshold is [50, 150].

[0014] Preferably, processing the face image to be detected to obtain a grayscale image includes: The face RGB image collected under parallel polarized light is used as the face image to be detected; Using the Mediapipe machine learning framework to obtain key points for facial wrinkle detection, cropping the face image to be detected based on the key points for facial wrinkle detection, removing areas that do not contain the key points for facial wrinkle detection, and obtaining the image to be detected; The image to be detected is converted to obtain a grayscale image.

[0015] The present invention also provides a wrinkle detection device, comprising: An image acquisition module is used to acquire a face image to be detected, and process the face image to be detected to obtain a grayscale image; An image filtering processing module is used to filter the grayscale image and perform skeleton extraction on the filtered image to obtain a first wrinkle screening image; and process the grayscale image using a black hat algorithm to obtain a hair region in the grayscale image; A first wrinkle screening module, configured to calculate the circularity of each connected domain in the first wrinkle screening image based on the perimeter and area of ​​the connected domain, and remove the connected domains whose circularity is greater than or equal to a first preset threshold, to obtain a second wrinkle screening image; The second wrinkle screening module is used to calculate the overlapping area between the connected domain and the hair area based on the coordinates of each connected domain in the second wrinkle screening image, and remove the connected domains whose overlapping area is greater than or equal to a second preset threshold to obtain a target wrinkle image, and obtain the wrinkle detection result of the face image to be detected based on the connected domains in the target wrinkle image.

[0016] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned wrinkle detection method are implemented.

[0017] The wrinkle detection method provided by the present application has the following beneficial effects: 1. Taking into account the different characteristics of wrinkle structure and other facial interference features, the grayscale image is filtered and the skeleton is extracted to obtain the first wrinkle image to be screened, and the perimeter and area of ​​each connected domain in the image are obtained to calculate the roundness of each connected domain. Since the wrinkle structure is usually slender, its roundness is small, while the plaque and acne scar structure is usually circular or approximately circular, and has a large roundness. Therefore, a first preset threshold is set based on the maximum roundness of the general wrinkle structure, and the connected domains with a roundness greater than or equal to the first preset threshold are removed, thereby removing the connected domains representing plaques and acne scars in the first wrinkle image to be screened, and obtaining the second wrinkle image to be screened; since the hair structure of the facial hair area is in the skeleton, The extracted image is similar to the wrinkle structure and may be mistaken for the wrinkle area. Therefore, the present application uses the black hat algorithm to process the grayscale image to obtain the facial hair area, and calculates the overlapping area between each connected domain and the hair area in the second wrinkle to be screened image. When the overlapping area between the connected domain and the hair area is too large, it indicates that the connected domain is the hair result in the hair area. The connected domain is removed to obtain the target wrinkle image. The connected domain in the target wrinkle image is the facial wrinkle with plaques, acne marks and hair interference removed. By comparing the features between wrinkles and various facial wrinkle detection interference factors, the connected domains in the image after skeleton extraction are effectively screened, thereby improving the accuracy of wrinkle detection results.

[0018] 2. Since there may be some irregularly shaped patch structures on the face, the roundness of such patch structures may be small, and these interference factors cannot be removed by comparing the roundness alone. Therefore, after obtaining the target wrinkle image, the present application also obtains the grayscale value of each connected domain in the image, and determines whether the connected domain is a wrinkle structure or an irregular patch structure by comparing the grayscale values ​​of the connected domain. The facial wrinkle detection results are further screened, and the interference factors in the facial wrinkle detection process are filtered out to the greatest extent, so that the final wrinkle detection result is more accurate and closer to the wrinkle distribution on the actual face.

[0019] 3. The present application utilizes the Frangi filtering algorithm to filter the grayscale image to highlight the linear structure in the grayscale image, so that a wrinkle image can be extracted based on the filtered image. Since different existing structures have different coarseness and fineness, and the scale parameter of the Frangi filter algorithm determines the scale range of the existing structures that the algorithm can detect, when the scale parameter matches the scale of the actual linear structure in the image, the algorithm can more accurately identify and highlight the linear structure. In the prior art, the scale parameter is generally determined based on experience or a large number of experiments when the Frangi filter algorithm is used. However, the present application obtains the grayscale change information of the image in the vertical direction by calculating the gradient of the grayscale image in the vertical direction, and processes the gradient map in the vertical direction and calculates the relative grayscale smoothness descriptor of the processed image to reflect the roughness of the facial skin. When the roughness of the facial skin is large, a larger scale parameter is required to highlight the linear structure of the image, and when the roughness of the facial skin is small, only a smaller scale parameter is needed to highlight the linear structure. Therefore, there is a negative correlation between the relative grayscale smoothness descriptor and the scale parameter of the filtering algorithm. Based on this, the present application uses the relative grayscale smoothness descriptor and the negatively correlated linear regression equation to calculate the scale parameter that matches the grayscale image feature, thereby achieving the optimal filtering effect on the grayscale image and improving the wrinkle detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein: Figure 1 A flow chart of the wrinkle detection method provided for this application; Figure 2 A grayscale image provided in an embodiment of the present application; Figure 3 The filtered image provided by the embodiment of the present application; Figure 4 A first wrinkle image to be screened provided in an embodiment of the present application; Figure 5 For Example 1 Figure 4 A second wrinkle image to be screened is obtained by processing the first wrinkle image to be screened shown; Figure 6 For Example 1 Figure 5 The target wrinkle image is obtained by processing the second wrinkle image to be screened; Figure 7 For Example 1 Figure 6 Schematic diagram of wrinkle detection results obtained by processing the target wrinkle image shown; Figure 8 For Example 2 Figure 4A second wrinkle image to be screened is obtained by processing the first wrinkle image to be screened shown; Fig. 9 For Example 2 Figure 8 The target wrinkle image is obtained by processing the second wrinkle image to be screened; Fig.10 For Example 2 Fig. 9 Schematic diagram of wrinkle detection results obtained by processing the target wrinkle image shown; Fig.11 For Example 3 Figure 4 A second wrinkle image to be screened is obtained by processing the first wrinkle image to be screened shown; Fig.12 For Example 3 Fig.11 The target wrinkle image is obtained by processing the second wrinkle image to be screened; Fig.13 For Example 3 Fig.12 Schematic diagram of wrinkle detection results obtained by processing the target wrinkle image shown; Fig.14 For comparative example 1 Figure 4 The schematic diagram of wrinkle detection results obtained by processing the first wrinkle to be screened image is shown; Fig.15 For comparative example 2 Figure 4 The schematic diagram of wrinkle detection results obtained by processing the first wrinkle to be screened image is shown; Fig.16 For comparative example 3 Figure 4 The schematic diagram of wrinkle detection results obtained by processing the first wrinkle to be screened image is shown; Fig.17 This is a schematic diagram of the structure of the wrinkle detection device provided in this application. DETAILED DESCRIPTION

[0021] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0022] See also Figure 1 , Figure 1 The flowchart of the wrinkle detection method provided by the present application is shown, and the method comprises: S10: Collect the face image to be detected, and process the face image to be detected to obtain a grayscale image.

[0023] Further, in some embodiments of the present application, step S10 specifically includes: S100: Using the face RGB image collected under parallel polarized light as the face image to be detected; Specifically, using parallel polarized light as the illumination condition when collecting facial images can enhance the details of facial wrinkles, thereby providing high-quality image data for wrinkle detection.

[0024] S101: Use the Mediapipe machine learning framework to obtain key points for facial wrinkle detection, crop the face image to be detected based on the key points for facial wrinkle detection, remove the area that does not contain the key points for facial wrinkle detection, and obtain the image to be detected; Specifically, the Mediapipe machine learning framework is an open source machine learning framework developed by Google.

[0025] S102: Convert the image to be detected to obtain a grayscale image.

[0026] S20: filtering the grayscale image, and performing skeleton extraction on the filtered image to obtain a first wrinkle screening image; processing the grayscale image using a black hat algorithm to obtain a hair region in the grayscale image.

[0027] For example, in a specific example of the present application, a 3*3 cross structure element is selected to perform skeleton extraction on the filtered image, thereby obtaining a first wrinkle image to be screened containing multiple connected domains. In other embodiments, other structure elements can also be selected for skeleton extraction.

[0028] Specifically, the steps of processing grayscale images by the black hat algorithm include: selecting a circular or elliptical structural element to perform a black hat operation on the grayscale image, that is, first performing a closing operation on the grayscale image to connect the hair areas and highlight the dark areas in the grayscale image, and then subtracting the grayscale image from the result of the closing operation to enhance the contrast between the hair and the background, making the hair area more prominent; then converting the image after the black hat operation into a black and white binary image, performing morphological post-processing on the black and white binary image, and optimizing the extraction effect of the hair area, wherein the corrosion operation can be used to remove isolated noise points in the black and white binary image, and the dilation operation can be used to fill small holes in the black and white binary image; the black area in the black and white binary image after morphological post-processing is the hair area.

[0029] S30: Based on the perimeter and area of ​​each connected domain in the first wrinkle screening image, the circularity of the connected domain is calculated, and the connected domains whose circularity is greater than or equal to a first preset threshold are removed to obtain a second wrinkle screening image.

[0030] Specifically, the calculation formula of the circularity of the connected domain is: , in, Indicates the circularity of the connected domain; represents the area of ​​the connected domain; Represents the perimeter of the connected domain.

[0031] S40: Based on the coordinates of each connected domain in the second wrinkle image to be screened, the overlapping area between the connected domain and the hair area is calculated, and the connected domains with overlapping areas greater than or equal to a second preset threshold are removed to obtain a target wrinkle image, and the wrinkle detection result of the face image to be detected is obtained based on the connected domains in the target wrinkle image.

[0032] The present application comprehensively considers the different characteristics of wrinkle structure and other facial interference features, filters the grayscale image and performs skeleton extraction to obtain a first wrinkle image to be screened, obtains the perimeter and area of ​​each connected domain in the image, and thus calculates the roundness of each connected domain. Since the wrinkle structure is usually in a slender state, its roundness is small, while the plaque and acne scar structure is usually in a circular or approximately circular state, and has a large roundness, therefore, a first preset threshold is set based on the maximum roundness of the general wrinkle structure, and the connected domains with a roundness greater than or equal to the first preset threshold are removed, thereby removing the connected domains representing plaques and acne scars in the first wrinkle image to be screened, and obtaining a second wrinkle image to be screened; since the hair structure of the facial hair area is in the skeleton The extracted image is similar to the wrinkle structure and may be mistaken for the wrinkle area. Therefore, the present application uses the black hat algorithm to process the grayscale image to obtain the facial hair area, and calculates the overlapping area between each connected domain and the hair area in the second wrinkle to be screened image. When the overlapping area between the connected domain and the hair area is too large, it indicates that the connected domain is the hair result in the hair area. The connected domain is removed to obtain the target wrinkle image. The connected domain in the target wrinkle image is the facial wrinkle with plaques, acne marks and hair interference removed. By comparing the features between wrinkles and various facial wrinkle detection interference factors, the connected domains in the image after skeleton extraction are effectively screened, thereby improving the accuracy of wrinkle detection results.

[0033] Furthermore, the value range of the first preset threshold is [0.1, 0.4], for example, the first preset threshold can be 0.1, 0.2, 0.3 or 0.4; and / or, the value range of the second preset threshold is [0.2, 0.6], for example, the second preset threshold can be 0.2, 0.3, 0.4, 0.5 or 0.6.

[0034] Since the first preset threshold is used to remove connected domains with larger roundness and screen connected domains with smaller roundness and closer to wrinkle morphology, its value should be as close as possible to the roundness of most connected domains of wrinkle morphology. If the first preset threshold is too small, some connected domains of wrinkle morphology with slender shapes but slightly larger roundness may be removed. If the first preset threshold is too large, some connected domains of plaque or acne scar morphology with slender shapes and smaller roundness will be retained, affecting the wrinkle detection accuracy. The value range of the first preset threshold provided in the present application is set by comprehensively considering the roundness of connected domains of a large number of wrinkle morphologies and the roundness of connected domains of plaque and acne scar morphology. In detection scenarios with higher accuracy requirements, a smaller value can be taken within the value range, and in detection scenarios with looser accuracy requirements, a larger value can be taken within the value range. Similar to the first preset threshold, the second preset threshold is used to remove connected domains that are in the hair area but are mistakenly regarded as wrinkle morphology. In detection scenarios with higher accuracy requirements, a smaller value can be taken within the value range, and in detection scenarios with looser accuracy requirements, a larger value can be taken within the value range.

[0035] Furthermore, since some irregularly shaped plaque structures may have a small roundness, they may be mistaken for elongated wrinkles by simply comparing the roundness. In order to further improve the screening accuracy, in some embodiments of the present application, after obtaining the target wrinkle image, the following steps are further included: The grayscale value of each connected domain in the target wrinkle image is obtained, and the connected domains whose grayscale values ​​are less than or equal to a third preset threshold are removed.

[0036] Furthermore, a value range of the third preset threshold is [50, 150]. For example, the third preset threshold may be 50, 70, 90, 110, 130 or 150.

[0037] Optionally, obtaining the grayscale value of each connected domain in the target wrinkle image includes: Get the grayscale values ​​of all pixels in the target wrinkle image, and take the minimum grayscale value as the grayscale value of the connected domain.

[0038] However, in order to avoid screening errors caused by inaccurate grayscale values ​​of individual pixels, the present application also provides another method for obtaining the grayscale value of a connected domain, which specifically includes: The grayscale values ​​of all pixels in the connected domain are obtained, the minimum K grayscale values ​​are averaged, and the calculated average value is used as the grayscale value of the connected domain.

[0039] For example, the K value here can be set based on the number of pixels in the connected domain. In a specific example of the present application, the K value is 10% of the number of pixels in the connected domain.

[0040] Furthermore, in some embodiments of the present application, the grayscale image is filtered using a Frangi filtering algorithm, which specifically includes: Step 1: Calculate the vertical gradient of the grayscale image to obtain the vertical gradient map.

[0041] Step 2: Scale the vertical gradient image until the grayscale value of the vertical gradient image is within a preset range to obtain a scaled bit image.

[0042] In a specific example of the present application, the vertical gradient map is scaled to an 8-bit image with a grayscale value in the range of [0, 255].

[0043] Step 3: Calculate the relative grayscale smoothness descriptor of the bit image, and substitute the relative grayscale smoothness descriptor into the negative correlation linear regression equation to calculate the scale parameter of the Frangi filter algorithm.

[0044] Specifically, the calculation formula of the relative grayscale smoothness descriptor is: , , in, Relative grayscale smoothness descriptor representing a bit image; Represents the second-order moment of the bit image; Indicates grayscale; Indicates the number of gray levels; Indicates Gray levels; Indicates the average grayscale of a bit image; express Probability in the normalized histogram; The calculation formula of the scale parameter of the Frangi filtering algorithm is: , in, Represents the scale parameter of the Frangi filter algorithm; represents a negative correlation coefficient, ; represents the initial scale parameter.

[0045] Specifically, when the vertical gradient image is scaled to an 8-bit image with grayscale values ​​in the range of [0, 255], the number of grayscale levels in the above relative grayscale smoothness descriptor calculation formula is The value of is 256.

[0046] Step 4: Filter the grayscale image based on the scale parameter of the Frangi filtering algorithm.

[0047] Since the scale parameter of the Frangi filter algorithm controls the algorithm's sensitivity to linear structures of different scales, when the scale parameter matches the scale of the actual linear structure in the image, the algorithm can more accurately identify and highlight the linear structure. In the prior art, when using the Frangi filter algorithm, the scale parameter is generally determined based on experience or a large number of experiments. The former has low accuracy and cannot set the corresponding scale parameter according to the characteristics of different images. The latter requires a large number of experiments before filtering each image, which has high calculation and time costs.

[0048] Based on the above problems, the present application obtains the vertical gradient map of the grayscale image, processes the gradient map to obtain a bit image, and calculates the relative grayscale smoothness descriptor of the bit image to reflect the roughness of the grayscale image. When the relative grayscale smoothness descriptor is small, it indicates that the roughness of the grayscale image is large, that is, the current face to be detected has more facial fine lines, and a smaller scale parameter is required to match the linear structure in the image. When the relative grayscale smoothness descriptor is large, it indicates that the roughness of the grayscale image is small, that is, the current face to be detected has fewer facial wrinkles, and a larger scale parameter can match the linear structure in the image. It can be seen that there is a negative correlation between the relative grayscale smoothness descriptor and the scale parameter. Based on this, the present application can calculate the scale parameter that can match the current grayscale image characteristics by substituting the calculated relative grayscale smoothness descriptor into the negatively correlated linear regression equation, thereby improving the filtering accuracy and wrinkle detection accuracy.

[0049] The technical solution of the present application is described in more detail below in combination with a plurality of embodiments and comparative examples, but it should be understood that the following embodiments are only for explaining and illustrating the technical solution and do not limit the scope of the present application. Example 1

[0050] This embodiment provides a wrinkle detection method, which specifically includes the following steps: S100: Collect the face image to be detected, and process the face image to be detected to obtain the following Figure 2 Grayscale image shown.

[0051] S200: Filter the grayscale image to obtain Figure 3 The filtered image shown in FIG. 1 is subjected to skeleton extraction to obtain the following Figure 4 The first wrinkle screening image is shown; the grayscale image is processed using the black hat algorithm to obtain the hair region in the grayscale image. Specifically, the Frangi filter algorithm is used, and its scale parameter is calculated using the method provided in the above embodiment.

[0052] S300: Based on the perimeter and area of ​​each connected domain in the first wrinkle to be screened image, the circularity of the connected domain is calculated, and the connected domains with circularity greater than or equal to 0.1 are removed to obtain the following: Figure 5 The second wrinkle to be screened image is shown.

[0053] S400: Based on the coordinates of each connected domain in the second wrinkle screening image, the overlapping area between the connected domain and the hair area is calculated, and the connected domains with overlapping areas greater than or equal to 0.2 are removed to obtain Figure 6 Target wrinkle image shown.

[0054] S500: Obtain the grayscale values ​​of all pixels in each connected domain in the target wrinkle image, average the smallest K grayscale values, use the calculated average value as the grayscale value of the connected domain, and remove the connected domains with grayscale values ​​less than or equal to 50, and obtain the following: Figure 7 Schematic diagram of wrinkle detection results shown. Example 2

[0055] This embodiment provides a wrinkle detection method, which specifically includes the following steps: S100: Collect the face image to be detected, and process the face image to be detected to obtain the following Figure 2 Grayscale image shown.

[0056] S200: Filter the grayscale image to obtain Figure 3 The filtered image shown in FIG. 1 is subjected to skeleton extraction to obtain the following Figure 4 The first wrinkle screening image is shown; the grayscale image is processed using the black hat algorithm to obtain the hair region in the grayscale image. Specifically, the Frangi filter algorithm is used, and its scale parameter is calculated using the method provided in the above embodiment.

[0057] S300: Based on the perimeter and area of ​​each connected domain in the first wrinkle to be screened image, the circularity of the connected domain is calculated, and the connected domains with circularity greater than or equal to 0.2 are removed to obtain the following: Figure 8 The second wrinkle to be screened image is shown.

[0058] S400: Based on the coordinates of each connected domain in the second wrinkle screening image, the overlapping area between the connected domain and the hair area is calculated, and the connected domains with overlapping areas greater than or equal to 0.4 are removed to obtain Fig. 9 Target wrinkle image shown.

[0059] S500: Obtain the grayscale values ​​of all pixels in each connected domain in the target wrinkle image, average the smallest K grayscale values, use the calculated average value as the grayscale value of the connected domain, and remove the connected domains with grayscale values ​​less than or equal to 100, and obtain the following: Fig.10 Schematic diagram of wrinkle detection results shown. Example 3

[0060] This embodiment provides a wrinkle detection method, which specifically includes the following steps: S100: Collect the face image to be detected, and process the face image to be detected to obtain the following Figure 2 Grayscale image shown.

[0061] S200: Filter the grayscale image to obtain Figure 3 The filtered image shown in FIG. 1 is subjected to skeleton extraction to obtain the following Figure 4 The first wrinkle screening image is shown; the grayscale image is processed using the black hat algorithm to obtain the hair region in the grayscale image. Specifically, the Frangi filter algorithm is used, and its scale parameter is calculated using the method provided in the above embodiment.

[0062] S300: Based on the perimeter and area of ​​each connected domain in the first wrinkle to be screened image, the circularity of the connected domain is calculated, and the connected domains with circularity greater than or equal to 0.4 are removed to obtain the following: Fig.11 The second wrinkle to be screened image is shown.

[0063] S400: Based on the coordinates of each connected domain in the second wrinkle screening image, the overlapping area between the connected domain and the hair area is calculated, and the connected domains with overlapping areas greater than or equal to 0.6 are removed to obtain Fig.12 Target wrinkle image shown.

[0064] S500: Obtain the grayscale values ​​of all pixels in each connected domain in the target wrinkle image, average the smallest K grayscale values, use the calculated average value as the grayscale value of the connected domain, and remove the connected domains with grayscale values ​​less than or equal to 150, and obtain the following: Fig.13 Schematic diagram of wrinkle detection results shown. Comparative Example 1

[0065] This comparative example provides a wrinkle detection method, which specifically includes the following steps: S100: Collect the face image to be detected, and process the face image to be detected to obtain the following Figure 2 Grayscale image shown.

[0066] S200: Filter the grayscale image to obtain Figure 3 The filtered image shown in FIG. 1 is subjected to skeleton extraction to obtain the following Figure 4 The first wrinkle screening image is shown; the grayscale image is processed using the black hat algorithm to obtain the hair region in the grayscale image. Specifically, the Frangi filter algorithm is used, and its scale parameter is calculated using the method provided in the above embodiment.

[0067] S300: Based on the coordinates of each connected domain in the first wrinkle image to be screened, the overlapping area between the connected domain and the hair area is calculated, and the connected domains with overlapping areas greater than or equal to 0.6 are removed to obtain a target wrinkle image.

[0068] S400: Obtain the grayscale values ​​of all pixels in each connected domain in the target wrinkle image, average the smallest K grayscale values, use the calculated average value as the grayscale value of the connected domain, and remove the connected domains with grayscale values ​​less than or equal to 150, and obtain the following: Fig.14 Schematic diagram of wrinkle detection results shown. Comparative Example 2

[0069] This comparative example provides a wrinkle detection method, which specifically includes the following steps: S100: Collect the face image to be detected, and process the face image to be detected to obtain the following Figure 2 Grayscale image shown.

[0070] S200: Filter the grayscale image to obtain Figure 3 The filtered image shown in FIG. 1 is subjected to skeleton extraction to obtain the following Figure 4 The first wrinkle screening image is shown; the grayscale image is processed using the black hat algorithm to obtain the hair region in the grayscale image. Specifically, the Frangi filter algorithm is used, and its scale parameter is calculated using the method provided in the above embodiment.

[0071] S300: Based on the perimeter and area of ​​each connected domain in the first wrinkle screening image, the circularity of the connected domain is calculated, and the connected domains with circularity greater than or equal to 0.4 are removed to obtain a second wrinkle screening image.

[0072] S400: Obtain the grayscale values ​​of all pixels in each connected domain in the second wrinkle screening image, average the smallest K grayscale values, use the calculated average value as the grayscale value of the connected domain, and remove the connected domain with a grayscale value less than or equal to 150, to obtain the following: Fig.15 Schematic diagram of wrinkle detection results shown. Comparative Example 3

[0073] This comparative example provides a wrinkle detection method, which specifically includes the following steps: S100: Collect the face image to be detected, and process the face image to be detected to obtain the following Figure 2 Grayscale image shown.

[0074] S200: Filter the grayscale image to obtain Figure 3 The filtered image shown in FIG. 1 is subjected to skeleton extraction to obtain the following Figure 4The first wrinkle screening image is shown; the grayscale image is processed using the black hat algorithm to obtain the hair region in the grayscale image. Specifically, the Frangi filter algorithm is used, and its scale parameter is calculated using the method provided in the above embodiment.

[0075] S300: Based on the perimeter and area of ​​each connected domain in the first wrinkle screening image, the circularity of the connected domain is calculated, and the connected domains with circularity greater than or equal to 0.4 are removed to obtain a second wrinkle screening image.

[0076] S400: Based on the coordinates of each connected domain in the second wrinkle screening image, the overlapping area between the connected domain and the hair area is calculated, and the connected domains with overlapping areas greater than or equal to 0.6 are removed to obtain Fig.16 Schematic diagram of wrinkle detection results shown.

[0077] It is worth noting that in the above embodiments and comparative examples Figure 4 The image shown is a schematic diagram of the detection result obtained using the wrinkle detection method in the prior art.

[0078] By comparing the Figure 5 , Figure 6 and Figure 7 , or in Comparative Example 2 Figure 8 , Fig. 9 and Fig.10 , or in Comparative Example 3 Fig.11 , Fig.12 and Fig.13 It can be seen that the present application can gradually remove interfering factors such as plaques, acne marks and hair in the process of facial wrinkle detection by screening the connected domain from three aspects: the circularity of the connected domain, the overlapping area between the connected domain and the hair area, and the grayscale value of the connected domain, and retain the connected domain that only includes the wrinkle morphology, thereby improving the wrinkle detection accuracy. Fig.14 , Fig.15 and Fig.16 It can also be seen that the three levels of connected domain roundness, the overlapping area between the connected domain and the hair area, and the grayscale value of the connected domain can effectively remove interference factors in the detection results.

[0079] Based on the wrinkle detection method provided in the above embodiment, the present application also provides a wrinkle detection device, such as Fig.17 As shown, the device specifically includes: The image acquisition module 10 is used to acquire the face image to be detected, and process the face image to be detected to obtain a grayscale image.

[0080] The image filtering processing module 20 is used to filter the grayscale image and perform skeleton extraction on the filtered image to obtain a first wrinkle screening image; and process the grayscale image using a black hat algorithm to obtain a hair area in the grayscale image.

[0081] The first wrinkle screening module 30 is used to calculate the circularity of the connected domains based on the perimeter and area of ​​each connected domain in the first wrinkle screening image, and remove the connected domains whose circularity is greater than or equal to a first preset threshold to obtain the second wrinkle screening image.

[0082] The second wrinkle screening module 40 is used to calculate the overlapping area between the connected domain and the hair area based on the coordinates of each connected domain in the second wrinkle screening image, and remove the connected domains whose overlapping area is greater than or equal to a second preset threshold to obtain a target wrinkle image, and obtain the wrinkle detection result of the face image to be detected based on the connected domains in the target wrinkle image.

[0083] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned wrinkle detection method are implemented.

[0084] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0085] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0088] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.

Claims

1. A wrinkle detection method, characterized in that: include: Collecting a face image to be detected, and processing the face image to be detected to obtain a grayscale image; Filtering the grayscale image, and performing skeleton extraction on the filtered image to obtain a first wrinkle image to be screened; Processing the grayscale image using a black hat algorithm to obtain a hair region in the grayscale image; Based on the perimeter and area of ​​each connected domain in the first wrinkle screening image, the circularity of the connected domain is calculated, and the connected domains whose circularity is greater than or equal to a first preset threshold are removed to obtain a second wrinkle screening image; Based on the coordinates of each connected domain in the second wrinkle image to be screened, the overlapping area between the connected domain and the hair area is calculated, and the connected domains with overlapping areas greater than or equal to a second preset threshold are removed to obtain a target wrinkle image, and the wrinkle detection result of the face image to be detected is obtained based on the connected domains in the target wrinkle image.

2. The wrinkle detection method according to claim 1, characterized in that: After obtaining the target wrinkle image, the following steps are also included: The grayscale value of each connected domain in the target wrinkle image is obtained, and the connected domains whose grayscale values ​​are less than or equal to a third preset threshold are removed.

3. The wrinkle detection method according to claim 2, characterized in that: Obtaining the grayscale value of each connected domain in the target wrinkle image includes: The grayscale values ​​of all pixels in the connected domain are obtained, the minimum K grayscale values ​​are averaged, and the calculated average value is used as the grayscale value of the connected domain.

4. The wrinkle detection method according to claim 1, characterized in that: The grayscale image is filtered using a Frangi filtering algorithm, which specifically includes: Calculating the gradient of the grayscale image in the vertical direction to obtain a vertical gradient map; Scaling the vertical gradient image until the grayscale value of the vertical gradient image is within a preset range to obtain a scaled bit image; Calculating a relative grayscale smoothness descriptor of the bit image, and substituting the relative grayscale smoothness descriptor into a negative correlation linear regression equation to calculate a scale parameter of a Frangi filtering algorithm; The grayscale image is filtered based on a scale parameter of the Frangi filtering algorithm.

5. The wrinkle detection method according to claim 4, characterized in that: The calculation formula of the relative grayscale smoothness descriptor is: , , in, Relative grayscale smoothness descriptor representing a bit image; Represents the second-order moment of the bit image; Indicates grayscale; Indicates the number of gray levels; Indicates Gray levels; Indicates the average grayscale of a bit image; express Probability in the normalized histogram; The calculation formula of the scale parameter of the Frangi filtering algorithm is: , in, Represents the scale parameter of the Frangi filter algorithm; represents a negative correlation coefficient, ; represents the initial scale parameter.

6. The wrinkle detection method according to claim 1, characterized in that: The value range of the first preset threshold is [0.1, 0.4]; and / or The value range of the second preset threshold is [0.2, 0.6].

7. The wrinkle detection method according to claim 2, characterized in that: The value range of the third preset threshold is [50, 150].

8. The wrinkle detection method according to claim 1, characterized in that: Processing the face image to be detected to obtain a grayscale image includes: The face RGB image collected under parallel polarized light is used as the face image to be detected; Using the Mediapipe machine learning framework to obtain key points for facial wrinkle detection, cropping the face image to be detected based on the key points for facial wrinkle detection, removing areas that do not contain the key points for facial wrinkle detection, and obtaining the image to be detected; The image to be detected is converted to obtain a grayscale image.

9. A wrinkle detection device, characterized in that: include: An image acquisition module is used to acquire a face image to be detected, and process the face image to be detected to obtain a grayscale image; An image filtering processing module, used for filtering the grayscale image and performing skeleton extraction on the filtered image to obtain a first wrinkle screening image; Processing the grayscale image using a black hat algorithm to obtain a hair region in the grayscale image; A first wrinkle screening module, configured to calculate the circularity of each connected domain in the first wrinkle screening image based on the perimeter and area of ​​the connected domain, and remove the connected domains whose circularity is greater than or equal to a first preset threshold, to obtain a second wrinkle screening image; The second wrinkle screening module is used to calculate the overlapping area between the connected domain and the hair area based on the coordinates of each connected domain in the second wrinkle screening image, and remove the connected domains whose overlapping area is greater than or equal to a second preset threshold to obtain a target wrinkle image, and obtain the wrinkle detection result of the face image to be detected based on the connected domains in the target wrinkle image.

10. 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 steps of the wrinkle detection method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Face wrinkle detection method based on multiple polarization states

    CN115937952A

  • Image processing method and device, computer device and storage medium

    CN109325468A

  • Wrinkle detection method

    CN110929681A

  • Wrinkle recognition method based on image processing, wrinkle recognition device and terminal equipment

    CN113128376A

  • Face wrinkle detection method, electronic equipment and computer readable storage medium

    CN115984191A

Cited By

  • Neck wrinkle detection method and device, medium and program product

    CN121599908A