Wrinkle detection method, wrinkle display method, electronic equipment and storage medium

By cropping and enhancing the skin images of human faces and extracting fine wrinkle images, the problem of poor anti-interference ability of fine wrinkle detection in the prior art is solved, and the accuracy and reliability of detection are improved.

CN120108014APending Publication Date: 2025-06-06SHENZHEN SHULIAN TIANXIA INTELLIGENT TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510035183.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing fine wrinkle detection methods have poor anti-interference ability, which can easily detect facial hair as wrinkles incorrectly, reducing the accuracy of detection.

Method used

By obtaining skin images of the human face, cropping according to different types of wrinkle positions, feature enhancement and mask image processing are performed, and fine wrinkle images are extracted to reduce hair interference.

Benefits of technology

It improves the accuracy and reliability of facial fine wrinkles detection and reduces the interference of facial hair on detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120108014A_ABST
    Figure CN120108014A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of image processing, and discloses a wrinkle detection method, a wrinkle display method, electronic equipment and a storage medium, and the method comprises the steps: cutting a skin image according to the positions of different types of wrinkles on a human face, obtaining a local wrinkle image, carrying out the feature enhancement operation of the local wrinkle image, and obtaining a wrinkle detection result. The method comprises the steps of obtaining a local wrinkle image, obtaining a feature enhancement image, extracting a first pixel region in the local wrinkle image, carrying out AND operation on the first pixel region and the feature enhancement image to obtain a mask image, and carrying out feature extraction operation on the mask image to obtain a fine wrinkle image. The interference of facial hair on fine wrinkle detection is reduced, and the accuracy and reliability of facial fine wrinkle detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a wrinkle detection method, a wrinkle display method, an electronic device, and a storage medium. Background Art

[0002] Wrinkles are one of the most prominent features of the face, and their severity and distribution details can reflect the condition of the facial skin. Accurately detecting facial wrinkles helps analyze the user's skin condition, recommend appropriate skin care products, and develop personalized medical beauty plans. Currently, fine wrinkle detection is usually performed using filtering and denoising.

[0003] In the process of implementing the present application, the inventors found that there are at least the following problems in the prior art: the existing fine wrinkle detection method has poor anti-interference ability and is prone to misdetecting facial hair as wrinkles, thereby reducing the accuracy of facial fine wrinkle detection. Summary of the invention

[0004] The embodiments of the present application aim to provide a wrinkle detection method, a wrinkle display method, an electronic device and a storage medium to reduce the interference of facial hair on fine wrinkle detection and improve the accuracy and reliability of facial fine wrinkle detection.

[0005] The embodiments of the present application provide the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a wrinkle detection method, the wrinkle detection method comprising:

[0007] Acquire a skin image of a human face, the skin image including multiple types of wrinkles, and the multiple types of wrinkles are located at different positions on the human face;

[0008] According to the positions of different types of wrinkles on the face, the skin image is cropped to obtain a local wrinkle image;

[0009] Performing feature enhancement operation on the local wrinkle image to obtain a feature enhanced image;

[0010] Extracting a first pixel region in the local wrinkle image, and performing an AND operation on the first pixel region and the feature enhancement image to obtain a mask image, wherein the first pixel region is a non-black pixel region in the local wrinkle image;

[0011] Perform feature extraction on the mask image to obtain a fine wrinkle image.

[0012] In a second aspect, an embodiment of the present application provides a wrinkle display method, the wrinkle display method comprising:

[0013] Acquire a skin image of a human face;

[0014] Based on the coarse wrinkle detection model, coarse wrinkles in the skin image are extracted to obtain a coarse wrinkle image;

[0015] A fusion operation is performed on the coarse wrinkle image and the fine wrinkle image to obtain a facial wrinkle image, wherein the coarse wrinkle image and the fine wrinkle image correspond to the same skin image, and the fine wrinkle image is obtained according to the wrinkle detection method of the first aspect.

[0016] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0017] at least one processor, and

[0018] a memory communicatively coupled to at least one processor, wherein:

[0019] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the wrinkle detection method of the first aspect or the wrinkle display method of the second aspect.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which is stored computer program instructions executable by a processor. When the computer program instructions are called by the processor, the processor executes the wrinkle detection method of the first aspect or the wrinkle display method of the second aspect.

[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions or programs. When the instructions or programs are executed by an electronic device, the electronic device executes the computer program of the wrinkle detection method of the first aspect or the wrinkle display method of the second aspect.

[0022] Beneficial effects of the embodiments of the present application: Different from the prior art, the embodiments of the present application provide a wrinkle detection method, which includes: acquiring a skin image of a human face, the skin image including multiple types of wrinkles, and the multiple types of wrinkles are located at different positions on the human face; cropping the skin image according to the positions of different types of wrinkles on the human face to obtain a local wrinkle image; performing a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image; extracting a first pixel area in the local wrinkle image, and performing an AND operation on the first pixel area and the feature enhanced image to obtain a mask image, wherein the first pixel area is a non-black pixel area in the local wrinkle image; performing a feature extraction operation on the mask image to obtain a fine wrinkle image.

[0023] By cropping a skin image according to the positions of different types of wrinkles on a human face to obtain a local wrinkle image, performing a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image, extracting a first pixel area in the local wrinkle image, performing an AND operation on the first pixel area and the feature enhanced image to obtain a mask image, and performing a feature extraction operation on the mask image to obtain a fine wrinkle image, the present application can identify fine wrinkles on a human face, reduce interference of facial hair on fine wrinkle detection, and improve the accuracy and reliability of facial fine wrinkle detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0025] Figure 1 This is a schematic diagram of an application environment provided by an embodiment of the present application;

[0026] Figure 2 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0027] Figure 3 is a flow chart of a wrinkle detection method provided in an embodiment of the present application;

[0028] Figure 4 This is a schematic diagram of a process of performing a feature enhancement operation on a forehead wrinkle image provided by an embodiment of the present application;

[0029] Figure 5 It is a schematic diagram of a process of performing a feature enhancement operation on a glabellar wrinkle image provided by an embodiment of the present application;

[0030] Figure 6 It is a schematic diagram of a process of performing a feature enhancement operation on an image of fine lines around the eye provided by an embodiment of the present application;

[0031] Figure 7 It is a schematic diagram of a process of performing a feature enhancement operation on a crow's feet wrinkle image provided by an embodiment of the present application;

[0032] Figure 8 is a schematic diagram of a mask image of fine lines around the eye provided in an embodiment of the present application;

[0033] Fig. 9 is a schematic diagram of a mask image of crow's feet provided in an embodiment of the present application;

[0034] Fig.10 is a schematic diagram of a forehead wrinkle image provided by an embodiment of the present application;

[0035] Fig.11 It is a schematic diagram of a process of performing a feature extraction operation on a mask image of glabellar lines provided in an embodiment of the present application;

[0036] Fig.12 It is a schematic diagram of a process of performing a feature extraction operation on a mask image of fine lines around the eyes provided by an embodiment of the present application;

[0037] Fig.13 It is a schematic diagram of a process of performing a feature extraction operation on a mask image of crow's feet provided by an embodiment of the present application;

[0038] Fig.14 It is a schematic diagram of a wrinkle display method provided in an embodiment of the present application;

[0039] Fig.15 is a structural schematic diagram of a coarse wrinkle detection model provided in an embodiment of the present application;

[0040] Fig.16 is a detailed structural diagram of a second down-sampling module provided in an embodiment of the present application;

[0041] Fig.17 It is a structural schematic diagram of a feature extraction module provided in an embodiment of the present application;

[0042] Fig.18 is a schematic diagram of an input image and an output image of a coarse wrinkle detection model provided in an embodiment of the present application;

[0043] Fig.19 is a schematic diagram of a first coarse wrinkle image and a second coarse wrinkle image provided in an embodiment of the present application;

[0044] Fig. 20 is a schematic diagram of a second coarse wrinkle image, a fine wrinkle image, and a face wrinkle image provided by an embodiment of the present application;

[0045] Fig.21 It is a flowchart of a method for training a coarse wrinkle detection model provided in an embodiment of the present application;

[0046] Fig. 22 is a structural schematic diagram of a wrinkle detection device provided in an embodiment of the present application;

[0047] Fig.23 It is a structural schematic diagram of a wrinkle display device provided in an embodiment of the present application;

[0048] Fig.24 It is a structural schematic diagram of a training device for a coarse wrinkle detection model provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The present application is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements can also be made without departing from the concept of the present application. These all belong to the protection scope of the present application.

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. In addition, the words "first", "second", "third", etc. used herein do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0052] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in this specification and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.

[0053] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0054] Wrinkles are one of the most prominent features of the face, and their severity and distribution details can reflect the condition of the facial skin. Accurately detecting facial wrinkles helps to analyze the user's skin condition, recommend appropriate skin care products, and develop personalized medical beauty plans. Before introducing the embodiments of the present application, a facial wrinkle detection method known to the inventor of the present application is briefly introduced to facilitate subsequent understanding of the embodiments of the present application.

[0055] In some facial wrinkle detection methods, deep learning models are used to detect various types of facial wrinkles. This method can detect some coarse wrinkles on the face, such as coarse forehead wrinkles, horizontal lines on the bridge of the nose, frown lines, or nasolabial folds. However, for fine wrinkles on the face, such as fine wrinkles around the eyes, fine crow's feet, fine frown lines, or fine forehead wrinkles, due to their small and dense characteristics, they cannot be marked one by one, and it is also impossible to use a deep learning model to detect them one by one, making it difficult for the deep learning model to effectively identify fine wrinkles.

[0056] In some facial wrinkle detection methods, fine wrinkle detection is performed by filtering and denoising. For example, a Gabor filter is performed on a face area image to obtain a filtered image, and then the filtered image is denoised based on a filtering algorithm to obtain a wrinkle area image. However, this detection method has poor anti-interference ability and is prone to misdetecting facial hair or other problematic skin as wrinkles, reducing the accuracy of facial fine wrinkle detection. In addition, this detection method cannot adapt to all types of fine wrinkles, for example, it cannot detect crow's feet and fine wrinkles around the eyes on the face.

[0057] It can be seen that whether it is using deep learning models or filtering and denoising methods for fine wrinkle detection, the effect is obviously insufficient in accuracy when facing fine wrinkles that are small, dense and easily disturbed by facial hair or other problematic skin.

[0058] In response to the above problems, an embodiment of the present application provides a wrinkle detection method, by cropping a skin image according to the positions of different types of wrinkles on a person's face to obtain a local wrinkle image, performing a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image, extracting a first pixel area in the local wrinkle image, and performing an AND operation on the first pixel area and the feature enhanced image to obtain a mask image, performing a feature extraction operation on the mask image to obtain a fine wrinkle image. The present application can identify fine wrinkles on a person's face, reduce the interference of facial hair on fine wrinkle detection, and improve the accuracy and reliability of facial fine wrinkle detection.

[0059] The technical solution of the present application is described in detail below in conjunction with the accompanying drawings.

[0060] See also Figure 1 , Figure 1 This is a schematic diagram of an application environment provided by an embodiment of the present application;

[0061] like Figure 1As shown, the application environment 100 includes: a terminal 10 and a server 20, wherein the terminal 10 is connected to the server 20 via network communication, wherein the network includes a wired network and / or a wireless network. It is understandable that the network includes wireless networks such as 2G, 3G, 4G, 5G, wireless LAN, Bluetooth, etc., and may also include wired networks such as serial cables and network cables.

[0062] The terminal 10 may obtain a skin image of a human face through an image acquisition device in response to a wrinkle detection instruction triggered by a user, or the terminal 10 may also store an image library, and in response to a wrinkle detection instruction triggered by a user, select an image from the image library as a skin image of a human face. The image acquisition device includes a camera, the wrinkle detection instruction is used to instruct the device to perform wrinkle detection, the skin image includes multiple types of wrinkles, and the multiple types of wrinkles are located at different positions on the human face. The image acquisition device may be built into the terminal 10, or may be externally connected to the terminal 10, and this application does not limit this.

[0063] In some embodiments, the terminal 10 is used to execute a wrinkle detection method to detect fine wrinkles on a person's face and obtain a fine wrinkle image.

[0064] In some embodiments, the terminal 10 is further used to construct and / or train a coarse wrinkle detection model, wherein the coarse wrinkle detection model includes a first downsampling module, an encoder module, and a decoder module. For example, an image data set is obtained, a first downsampling module, an encoder module, and a decoder module are constructed, and the coarse wrinkle detection model is trained through the image data set, wherein a person skilled in the art can download multiple skin images of human faces on the terminal 10, and different skin images contain coarse wrinkles of different depths, thereby forming an image data set.

[0065] In some embodiments, the terminal 10 is also used to execute a wrinkle display method, detecting coarse wrinkles on a human face through a trained coarse wrinkle detection model to obtain a coarse wrinkle image, and fusing the coarse wrinkle image with the fine wrinkle image to obtain a facial wrinkle image, thereby displaying the facial wrinkle image on a visualization interface.

[0066] In some embodiments, the terminal 10 is used to send the wrinkle detection instruction and the skin image of the human face to the server 20, and receive the fine wrinkle image returned by the server 20, and then display the fine wrinkle image on the visual interface. The server 20 is used to execute the wrinkle detection method, detect fine wrinkles on the human face, and send the detected fine wrinkle image to the terminal 10.

[0067] In some embodiments, the server 20 is used to construct and / or train a coarse wrinkle detection model to obtain a trained coarse wrinkle detection model; or, based on the trained coarse wrinkle detection model, detect coarse wrinkles on the face to obtain a coarse wrinkle image; or, fuse the coarse wrinkle image with the fine wrinkle image to obtain a facial wrinkle image, and send the facial wrinkle image to the terminal 10.

[0068] The terminal 10 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, etc., but is not limited thereto. The server 20 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0069] Embodiment 1

[0070] In an embodiment of the present application, the wrinkle detection method and the wrinkle display method can be performed by an electronic device with computing and processing capabilities. The following describes an exemplary application of an electronic device for performing a wrinkle detection method or a wrinkle display method provided in an embodiment of the present application. It can be understood that the electronic device can perform wrinkle detection on fine wrinkles and / or coarse wrinkles, and can also train a coarse wrinkle detection model.

[0071] In some embodiments, the electronic device may be a server, such as a server deployed in the cloud. In some embodiments, the electronic device may also be various types of terminals such as a notebook computer, a desktop computer or a mobile device.

[0072] See also Figure 2 , Figure 2 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0073] like Figure 2 As shown, the electronic device 200 includes one or more processors 201 and a memory 202. Figure 2 A processor 201 is taken as an example.

[0074] The processor 201 and the memory 202 may be connected via a bus or other means. Figure 2 The example of connecting through bus is taken in the following.

[0075] The processor 201 is used to provide computing and control capabilities to control the electronic device 200 to perform corresponding tasks, for example, to control the electronic device 200 to perform the wrinkle detection method in any of the following method embodiments to identify fine wrinkles on the face of a person, reduce the interference of facial hair on fine wrinkle detection, improve the accuracy and reliability of facial fine wrinkle detection, and then be able to output a fine wrinkle image for visualization.

[0076] Alternatively, the electronic device 200 is controlled to execute the wrinkle display method in any of the following method embodiments to identify fine wrinkles and coarse wrinkles on the face, improve the accuracy and reliability of fine wrinkle and coarse wrinkle detection on the face, and then output a facial wrinkle image for visualization.

[0077] Alternatively, the electronic device 200 is controlled to execute the training method of the coarse wrinkle detection model in any of the following method embodiments to improve the generalization ability of the coarse wrinkle detection model, the accuracy of the coarse wrinkle detection model in detecting coarse wrinkles, and the stability of the coarse wrinkle detection model.

[0078] The processor 201 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0079] The memory 202 is a non-transitory computer-readable storage medium, which can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the program instructions / modules corresponding to the wrinkle detection method or wrinkle display method or the training method of the coarse wrinkle detection model in the embodiment of the present application. The processor 201 can implement the wrinkle detection method or wrinkle display method or the training method of the coarse wrinkle detection model in any of the following method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 202. Specifically, the memory 202 may include a volatile memory (VM), such as a random access memory (RAM); the memory 202 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory (Flash Memory), a hard disk (HDD) or a solid-state drive (SSD) or other non-transitory solid-state storage device; the memory 202 may also include a combination of the above-mentioned types of memory.

[0080] The memory 202 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 202 may optionally include a memory remotely arranged relative to the processor 201, and these remote memories may be connected to the processor 201 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0081] One or more modules are stored in the memory 202, and when executed by one or more processors 201, perform the wrinkle detection method or wrinkle display method or coarse wrinkle detection model training method in any of the following method embodiments, for example, perform the following described Figure 3 Alternatively, follow the steps described below. Fig.14 Perform the steps described below. Fig.21 The steps shown.

[0082] In the embodiment of the present application, the electronic device 200 may also have components such as a wired or wireless network interface, an input / output interface, etc. for input and output. The electronic device 200 may also include other components for realizing device functions, which will not be described in detail here.

[0083] The wrinkle detection method provided in the embodiment of the present application is described below in conjunction with the exemplary application and implementation of the terminal provided in the embodiment of the present application.

[0084] See also Figure 3 , Figure 3 is a flow chart of a wrinkle detection method provided in an embodiment of the present application;

[0085] The wrinkle detection method is applied to electronic devices, such as terminals and servers. Specifically, the wrinkle detection method is executed by one or at least two processors in the electronic device.

[0086] like Figure 3 As shown, the wrinkle detection method comprises:

[0087] Step S301: Acquire a skin image of a human face;

[0088] The skin image of a human face is an image reflecting skin features (such as wrinkles) of the human face area. The skin image includes various types of wrinkles, and the various types of wrinkles are located at different positions on the human face.

[0089] In some embodiments, the skin image includes multiple types of fine wrinkles, including at least one of fine wrinkles around the eyes, crow's feet, forehead wrinkles, and frown lines, and the fine wrinkles around the eyes, crow's feet, forehead wrinkles, and frown lines are located at different positions on the face of the person.

[0090] In some embodiments, step S301 includes steps S311-S312:

[0091] Step S311: obtaining a skin picture;

[0092] The skin image includes the facial area of ​​the human face, that is, the skin image of the human face is a part of the skin image.

[0093] Specifically, the electronic device includes an image acquisition device, and the skin picture is acquired through the image acquisition device, wherein the image acquisition device includes a camera.

[0094] Step S312: performing a cropping operation on the skin image to obtain a skin image of the human face.

[0095] The skin image of the human face is an image corresponding to the facial area of ​​the human face in the skin picture, and the cropping operation is used to crop the skin image of the human face from the skin picture.

[0096] In the embodiment of the present application, step S312 includes steps S3121 to S3123:

[0097] Step S3121: Identify the facial area of ​​the face in the skin image based on the face detection algorithm;

[0098] Specifically, the face region in the skin image is identified by a face detection algorithm, wherein the face detection algorithm includes but is not limited to Haar Cascade Classifier, Histogram of Oriented Gradients Face Detector, Multi-task Cascaded Convolutional Networks (MTCNN), and other algorithms for detecting faces.

[0099] Step S3122: Determine the bounding box of the face area;

[0100] Specifically, the upper left corner coordinates and the lower right corner coordinates of the bounding box of the face area are determined by the face detection algorithm. The bounding box is a rectangular box used to indicate the position of the face area, and is usually defined using the upper left corner coordinates and the lower right corner coordinates. The upper left corner coordinates are the coordinate points of the upper left corner of the bounding box, indicating the starting position of the rectangle, and the lower right corner coordinates are the coordinate points of the lower right corner of the bounding box, indicating the ending position of the rectangle.

[0101] Step S3123: Crop the skin image based on the bounding box to obtain a skin image of the face.

[0102] Specifically, the skin image of the face is cropped from the skin image according to the upper left corner coordinates and the lower right corner coordinates of the bounding box.

[0103] In an embodiment of the present application, since the skin picture obtained through a camera usually contains a background, the face area in the skin picture is identified based on a face detection algorithm, the bounding box of the face area is determined, and the skin picture is cropped based on the bounding box to obtain a skin image of the face. The present application can identify the position of the face area from the skin picture and improve the accuracy of the cropped face area.

[0104] Step S302: cropping the skin image according to the positions of different types of wrinkles on the face to obtain a local wrinkle image;

[0105] The local wrinkle image is an image cropped from the skin image of the face and contains only a certain type of wrinkles. The local wrinkle image includes one of the following: forehead wrinkle image, glabellar wrinkle image, crow's feet wrinkle image, and eye wrinkle image. The forehead wrinkle image is an image cropped from the skin image of the face and contains only the forehead wrinkles according to their positions on the face.

[0106] The glabellar line image is an image that only contains the glabellar line and is cropped from the facial skin image according to the position of the glabellar line on the human face. The crow's feet image is an image that only contains the crow's feet and is cropped from the facial skin image according to the position of the crow's feet on the human face. The fine lines around the eyes image is an image that only contains the fine lines around the eyes and is cropped from the facial skin image according to the position of the fine lines around the eyes on the human face.

[0107] Specifically, according to the positions of the forehead lines, glabellar lines, crow's feet, and fine lines around the eyes on the human face, the skin image is cropped to obtain the corresponding forehead line image, glabellar line image, crow's feet image, and fine lines around the eyes image.

[0108] In some embodiments, the local wrinkle image includes the forehead line image, and step S302 includes: cropping the skin image according to the position of the forehead line on the human face to obtain the forehead line image.

[0109] Among them, the forehead lines are wrinkles that are horizontally distributed along the forehead and are formed due to the repeated contraction and stretching of the forehead skin. The lines generally呈 horizontal lines. The position of the forehead lines on the human face is the forehead area, that is, the area between the upper parts of the two eyebrows and the hairline.

[0110] Specifically, the forehead area in the skin image is identified through a face detection algorithm, and the coordinates of the bounding box of the forehead area are determined. The forehead line image is cropped from the skin image according to the coordinates.

[0111] In some embodiments, the local wrinkle image includes the glabellar line image, and step S302 includes: cropping the skin image according to the position of the glabellar line on the human face to obtain the glabellar line image.

[0112] Among them, the glabellar lines usually appear as vertical wrinkles, which may be single vertical lines or multiple vertical lines, or may form a "Chuan" character shape (two or three parallel vertical lines). The position of the glabellar lines on the human face is the area between the two eyebrows, that is, the glabellar area.

[0113] Specifically, the glabellar area in the skin image is identified through a face detection algorithm, and the coordinates of the bounding box of the glabellar area are determined. The glabellar line image is cropped from the skin image according to the coordinates.

[0114] In some embodiments, the local wrinkle image includes the crow's feet image, and step S302 includes: cropping the skin image according to the position of the crow's feet on the human face to obtain the crow's feet image.

[0115] Among them, the crow's feet are radially distributed and extend outward from the outer corners of the eyes. They are usually short and fine lines. The position of the crow's feet on the human face is the area between the outer corners of the eyes and the temples.

[0116] Specifically, the area from the outer corner of the eye to the temple in the skin image is identified by a face detection algorithm, and the coordinates of the corresponding bounding box are determined, and the crow's feet image is cropped from the skin image according to the coordinates.

[0117] In some embodiments, the local wrinkle image includes an image of fine lines around the eyes, and step S302 includes: cropping the skin image according to the positions of the fine lines around the eyes on the face of the person to obtain the image of fine lines around the eyes.

[0118] Among them, fine lines around the eyes are mostly small linear lines. The location of fine lines around the eyes on the face is the skin area around the eyes, which includes the upper eyelid area, the lower eyelid area and the eye socket area. The upper eyelid area is the area between the eyebrows and the roots of the upper eyelashes of the eyes, the lower eyelid area is the area between the eye bags and the roots of the lower eyelashes of the eyes, and the eye socket area includes the area between the outer corner of the eye and the temple, and the area between the outer corner of the eye and the top of the cheekbone.

[0119] Specifically, the periocular skin region in the skin image is identified by a face detection algorithm, and the coordinates of a boundary box of the periocular skin region are determined, and the periocular fine lines image is cropped from the skin image according to the coordinates.

[0120] Step S303: performing feature enhancement operation on the local wrinkle image to obtain a feature enhanced image;

[0121] The feature enhancement operation is used to improve the visibility and distinguishability of features in the local wrinkle image, and the feature enhancement image is the local wrinkle image after the feature enhancement operation. The feature enhancement operation includes but is not limited to grayscale processing, binarization, etc. Grayscale processing is the process of converting a color image into a grayscale image, and binarization is the process of converting a grayscale image into an image containing only two pixel values ​​(usually black and white).

[0122] In some embodiments, when the local wrinkle image is a forehead wrinkle image, step S303 includes steps S331 to S335:

[0123] Step S331: grayscale the forehead wrinkle image to obtain a first grayscale image;

[0124] Specifically, the grayscale value of each pixel in the forehead wrinkle image is calculated by a grayscale algorithm, and the color space value (Red Green Blue values, RGB values) of each pixel in the forehead wrinkle image is replaced with the corresponding grayscale value, thereby obtaining a first grayscale image.

[0125] Among them, the first grayscale image is a grayscale image obtained after the forehead wrinkle image is grayscaled. The grayscale algorithm includes but is not limited to the averaging method, the weighted averaging method, etc. The grayscale value is a single numerical value representing the pixel brightness in the grayscale image, and the color space value includes the intensity value of the pixel in the red channel, the intensity value of the green channel, and the intensity value of the blue channel.

[0126] Step S332: binarizing the first grayscale image based on an adaptive threshold segmentation algorithm to obtain a binary image;

[0127] Among them, the adaptive threshold segmentation algorithm is used to convert the grayscale image into a binary image. The binary image is an image containing only two colors, which is composed of only black pixels and white pixels.

[0128] Specifically, the adaptive threshold segmentation algorithm calculates the threshold value corresponding to each pixel in the first grayscale image, and sets the pixel value of the pixel to the first pixel value when the pixel value of any pixel is greater than the threshold value, and sets the pixel value of the pixel to the second pixel value when the pixel value of any pixel is less than or equal to the threshold value, thereby binarizing the grayscale image to obtain a binary image. The first pixel value is 255, indicating that the pixel is white, and the second pixel value is 0, indicating that the pixel is black. The adaptive threshold segmentation algorithm includes but is not limited to the local adaptive threshold algorithm, the Gaussian weighted threshold algorithm, the mean adaptive threshold algorithm, etc.

[0129] Step S333: performing a closing operation on the binary image to obtain a closed operation image;

[0130] The closing operation is used to process the structure and noise in the binary image. The closing operation includes a dilation operation and an erosion operation. The closed operation image is a binary image obtained after the binary image in step S332 is closed.

[0131] Specifically, a dilation operation is first performed on the binary image to expand the foreground area (ie, the white area) and connect the disconnected forehead wrinkles. Then, an erosion operation is performed to shrink the foreground area and remove some unnecessary extended parts generated during the dilation process, thereby obtaining a closed operation image.

[0132] Step S334: performing contour detection on the closed operation image, and deleting contour areas satisfying the first contour condition from the detected contour areas, so as to obtain a first contour image;

[0133] Among them, the first contour image is a binary image obtained by performing contour detection on a closed operation image containing forehead wrinkles, and the first contour condition includes: the aspect ratio of the contour area is within a preset aspect ratio range, or the beveling angle of the contour area is within a first preset angle range, or the area of ​​the contour area is smaller than a preset area threshold.

[0134] The preset aspect ratio interval, the first preset angle interval, and the preset area threshold can be set by those skilled in the art according to actual conditions, and are not limited here. For example, the preset aspect ratio interval is [0.96, 1.05], the first preset angle interval is [30°, 70°], and the preset area threshold is 15 pixels squared.

[0135] Specifically, contour detection is performed on the closed operation image using a contour detection algorithm, and contour regions that meet the first contour condition are deleted from the detected contour regions, and the image obtained at this time is a first contour image. The contour detection algorithm includes but is not limited to a Laplace edge detection algorithm (Laplacian Edge Detection), a Prewitt edge detection algorithm (Prewitt Edge Detection), and the like.

[0136] In the embodiment of the present application, by deleting the contour area that meets the first contour condition from the detected contour area, the present application can remove the unreasonable contour area in the closed operation image.

[0137] Step S335: performing dilation operations and erosion operations on the first contour image in sequence in the horizontal direction to obtain a feature-enhanced image of the forehead wrinkles.

[0138] The feature-enhanced image of the forehead wrinkles is a feature-enhanced image containing the forehead wrinkles obtained by performing a feature enhancement operation on the forehead wrinkle image.

[0139] Specifically, a structural element extending in the horizontal direction is selected, and the first contour image is expanded using the structural element to expand the image contour and widen the contour, and then the image is eroded using the structural element to shrink the image contour and remove small noise, thereby obtaining a feature enhanced image containing forehead wrinkles. The structural element is used to define the shape and size of the expansion operation and the erosion operation, and the structural element includes but is not limited to a rectangular, circular or other shaped structural element.

[0140] See also Figure 4 , Figure 4 This is a schematic diagram of a process of performing a feature enhancement operation on a forehead wrinkle image provided by an embodiment of the present application;

[0141] like Figure 4 As shown, Figure 4 Part a in the figure is the forehead wrinkle image. Figure 4 Part b in is the binary image obtained by step S332. Figure 4 Part c in FIG. 1 is the feature enhanced image of the forehead wrinkles obtained by processing in step S335 .

[0142] It can be understood that the closed operation image obtained by step S333, the first contour image obtained by step S334, and the feature enhanced image of the forehead wrinkles obtained by step S335 are all images containing only two colors (black and white), that is, binary images.

[0143] In the embodiment of the present application, since the forehead wrinkles are basically continuously distributed in the horizontal direction, compared with the existing scheme that is prone to line breakage and discontinuity when binarizing the forehead wrinkles for detection, the first contour image is sequentially expanded and eroded in the horizontal direction to obtain a feature enhanced image of the forehead wrinkles. The present application can improve the horizontal continuity of the forehead wrinkles in the feature enhanced image.

[0144] In some embodiments, when the local wrinkle image is a glabellar wrinkle image, step S303 includes steps S336 to S338:

[0145] Step S336: performing color channel separation on the glabellar lines image to obtain a second grayscale image corresponding to the green channel;

[0146] Specifically, the color (Red Green Blue Alpha, RGB) channel of the glabellar lines image is separated by a separation function to obtain a red channel, a green channel, a blue channel and a transparency channel, and the grayscale image of the green channel is used as the second grayscale image. The second grayscale image is a grayscale image of the green channel obtained by separating the color channel of the glabellar lines image, and the separation function includes but is not limited to a split function, and the split function is used to separate the color channel.

[0147] Step S337: performing a filtering operation on the second grayscale image to obtain a third grayscale image;

[0148] Specifically, the second grayscale image is filtered by a filter to obtain a third grayscale image. The third grayscale image is a grayscale image obtained by filtering the second grayscale image, and the filter includes but is not limited to a Frangi filter. The Frangi filter is a multi-scale vascular enhancement filter used for image processing, which enhances the vascular structure in the image by calculating the local intensity gradient of the image.

[0149] For example: determine the scale parameter (sigmas), curvature sensitivity parameter (alpha), intensity response parameter (beta), and curvature ratio parameter (gamma) in the Frangi filter, calculate the gradient and Hessian matrix (Hessian matrix) of the second grayscale image at each scale according to the scale parameter, use the curvature sensitivity parameter to calculate the principal curvature of the second grayscale image, use the intensity response parameter to calculate the response of the second grayscale image to the structural intensity, use the curvature ratio parameter to adjust the curvature ratio, and then combine the filtering results of different scales to obtain a third grayscale image. Among them, the scale parameter, curvature sensitivity parameter, intensity response parameter, and curvature ratio parameter can be set by those skilled in the art according to actual conditions, and are not limited here. For example, the scale parameter is (0, 1, 2), the curvature sensitivity parameter is 0.01, the intensity response parameter is 1.5, and the curvature ratio parameter is 0.01.

[0150] Step S338: performing threshold processing on the third grayscale image to obtain a feature-enhanced image of the glabellar lines.

[0151] The feature-enhanced image of the glabellar lines is a feature-enhanced image containing the glabellar lines obtained by performing a feature enhancement operation on the glabellar lines image.

[0152] Specifically, when the pixel value of any pixel in the third grayscale image is greater than a preset threshold, the pixel value of the pixel is set to a first pixel value, and when the pixel value of any pixel is less than or equal to the preset threshold, the pixel value of the pixel is set to a second pixel value, thereby binarizing the third grayscale image to obtain a feature-enhanced image containing glabellar lines. The first pixel value is 255, indicating that the pixel is white, and the second pixel value is 0, indicating that the pixel is black. The preset threshold can be set by those skilled in the art according to actual conditions, and is not limited here. By way of example, the preset threshold is 0.3.

[0153] See also Figure 5 , Figure 5 It is a schematic diagram of a process of performing a feature enhancement operation on a glabellar wrinkle image provided by an embodiment of the present application;

[0154] like Figure 5 As shown, Figure 5 Part a in the figure is the image of the frown lines. Figure 5 Part b in FIG. 3 is the third grayscale image obtained by processing in step S337.

[0155] In some embodiments, when the local wrinkle image is a crow's feet image or an eye wrinkle image, step S303 includes steps S339 to S341:

[0156] Step S339: grayscale the crow's feet image or the eye wrinkle image to obtain a first grayscale image;

[0157] Specifically, when the local wrinkle image is a crow's feet image, the crow's feet image is grayed to obtain a first gray image corresponding to the crow's feet image, wherein the first gray image corresponding to the crow's feet image is a first gray image that only includes crow's feet.

[0158] Alternatively, when the local wrinkle image is an image of fine wrinkles around the eye, the image of fine wrinkles around the eye is grayed to obtain a first gray image corresponding to the image of fine wrinkles around the eye, wherein the first gray image corresponding to the image of fine wrinkles around the eye is a first gray image containing only fine wrinkles around the eye. The specific implementation of this step is similar to the specific implementation of step S331, and will not be repeated here.

[0159] Step S340: binarizing the first grayscale image based on an adaptive threshold segmentation algorithm to obtain a binary image;

[0160] Specifically, when the local wrinkle image is a crow's feet image, the first grayscale image corresponding to the crow's feet image is binarized to obtain a binary image corresponding to the crow's feet image, wherein the binary image corresponding to the crow's feet image is a binary image containing only crow's feet.

[0161] Alternatively, when the local wrinkle image is an image of fine wrinkles around the eyes, the first grayscale image corresponding to the image of fine wrinkles around the eyes is binarized to obtain a binary image corresponding to the image of fine wrinkles around the eyes, wherein the binary image corresponding to the image of fine wrinkles around the eyes is a binary image containing only fine wrinkles around the eyes. The specific implementation of this step is similar to the specific implementation of step S332, and will not be repeated here.

[0162] Step S341: performing a closing operation on the binary image to obtain a feature-enhanced image of crow's feet or fine lines around the eyes.

[0163] Specifically, when the local wrinkle image is a crow's feet image, a dilation operation is first performed on the binary image corresponding to the crow's feet image, and then an erosion operation is performed to obtain a feature enhanced image of the crow's feet, wherein the feature enhanced image of the crow's feet is a feature enhanced image that only contains crow's feet.

[0164] Alternatively, when the local wrinkle image is an image of fine lines around the eyes, a dilation operation is first performed on the binary image corresponding to the image of fine lines around the eyes, and then an erosion operation is performed to obtain a feature enhanced image of the fine lines around the eyes, wherein the feature enhanced image of the fine lines around the eyes is a feature enhanced image that only contains fine lines around the eyes.

[0165] See also Figure 6 , Figure 6 It is a schematic diagram of a process of performing a feature enhancement operation on an image of fine lines around the eye provided by an embodiment of the present application;

[0166] like Figure 6 As shown, Figure 6 Part a in the figure is an image of fine lines around the eyes. Figure 6 Part b in FIG. 1 is a binary image corresponding to the image of fine lines around the eyes obtained by processing in step S340 .

[0167] See also Figure 7 , Figure 7 It is a schematic diagram of a process of performing a feature enhancement operation on a crow's feet wrinkle image provided by an embodiment of the present application;

[0168] like Figure 7 As shown, Figure 7 Part a in the figure is the crow’s feet image. Figure 7 Part b in FIG. 1 is a binary image corresponding to the crow's feet image obtained by processing in step S340 .

[0169] Step S304: extracting a first pixel region in the local wrinkle image, and performing an AND operation on the first pixel region and the feature enhancement image to obtain a mask image;

[0170] The local wrinkle image includes a first pixel region, which is a non-black pixel region in the local wrinkle image, and the mask image is an image obtained by performing an AND operation on the first pixel region and the feature enhancement image.

[0171] Specifically, when the local wrinkle image is an image of fine wrinkles around the eyes, crow's feet, forehead wrinkles or glabellar wrinkles, a non-black pixel area in the local wrinkle image is extracted, and a pixel-by-pixel logical AND operation is performed on the pixel area and the feature enhancement image, and the obtained image is used as a mask image corresponding to the local wrinkle image, and the mask image is a mask image containing fine wrinkles of this type. The mask image is an image containing only two colors (black and white), that is, a binary image.

[0172] See also Figure 8 , Figure 8 is a schematic diagram of a mask image of fine lines around the eye provided in an embodiment of the present application;

[0173] like Figure 8 As shown, the mask image only contains fine wrinkles around the eyes of the human face. Figure 8 The mask image in Figure 6 Part b in the above is obtained by executing steps S341 and S304.

[0174] See also Fig. 9 , Fig. 9 is a schematic diagram of a mask image of crow's feet provided in an embodiment of the present application;

[0175] like Fig. 9 As shown, the mask image only contains the crow's feet on the face. Fig. 9 The mask image in Figure 7 Part b in the above is obtained by executing steps S341 and S304.

[0176] In an embodiment of the present application, by extracting a first pixel area in a local wrinkle image and performing an AND operation on the first pixel area and the feature enhanced image to obtain a corresponding mask image, the present application can remove the lines representing hair in the feature enhanced image, reduce the interference of facial hair on fine wrinkle detection, and improve the accuracy and reliability of facial fine wrinkle detection.

[0177] Step S305: performing feature extraction operation on the mask image to obtain a fine wrinkle image.

[0178] The feature extraction operation is used to extract fine wrinkles in the mask image. The fine wrinkle image is an image extracted from the mask image by the feature extraction operation. The fine wrinkle image includes at least one of a forehead wrinkle image, a glabellar wrinkle image, an eye wrinkle image, and a crow's feet wrinkle image. The feature extraction operation includes but is not limited to contour extraction, contour detection, and thinning operations.

[0179] In some embodiments, when the mask image is a mask image of forehead wrinkles, step S305 includes: performing a thinning operation on the mask image to obtain a wrinkle image of the forehead wrinkles.

[0180] Specifically, a thinning operation is performed on the mask image containing the forehead wrinkles through a thinning algorithm to reduce the width of the forehead wrinkles in the mask image, thereby obtaining a wrinkle image of the forehead wrinkles. The wrinkle image of the forehead wrinkles is a binary image containing only the forehead wrinkles, and the thinning algorithm includes but is not limited to a thinning algorithm such as a skeletonization algorithm, a Hilditch thinning algorithm, or a Fridman thinning algorithm.

[0181] See also Fig.10 , Fig.10 is a schematic diagram of a forehead wrinkle image provided by an embodiment of the present application;

[0182] like Fig.10 As shown, the forehead wrinkle image only contains the forehead wrinkles on the face of the person. Fig.10 The wrinkle image of the forehead wrinkle is obtained by Figure 4 Part c in the above is obtained by executing steps S304 and S305.

[0183] In some embodiments, when the mask image is a mask image of glabellar lines, step S305 includes steps S351 and S352:

[0184] Step S351: extracting contours of the mask image of the glabellar lines, and deleting contour areas in the mask image that meet the second contour condition, so as to obtain a second contour image;

[0185] Among them, the contour extraction is used to delete the contour area that meets the second contour condition in the mask image of the glabellar lines. The second contour image is a binary image obtained by contour extraction of the mask image of the glabellar lines. The second contour condition includes: the aspect ratio of the contour area is within a preset aspect ratio interval, or the bevel angle of the contour area is within a second preset angle interval, or the area of ​​the contour area is less than a preset area threshold. The second preset angle interval can be set by those skilled in the art according to actual conditions and is not limited here. Exemplarily, the second preset angle interval is [0°, 50°].

[0186] Specifically, all contour regions in the mask image of the glabellar lines are traversed by a contour extraction algorithm, and contour regions satisfying the second contour condition are deleted, and the image obtained at this time is the second contour image. The contour extraction algorithm includes but is not limited to a contour-based image segmentation algorithm, a watershed algorithm, and the like.

[0187] In the embodiment of the present application, by deleting the contour area that meets the second contour condition in the mask image of the glabellar lines, the present application can remove the unreasonable contour area in the mask image of the glabellar lines.

[0188] Step S352: performing a thinning operation on the second contour image to obtain a wrinkle image of the glabellar lines.

[0189] Specifically, the second contour image including the glabellar lines is thinned by a thinning algorithm to reduce the width of the glabellar lines in the second contour image, thereby obtaining a wrinkle image of the glabellar lines, wherein the wrinkle image of the glabellar lines is a binary image including only the glabellar lines.

[0190] See also Fig.11 , Fig.11 It is a schematic diagram of a process of performing a feature extraction operation on a mask image of glabellar lines provided in an embodiment of the present application;

[0191] like Fig.11 As shown, Fig.11 Part a in is the second contour image. Fig.11 Part b in the figure is the wrinkle image of the glabellar lines.

[0192] In some embodiments, when the mask image is a mask image of fine lines around the eyes, step S305 includes steps S353 to S356:

[0193] Step S353: performing contour detection on the mask image of fine lines around the eyes, and deleting contour areas that meet the third contour condition from the detected contour areas to obtain a third contour image;

[0194] The third contour image is a binary image obtained after contour detection of the mask image of the fine lines around the eyes, and the third contour condition includes: the bevel angle of the contour area is within a third preset angle interval, or the area of ​​the contour area is less than a preset area threshold. The third preset angle interval can be set by those skilled in the art according to actual conditions and is not limited here. For example, the third preset angle interval is [-20°, 20°].

[0195] Specifically, contour detection is performed on the mask image of fine lines around the eyes using a contour detection algorithm, and contour areas that meet the third contour condition are deleted from the detected contour areas. The image obtained at this time is a third contour image.

[0196] In the embodiment of the present application, by deleting the contour area that meets the third contour condition in the contour area, the present application can remove the unreasonable contour area in the mask image of fine lines around the eyes.

[0197] Step S354: performing a thinning operation on the third contour image to obtain a thinned image;

[0198] Specifically, the third contour image of the periorbital fine lines is thinned by a thinning algorithm to reduce the width of the periorbital fine lines in the third contour image, thereby obtaining a thinned image, wherein the thinned image is a binary image obtained by thinning the third contour image.

[0199] Step S355: traverse each independent contour in the thinned image, and connect the highest point and the lowest point of each independent contour with a straight line to obtain a one-to-one corresponding connecting line segment for each independent contour;

[0200] Among them, the independent contour is also called the connected area, which is an area that is not connected to other contours; the connecting line segment is a line segment connecting the highest point and the lowest point in an independent contour.

[0201] Specifically, each independent contour in the refined image is traversed, and for any independent contour, the highest point and the lowest point of the independent contour are obtained, and the two points are connected with a straight line to obtain a connecting line segment, thereby obtaining a one-to-one corresponding connecting line segment for each independent contour.

[0202] Step S356: superimposing a plurality of connecting line segments to obtain a wrinkle image of fine lines around the eyes.

[0203] Specifically, after obtaining the connecting line segments corresponding to each independent contour, all the connecting line segments are superimposed to obtain a wrinkle image of periorbital fine lines, wherein the periorbital fine lines image is a binary image containing only periorbital fine lines.

[0204] See also Fig.12 , Fig.12 It is a schematic diagram of a process of performing a feature extraction operation on a mask image of fine lines around the eyes provided by an embodiment of the present application;

[0205] like Fig.12 As shown, Fig.12 Part a in is the third contour image. Fig.12 Part b in is the refined image. Fig.12 Part c in the figure is an image of fine lines around the eyes.

[0206] In the embodiment of the present application, since the wrinkles below the corners of the eyes in the fine lines around the eyes are distributed in a diagonal pattern, there are many burrs in the third contour image. The refined image is obtained by performing a refinement operation on the third contour image, and each independent contour in the refined image is traversed. The highest point and the lowest point of each independent contour are connected by a straight line in each independent contour. This straight line connection method can not only approximately depict the contours of the fine lines, but also effectively remove the burrs in the image, thereby obtaining a smoother and more accurate representation of the fine lines.

[0207] In some embodiments, when the mask image is a mask image of crow's feet, step S305 includes steps S357 to S363:

[0208] Step S357: performing contour detection on the mask image of crow's feet wrinkles, and sorting the detected contours in descending order of their areas;

[0209] Specifically, contour detection is performed on the mask image of crow's feet by a contour detection algorithm. For each detected contour, the area of ​​the contour is calculated using a contour area calculation function, and the detected contours are sorted in descending order of the contour area. For example: the contours and their areas are stored in a list, and the order of the contours in the list is from large to small in terms of the contour area, that is, the first element is the contour with the largest area, and the last one is the contour with the smallest area. Among them, the contour area calculation function includes but is not limited to the contourArea function, which is used to calculate the area of ​​the contour in a two-dimensional image. The contour can be a closed curve of any shape, such as a rectangle, a circle, a polygon, etc.

[0210] Step S358: Obtaining a preset number of contours according to the arrangement order of the contours;

[0211] Specifically, according to the arrangement order of the contours, starting from the contour with the first arrangement order, a preset number of contours are obtained, so as to obtain a preset number of contours with larger areas. Among them, the preset number is the number of contours obtained according to the arrangement order of the contours, and the preset number can be set by those skilled in the art according to actual conditions, and is not limited here. Exemplarily, the preset number is 1 / 5 of the number of all contours detected in step S357, and the contour with larger area is a contour with an area greater than 20 pixels squared.

[0212] Step S359: determining the coordinates of the left boundary point and the right boundary point of each contour;

[0213] Specifically, for any contour obtained in step S358, all points in the contour are traversed, the point with the smallest horizontal coordinate value is taken as the left boundary point, the point with the largest horizontal coordinate value is taken as the right boundary point, and the vertical coordinate value of the left boundary point and the vertical coordinate value of the right boundary point are obtained, so as to determine the coordinates of the left boundary point and the right boundary point of each contour. The coordinates include the horizontal coordinate value and the vertical coordinate value.

[0214] Step S360: determining the curve state of the contour based on the coordinates of the left boundary point and the coordinates of the right boundary point;

[0215] The curve state includes an upward state or a downward state. When the ordinate value of the left boundary point is less than the ordinate value of the right boundary point, the curve state of the contour is determined to be an upward state; when the ordinate value of the left boundary point is greater than the ordinate value of the right boundary point, the curve state of the contour is determined to be a downward state.

[0216] Step S361: based on the curve state, determine the coordinates of the midpoint of the contour;

[0217] Specifically, when the curve state is in an upward state, the ordinate value of the midpoint is set to be less than the median value of the ordinate; when the curve state is in a downward state, the ordinate value of the midpoint is set to be greater than the median value of the ordinate. The median value of the ordinate is the average value of the ordinate values ​​of the left boundary point and the right boundary point.

[0218] Step S362: fitting a curve corresponding to each contour based on the coordinates of the left boundary point, the coordinates of the middle point and the coordinates of the right boundary point of each contour;

[0219] Specifically, according to the coordinates of the left boundary point, the coordinates of the midpoint and the coordinates of the right boundary point of each contour, the contour is fitted by a third-order Bezier curve, so as to obtain a curve corresponding to each contour. Among them, the curve passes through the left boundary point, the midpoint and the right boundary point of the contour, and the contour fitting by the third-order Bezier curve is a prior art, which will not be repeated here.

[0220] Step S363: superimposing a plurality of curves to obtain a wrinkle image of crow's feet.

[0221] Specifically, after obtaining the curves corresponding to each contour, all the curves are superimposed to obtain the wrinkle image of crow's feet, wherein the wrinkle image of crow's feet is a binary image containing only crow's feet.

[0222] See also Fig.13 , Fig.13 It is a schematic diagram of a process of performing a feature extraction operation on a mask image of crow's feet provided by an embodiment of the present application;

[0223] like Fig.13 As shown, Fig.13 Part a in FIG. 1 is a schematic diagram of a contour with a larger area in step S357. Fig.13 Part b in FIG. 3 is a line diagram of the left boundary point, the middle point and the right boundary point of each contour in step S362. Fig.13 Part c in FIG. 1 is a wrinkle image of crow's feet. Exemplarily, a contour with a larger area is a contour with an area greater than 20 pixels squared.

[0224] In the embodiment of the present application, by obtaining a preset number of contours with larger areas according to the arrangement order of the contours, and determining the coordinates of the left boundary point, the coordinates of the midpoint, and the coordinates of the right boundary point of each contour, and combining the contour fitting with the third-order Bezier curve, the present application can make the curve in the wrinkle image of the crow's feet a smooth curve without burrs that fits the real crow's feet. And by changing the specific value of the preset number, for example: by increasing the number of contours obtained, more crow's feet can be presented in the crow's feet image.

[0225] In an embodiment of the present application, a wrinkle detection method is provided, which includes: acquiring a skin image of a human face, the skin image including multiple types of wrinkles, and the multiple types of wrinkles are located at different positions on the human face; cropping the skin image according to the positions of different types of wrinkles on the human face to obtain a local wrinkle image, the local wrinkle image including a first pixel area; performing a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image; extracting a first pixel area in the local wrinkle image, and performing an AND operation on the first pixel area and the feature enhanced image to obtain a mask image, wherein the first pixel area is a non-black pixel area in the local wrinkle image; performing a feature extraction operation on the mask image to obtain a fine wrinkle image.

[0226] By cropping a skin image according to the positions of different types of wrinkles on a human face to obtain a local wrinkle image, performing a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image, extracting a first pixel area in the local wrinkle image, performing an AND operation on the first pixel area and the feature enhanced image to obtain a mask image, and performing a feature extraction operation on the mask image to obtain a fine wrinkle image, the present application can identify fine wrinkles on a human face, reduce interference of facial hair on fine wrinkle detection, and improve the accuracy and reliability of facial fine wrinkle detection.

[0227] Embodiment 2

[0228] See also Fig.14 , Fig.14 It is a schematic diagram of a wrinkle display method provided in an embodiment of the present application;

[0229] The wrinkle display method is applied to electronic devices, such as terminals and servers. Specifically, the wrinkle display method is executed by one or at least two processors in the electronic device.

[0230] like Fig.14 As shown, the wrinkle display method comprises:

[0231] Step S1401: Acquire a skin image of a human face;

[0232] The skin image of the face is an image reflecting the skin features (such as wrinkles) of the face area of ​​the face, and the skin image includes coarse wrinkles and fine wrinkles. Fine wrinkles include at least one of fine wrinkles around the eyes, crow's feet, forehead wrinkles, and frown lines, and the fine wrinkles around the eyes, crow's feet, forehead wrinkles, and frown lines are located at different positions on the face of the human face. Coarse wrinkles include at least one of forehead wrinkles, frown lines, horizontal lines on the bridge of the nose, and nasolabial folds.

[0233] It can be understood that the forehead wrinkles among coarse wrinkles are coarse forehead wrinkles, that is, forehead wrinkles with a larger width or a deeper depth, for example: forehead wrinkles with a width of more than 2 mm or a depth of more than 1 mm; the forehead wrinkles among fine wrinkles are fine forehead wrinkles, that is, forehead wrinkles with a smaller width or a shallower depth, for example: forehead wrinkles with a width of less than 2 mm or a depth of less than 1 mm.

[0234] Specifically, this step is similar to step S301 and will not be described in detail here.

[0235] Step S1402: extracting coarse wrinkles in the skin image based on the coarse wrinkle detection model to obtain a coarse wrinkle image;

[0236] The coarse wrinkle image includes a first coarse wrinkle image and a second coarse wrinkle image. The coarse wrinkle detection model is a lightweight semantic segmentation model. The first coarse wrinkle image is a binary image containing coarse wrinkles output by the coarse wrinkle detection model. The second coarse wrinkle image is a binary image containing coarse wrinkles obtained by performing a refinement operation on the first coarse wrinkle image.

[0237] Specifically, the coarse wrinkle detection model takes a human face skin image as input, extracts coarse wrinkles by semantically segmenting the human face skin image, and outputs a first coarse wrinkle image. Then, the first coarse wrinkle image is thinned to obtain a second coarse wrinkle image.

[0238] See also Fig.15 , Fig.15 is a structural schematic diagram of a coarse wrinkle detection model provided in an embodiment of the present application;

[0239] like Fig.15 As shown, the coarse wrinkle detection model includes a first downsampling module, a first encoder, a second encoder, a third encoder, a first decoder and a second decoder. The first downsampling module, the first encoder, the second encoder, the third encoder, the first decoder and the second decoder are connected in sequence, the feature map output by the first downsampling module and the feature map output by the first decoder are spliced ​​as the input of the second decoder, and the feature map output by the second encoder and the feature map output by the third decoder are spliced ​​as the input of the first decoder.

[0240] Among them, the first downsampling module is used to compress the skin image of the human face, the first encoder, the second encoder and the third encoder are used to extract the coarse wrinkle features, and the first decoder and the second decoder are used to perform wrinkle classification operations pixel by pixel to determine whether any pixel point belongs to the coarse wrinkle area, that is, to determine whether the pixel point is located in the coarse wrinkle.

[0241] In some embodiments, the coarse wrinkle detection model may use other structures to detect coarse wrinkles in a facial skin image, and this application does not impose any limitation on this.

[0242] In the embodiment of the present application, step S1402 includes steps S1421 to S1429:

[0243] Step S1421: Based on the first down-sampling module, compress the skin image of the face to obtain a compressed image;

[0244] Specifically, the first downsampling module takes the skin image of the face as input, compresses the skin image of the face, and outputs a compressed image. The size of the skin image of the face is H*W*3, H represents the height of the skin image of the face, that is, the number of vertical pixels of the image, W represents the width of the skin image of the face, that is, the number of horizontal pixels of the image, 3 represents the number of channels of the skin image of the face, and the compressed image is a feature map obtained by compressing the skin image of the face, and the size of the compressed image is (H / 2)*(W / 2).

[0245] Among them, the first down-sampling module includes a maximum pooling layer, a convolutional layer and a first adding unit. The first adding unit is respectively connected to the maximum pooling layer and the convolutional layer. The maximum pooling layer and the convolutional layer process the skin image of the face input into the first down-sampling module in parallel. The first adding unit is used to add the feature map output by the maximum pooling layer and the feature map output by the convolutional layer.

[0246] The maximum pooling layer is used to perform a maximum pooling operation on the skin image of the face using a pooling window of size 2*2, and select the maximum element value in each 2*2 area, thereby outputting a feature map of size (H / 2)*(W / 2). This convolution layer is the first convolution layer, which is used to perform a convolution operation on the skin image of the face using a convolution kernel of size 3*3, step size 2, and number 13, and output a feature map of size (H / 2)*(W / 2). The first addition unit is used to add the feature map output by the maximum pooling layer and the feature map output by the first convolution layer element by element, and output a compressed image of size (H / 2)*(W / 2).

[0247] Step S1422: Based on the first encoder, extract the first feature of the compressed image to obtain a first encoding feature map;

[0248] Specifically, the first encoder takes the compressed image as input, extracts the first feature of the compressed image, and outputs a first encoded feature map. The first feature is a detail, low-level coarse wrinkle feature, such as the starting point, the end point, and the thickness of the coarse wrinkle, etc. The first encoded feature map is a feature map output by the first encoder with a size of (H / 4)*(W / 4).

[0249] The first encoder includes a second downsampling module and four feature extraction modules connected in sequence. The second downsampling module is used to compress the compressed image and reduce the resolution of the compressed image to (H / 4)*(W / 4). The feature extraction module is used to extract coarse wrinkle features.

[0250] The second downsampling module includes a first unit, a second unit and a second adding unit, the second adding unit is respectively connected to the first unit and the second unit, and the first unit and the second unit process the compressed image input to the second downsampling module in parallel. The first unit includes a maximum pooling layer and a padding unit connected in sequence, the padding unit is used to perform a padding operation, the second unit includes three convolutional layers connected in sequence and an activation layer, the three convolutional layers connected in sequence are a second convolutional layer, a third convolutional layer, and a fourth convolutional layer, the activation layer is a first activation layer, and the second adding unit is used to add the feature map output by the first unit to the feature map output by the second unit.

[0251] See also Fig.16 , Fig.16 is a detailed structural diagram of a second down-sampling module provided in an embodiment of the present application;

[0252] like Fig.16 As shown, the second downsampling module includes two branches and a second adding unit, the left branch includes a maximum pooling layer and a padding unit connected in sequence, the right branch includes a second convolutional layer, a third convolutional layer, a fourth convolutional layer and a first activation layer connected in sequence, and the output of the left branch and the output of the right branch are used together as the input of the second adding unit.

[0253] Among them, when the image size input to the second downsampling module is h*w*c, h represents the height of the image, that is, the number of vertical pixels of the image, w represents the width of the image, that is, the number of horizontal pixels of the image, and c represents the number of channels of the image:

[0254] The maximum pooling layer uses a pooling window of size 2*2 to perform a maximum pooling operation (MaxPooling) on ​​the image input to the second downsampling module, selects the largest element value in each 2*2 area, and outputs a feature map of size (h / 2)*(w / 2)*c; the padding unit is used to splice dc all-zero feature maps of size (h / 2)*(w / 2) on the feature map output by the maximum pooling layer, thereby completing the padding operation (padding operation) and expanding the number of channels from c to d.

[0255] The second convolutional layer is used to reduce the dimension of the image input to the second downsampling module by using a convolution kernel of size 1*1 and number c / 4, and output a feature map of size h*w*(c / 4); the third convolutional layer is used to extract features from the feature map output by the first convolutional layer by using a convolution kernel of size 3*3, step size 2 and number (c / 4), and output a feature map of size (h / 2)*(w / 2)*(c / 4); the fourth convolutional layer is used to increase the dimension of the feature map output by the third convolutional layer by using a convolution kernel of size 1*1 and number d, and output a feature map of size (h / 2)*(w / 2)*d; the first activation layer is used to perform a nonlinear activation operation (Rectified Linear Unit, ReLU) on the feature map output by the fourth convolutional layer to increase the nonlinearity of the network and help the network learn more complex features. The second adding unit is used to add the feature map output by the filling unit and the feature map output by the first activation layer element by element, and output a feature map with a size of (h / 2)*(w / 2)*d.

[0256] In the embodiment of the present application, the sizes of h, w, c, and d can be set by those skilled in the art according to the size of the skin image of the face, and are not limited here. For example, c is 3, and d=c*2.

[0257] In an embodiment of the present application, downsampling is completed by performing maximum pooling and convolution operations on the input in parallel in the maximum pooling layer and the convolution layer in the first downsampling module and the second downsampling module. Compared with the existing downsampling scheme that only uses the maximum pooling operation, the present application can reduce information loss.

[0258] In an embodiment of the present application, the feature extraction module includes three sequentially connected convolutional layers, an activation layer and a third addition unit, the three sequentially connected convolutional layers are the fifth convolutional layer, the sixth convolutional layer, and the seventh convolutional layer, the activation layer is the second activation layer, and the third addition unit is used to add the feature map output by the activation layer in the feature extraction module to the feature map input to the feature extraction module.

[0259] See also Fig.17 , Fig.17 It is a structural schematic diagram of a feature extraction module provided in an embodiment of the present application;

[0260] like Fig.17 As shown, the feature extraction module includes a fifth convolutional layer, a sixth convolutional layer, a seventh convolutional layer, a second activation layer, and a third addition unit. The fifth convolutional layer, the sixth convolutional layer, and the seventh convolutional layer are connected in sequence, and the output of the second activation layer and the input of the feature extraction module are used together as the input of the third addition unit.

[0261] When the feature map size of the input feature extraction module is h*w*c, h represents the height of the image, w represents the width of the image, and c represents the number of channels of the image:

[0262] The fifth convolutional layer is used to reduce the dimension of the feature map of the input feature extraction module by using a convolution kernel of size 1*1 and number c / 4, and output a feature map of size h*w*(c / 4); the sixth convolutional layer is used to extract features from the feature map output by the fifth convolutional layer by using a convolution kernel of size 3*3, step size 1 and number (c / 4), and output a feature map of size h*w*(c / 4); the seventh convolutional layer is used to increase the dimension of the feature map output by the sixth convolutional layer by using a convolution kernel of size 1*1 and number c, and output a feature map of size h*w*c; the second activation layer is used to perform a nonlinear activation operation (Rectified Linear Unit, ReLU) on the feature map output by the seventh convolutional layer to increase the nonlinearity of the network and help the network learn more complex features. The third addition unit is used to add the feature map of the input feature extraction module and the feature map output by the second activation layer element by element, and output a feature map of size h*w*c.

[0263] Step S1423: Based on the second encoder, extract the second feature of the first coding feature map to obtain a second coding feature map;

[0264] Specifically, the second encoder takes the first encoding feature map as input, extracts the second feature from the first encoding feature map, and outputs the second encoding feature map. The first feature is different from the second feature, and the second feature is a high-level, abstract semantic feature, such as the semantic meaning of the area where the coarse wrinkles are located, the relationship between the coarse wrinkles and other facial features, etc. The second encoding feature map is a feature map output by the second encoder with a size of (H / 8)*(W / 8).

[0265] Among them, the second encoder includes six feature extraction modules connected in sequence, wherein the convolution methods adopted by the six feature extraction modules are standard convolution, hole convolution, asymmetric convolution, standard convolution, hole convolution, and asymmetric convolution in sequence.

[0266] Specifically, the six sequentially connected feature extraction modules include a first feature extraction module, a second feature extraction module, a third feature extraction module, a fourth feature extraction module, a fifth feature extraction module, and a sixth feature extraction module. The structures of the six feature extraction modules are similar to Fig.16The structures of the feature extraction modules shown are the same, except that: the number of convolution kernels used in the seventh convolution layer of the six feature extraction modules is d, d=c*2; the sixth convolution layer in the first feature extraction module and the fourth feature extraction module adopts standard convolution operation; the sixth convolution layer in the second feature extraction module and the fifth feature extraction module adopts hole convolution; the sixth convolution layer in the third feature extraction module and the sixth feature extraction module adopts asymmetric convolution (i.e., a convolution kernel of size 5*1 and a convolution kernel of size 1*5 are serially convolved), thereby outputting a feature map with a resolution of (H / 8)*(W / 8), and the number of channels is doubled to facilitate richer feature extraction.

[0267] In the embodiment of the present application, by using hole convolution in the second feature extraction module and the sixth convolution layer in the fourth feature extraction module, the receptive field of the feature map can be increased; by using asymmetric convolution in the third feature extraction module and the sixth convolution layer in the sixth feature extraction module, both the receptive field can be increased and the diversity of features can be increased.

[0268] Step S1424: Based on the third encoder, extract the second feature of the second encoding feature map to obtain a third encoding feature map;

[0269] Specifically, the third encoder takes the second encoding feature map as input, extracts the second feature from the second encoding feature map, and outputs a third encoding feature map. The third encoding feature map is a feature map output by the third encoder with a size of (H / 8)*(W / 8).

[0270] Among them, the second encoder has the same structure as the third encoder. The second encoder and the third encoder both include six feature extraction modules connected in sequence. The convolution methods used by the six feature extraction modules are standard convolution, hole convolution, asymmetric convolution, standard convolution, hole convolution, and asymmetric convolution.

[0271] The difference from the second encoder is that the number of convolution kernels used in the seventh convolution layer of the six feature extraction modules of the third encoder is c, so the size and number of channels of the third encoded feature map output by the third encoder are the same as the second encoded feature map input to the third encoder. Figure 1 To.

[0272] In an embodiment of the present application, since the resolution of the feature map input to the first encoder is relatively large, the first encoder extracts more detailed, lower-level first features, and the second encoder and the third encoder extract higher-level, more abstract second features. The present application can improve the richness of the extracted features.

[0273] Step S1425: splicing the second coding feature map and the third coding feature map to obtain a spliced ​​feature map;

[0274] Among them, the spliced ​​feature map is a feature map obtained by splicing the second encoding feature map and the third encoding feature map.

[0275] Step S1426: Based on the first decoder, performing a wrinkle classification operation at a first resolution on the spliced ​​feature map to obtain a first decoded feature map;

[0276] Specifically, the first decoder takes the spliced ​​feature map as input, performs a wrinkle classification operation at a first resolution on the pixels in the spliced ​​feature map to determine whether any pixel belongs to a coarse wrinkle area, that is, to determine whether the pixel is located in a coarse wrinkle, thereby outputting a first decoded feature map. The first decoded feature map is a feature map of size (H / 4)*(W / 4) output by the first decoder, and the first resolution is the resolution size of the feature map output by the first decoder. The first resolution can be set by those skilled in the art according to actual conditions, and is not limited here. For example, the first resolution is (H / 4)*(W / 4).

[0277] The first decoder includes an upsampling layer and three feature extraction modules connected in sequence. The upsampling layer is used to upsample the spliced ​​feature map and expand the resolution of the spliced ​​feature map to (H / 4)*(W / 4). The three feature extraction modules include the seventh feature extraction module, the eighth feature extraction module and the ninth feature extraction module. The structures of these three feature extraction modules are similar to Fig.16 The structures of the feature extraction modules shown are the same. The seventh feature extraction module is used to fuse features and reduce the number of channels by half. The eighth feature extraction module and the ninth feature extraction module are used to restore the details of the feature map, thereby outputting a first decoding feature map of size (H / 4)*(W / 4).

[0278] Step S1427: concatenating the compressed image with the first decoding feature map to obtain a second decoding feature map;

[0279] The second decoding feature map is a feature map obtained by concatenating the compressed image and the first decoding feature map.

[0280] Step S1428: Based on the second decoder, performing a wrinkle classification operation at a second resolution on the second decoded feature map to obtain a first coarse wrinkle image;

[0281] Specifically, the second decoder takes the second decoded feature map as input, performs a wrinkle classification operation at a second resolution on the pixels in the second decoded feature map, to determine whether any pixel belongs to a coarse wrinkle region, that is, to determine whether the pixel is located in a coarse wrinkle, thereby outputting a first coarse wrinkle image. The first coarse wrinkle image is a feature map of size H*W*1 output by the second decoder, the second resolution is greater than the first resolution, the second resolution is the resolution of a skin image of a human face, and the second resolution can be set by a person skilled in the art according to the resolution of a skin image of a human face, and is not limited here.

[0282] The second decoder includes an upsampling layer, two feature extraction modules, and a transposed convolution layer connected in sequence. The upsampling layer is used to upsample the second decoding feature map and expand the resolution of the second decoding feature map to (H / 2)*(W / 2). The two feature extraction modules include the tenth feature extraction module and the eleventh feature extraction module. The structures of these two feature extraction modules are similar to Fig.16 The structures of the feature extraction modules shown are the same. The tenth feature extraction module is used to fuse features and reduce the number of channels by half, and the eleventh feature extraction module is used to restore the details of the feature map, thereby outputting a feature map of size (H / 2)*(W / 2).

[0283] The transposed convolution layer is used to upsample the feature map output by the eleventh feature extraction module to the same resolution as the skin image of the human face, that is, a resolution of H*W, and set the number of channels to the number of categories to be segmented, for example, the number of categories to be segmented is set to 1, thereby outputting a first coarse wrinkle image of size H*W*1. The categories to be segmented include a first category and a second category, the first category is coarse wrinkles, that is, the pixel is located in the coarse wrinkles, and the second category is no coarse wrinkles, that is, the pixel is located outside the coarse wrinkles.

[0284] See also Fig.18 , Fig.18 is a schematic diagram of an input image and an output image of a coarse wrinkle detection model provided in an embodiment of the present application;

[0285] like Fig.18 As shown, Fig.18 Part a in the figure is the skin image of the face that is input into the coarse wrinkle detection model. Fig.18 Part b in FIG. 1 is the first coarse wrinkle image output by the coarse wrinkle detection model. The first coarse wrinkle image is a binary black-and-white image, where white lines represent coarse wrinkles and black represents background.

[0286] In an embodiment of the present application, by extracting coarse wrinkles from a skin image of a human face based on a coarse wrinkle detection model and outputting a first coarse wrinkle image, the present application can identify various types of coarse wrinkles on a human face, such as large forehead wrinkles, frown lines, horizontal lines on the bridge of the nose, or nasolabial folds, and can output an image for visualization.

[0287] Step S1429: performing a thinning operation on the first coarse wrinkle image to obtain a second coarse wrinkle image.

[0288] Specifically, due to the labeling error, the white lines in the first coarse wrinkle image are thicker than the real coarse wrinkles. Therefore, for visual display, the white lines in the first coarse wrinkle image need to be thinned to lines close to the coarse wrinkles to obtain the second coarse wrinkle image. The width of the lines representing the coarse wrinkles in the second coarse wrinkle image is smaller than the width of the lines representing the coarse wrinkles in the first coarse wrinkle image.

[0289] In the embodiment of the present application, step S1429 includes steps S1 to S3:

[0290] Step S1: performing an erosion operation on the first coarse wrinkle image to obtain an eroded image;

[0291] The eroded image is an image obtained by performing an erosion operation on the first coarse wrinkle image. The erosion operation is a prior art and will not be described in detail herein.

[0292] Step S2: performing an opening operation on the eroded image to obtain an opening operation image;

[0293] Specifically, the erosion image is subjected to an erosion operation and a dilation operation in sequence to obtain an open operation image. The open operation image is an image obtained by performing an open operation on the erosion image. The dilation operation is a prior art and will not be described in detail herein.

[0294] Step S3: performing a subtraction operation on the eroded image and the opening operation image to obtain a second coarse wrinkle image.

[0295] Specifically, the erosion image and the opening operation image are subtracted by an image subtraction function to obtain a second coarse wrinkle image. The image subtraction function includes but is not limited to the cv2.subtract function, which is used to perform a subtraction operation to subtract the pixel value of one image from another image pixel by pixel.

[0296] See also Fig.19 , Fig.19 is a schematic diagram of a first coarse wrinkle image and a second coarse wrinkle image provided in an embodiment of the present application;

[0297] like Fig.19 As shown, Fig.19Part a in is the first coarse wrinkle image. Fig.19 The portion b in FIG. 1 is a second coarse wrinkle image. The width of the white line representing the coarse wrinkles in the second coarse wrinkle image is smaller than the width of the white line representing the coarse wrinkles in the first coarse wrinkle image.

[0298] In an embodiment of the present application, an erosion operation is performed on the first coarse wrinkle image to obtain an erosion image, an opening operation is performed on the erosion image to obtain an opening operation image, and a subtraction operation is performed on the erosion image and the opening operation image to obtain a second coarse wrinkle image. The present application can improve the accuracy of the visualized lines representing coarse wrinkles in the second coarse wrinkle image.

[0299] In some embodiments, other skeletonization methods may be used, for example, using a distance transform-based thinning algorithm, morphological gradient, adaptive thinning algorithm, etc. to perform a thinning operation on the first coarse wrinkle image to obtain a second coarse wrinkle image, which is not limited in the present application.

[0300] Step S1403: performing a fusion operation on the coarse wrinkle image and the fine wrinkle image to obtain a facial wrinkle image.

[0301] The coarse wrinkle image and the fine wrinkle image correspond to the same skin image, and the fine wrinkle image is obtained according to the wrinkle detection method in Example 1. The fusion operation refers to the process of merging the coarse wrinkle image and the fine wrinkle image to generate a wrinkle image containing both coarse wrinkle features and fine wrinkle features. The face wrinkle image is an image obtained by superimposing the second coarse wrinkle image and the fine wrinkle image, and the face wrinkle image includes wrinkles on the whole face, that is, coarse wrinkles and fine wrinkles on the face of the human face.

[0302] Specifically, the second coarse wrinkle image is superimposed with the fine wrinkle image to obtain a facial wrinkle image. That is, the second coarse wrinkle image is superimposed with the wrinkle image of forehead wrinkles, the wrinkle image of glabellar wrinkles, the wrinkle image of fine wrinkles around the eyes, and the wrinkle image of crow's feet in the first embodiment to obtain a facial wrinkle image, and then the facial wrinkle image is displayed on the screen of the electronic device.

[0303] See also Fig. 20 , Fig. 20 is a schematic diagram of a second coarse wrinkle image, a fine wrinkle image, and a face wrinkle image provided by an embodiment of the present application;

[0304] like Fig. 20 As shown, Fig. 20 Part a in the figure is a second coarse wrinkle image, which includes thick forehead wrinkles, frown lines, nose bridge horizontal lines, and nasolabial folds; Fig.19 Part b in the figure is a fine wrinkle image, which includes fine forehead wrinkles, frown lines, eye wrinkles, and crow's feet. Fig. 20Part c in FIG. 1 is a facial wrinkle image, which includes coarse wrinkles and fine wrinkles on the whole face.

[0305] In an embodiment of the present application, a wrinkle display method is provided, which includes: obtaining a skin image of a human face; extracting coarse wrinkles in the skin image based on a coarse wrinkle detection model to obtain a coarse wrinkle image; and fusing the coarse wrinkle image with the fine wrinkle image to obtain a facial wrinkle image, wherein the coarse wrinkle image and the fine wrinkle image correspond to the same skin image, and the fine wrinkle image is obtained according to the wrinkle detection method in the first embodiment.

[0306] By extracting coarse wrinkles from a skin image based on a coarse wrinkle detection model to obtain a coarse wrinkle image, the coarse wrinkle image and the fine wrinkle image are fused to obtain a facial wrinkle image, wherein the fine wrinkle image is obtained according to the wrinkle detection method in any of the following method embodiments. The present application can identify fine wrinkles and coarse wrinkles on a human face, improve the accuracy and reliability of facial fine wrinkle and coarse wrinkle detection, and further output the facial wrinkle image for visualization.

[0307] Embodiment 3

[0308] The following describes the training method of the coarse wrinkle detection model provided in the embodiment of the present application in combination with the exemplary application and implementation of the server provided in the embodiment of the present application.

[0309] See also Fig.21 , Fig.21 It is a flowchart of a method for training a coarse wrinkle detection model provided in an embodiment of the present application;

[0310] The training method of the coarse wrinkle detection model is applied to electronic devices, such as terminals and servers. Specifically, the training method of the coarse wrinkle detection model is performed by one or at least two processors in the electronic device. The coarse wrinkle detection model includes a first downsampling module, an encoder module, and a decoder module.

[0311] like Fig.21 As shown, the training method of the coarse wrinkle detection model includes:

[0312] Step S2101: Acquire an image data set;

[0313] Among them, the image data set includes a first skin image of a human face, the first skin image is a skin image of the human face obtained by cropping a skin picture, and the first skin image includes coarse wrinkles, the coarse wrinkles include at least one of forehead wrinkles, frown lines, horizontal lines on the bridge of the nose, and nasolabial folds, among which the forehead wrinkles among the coarse wrinkles are coarse forehead wrinkles, that is, forehead wrinkles with a larger width or a deeper depth, for example: forehead wrinkles with a width of more than 2 mm or a depth of more than 1 mm.

[0314] The image dataset includes a plurality of first skin images corresponding to people of different age groups, or a plurality of first skin images with different coarse wrinkle severity. The coarse wrinkle severity can be evaluated by measuring the width and depth of the coarse wrinkles. The wider or deeper the coarse wrinkles are, the more severe the coarse wrinkles are.

[0315] In some embodiments, an image dataset is composed of first skin images of different age groups or different wrinkle severities downloaded from the Internet by an electronic device, wherein the number of first skin images included in the image dataset can be determined by those skilled in the art according to actual conditions.

[0316] It is understandable that those skilled in the art can determine the types of coarse wrinkles that can be included in the image data set according to actual needs. For example, the types of coarse wrinkles include forehead wrinkles, frown lines, transverse lines on the bridge of the nose, and nasolabial folds. Thus, the trained coarse wrinkle detection model can identify forehead wrinkles, frown lines, transverse lines on the bridge of the nose, and nasolabial folds.

[0317] Step S2102: performing a data enhancement operation on each first skin image to obtain a plurality of second skin images;

[0318] Among them, the data enhancement operation is used to perform diversified transformation processing on the first skin image to increase the diversity of training samples. The second skin image is an image obtained by performing data enhancement operation on the first skin image. The data enhancement operation includes but is not limited to rotation, cropping, translation, illumination change, contrast change or adding noise.

[0319] In an embodiment of the present application, by performing data enhancement operations on each first skin image to obtain a plurality of second skin images, the present application can increase the data diversity during model training and improve the generalization ability and robustness of the model.

[0320] Further, after obtaining a plurality of second skin images, the real label is annotated for each pixel on the second skin image, for example, the real label is annotated by using a thermal encoding method. The real label includes a first value or a second value, the first value is used to characterize that the pixel is located in a coarse wrinkle, and the second value is used to characterize that the pixel is located outside a coarse wrinkle. Thermal encoding is a common technical means in the art and will not be described in detail here. The first value and the second value can be set by those skilled in the art according to actual conditions, and are not limited here. For example, the first value is 1 and the second value is 0.

[0321] Step S2103: Based on the first down-sampling module, compress the second skin image to obtain a compressed image;

[0322] Specifically, the first downsampling module takes the second skin image as input, performs image compression on the second skin image, and outputs a compressed image. The size of the second skin image is H*W*3, H represents the height of the second skin image, that is, the number of vertical pixels of the image, W represents the width of the second skin image, that is, the number of horizontal pixels of the image, 3 represents the number of channels of the second skin image, and the compressed image is a feature map obtained by compressing the second skin image, and the size of the compressed image is (H / 2)*(W / 2).

[0323] Among them, the first down-sampling module includes a maximum pooling layer, a convolutional layer and a first adding unit. The first adding unit is respectively connected to the maximum pooling layer and the convolutional layer. The maximum pooling layer and the convolutional layer process the skin image input into the first down-sampling module in parallel. The first adding unit is used to add the feature map output by the maximum pooling layer and the feature map output by the convolutional layer.

[0324] The maximum pooling layer is used to perform a maximum pooling operation on the skin image using a pooling window of size 2*2, and select the largest element value in each 2*2 area, thereby outputting a feature map of size (H / 2)*(W / 2). This convolution layer is the first convolution layer, which is used to perform a convolution operation on the skin image using a convolution kernel of size 3*3, step size 2, and number 13, and output a feature map of size (H / 2)*(W / 2). The first addition unit is used to add the feature map output by the maximum pooling layer and the feature map output by the first convolution layer element by element, and output a compressed image of size (H / 2)*(W / 2).

[0325] Step S2104: Based on the encoder module, feature extraction is performed on the compressed image to obtain a spliced ​​feature map;

[0326] Specifically, the encoder module is used to extract features from each compressed image, and the encoder module includes a first encoder, a second encoder, and a third encoder. Fig.14As shown, the first downsampling module, the first encoder, the second encoder, and the third encoder are connected in sequence, and the feature map output by the first downsampling module and the feature map output by the first decoder are spliced ​​and used as the input of the second decoder.

[0327] In the embodiment of the present application, step S2104 includes steps S2141 to S2144:

[0328] Step S2141: Based on the first encoder, extract the first feature of the compressed image to obtain a first encoding feature map;

[0329] Specifically, the first encoder takes the compressed image as input, extracts the first feature of the compressed image, and outputs a first encoded feature map. The first feature is a detail, low-level coarse wrinkle feature, such as the starting point, the end point, and the thickness of the coarse wrinkle, etc. The first encoded feature map is a feature map output by the first encoder with a size of (H / 4)*(W / 4).

[0330] The first encoder includes a second downsampling module and four feature extraction modules connected in sequence. The second downsampling module is used to compress the compressed image and reduce the resolution of the compressed image to (H / 4)*(W / 4). The feature extraction module is used to extract coarse wrinkle features.

[0331] Among them, the second downsampling module includes a first unit, a second unit and a second addition unit. The second addition unit is connected to the first unit and the second unit respectively. The first unit and the second unit process the compressed image input to the second downsampling module in parallel. The first unit includes a maximum pooling layer and a padding unit connected in sequence. The padding unit is used to perform a padding operation. The second unit includes three convolutional layers connected in sequence and an activation layer. The three convolutional layers connected in sequence are the second convolutional layer, the third convolutional layer, and the fourth convolutional layer. The activation layer is the first activation layer. The second addition unit is used to add the feature map output by the first unit to the feature map output by the second unit. The specific structure of the second downsampling module is as follows: Fig.15 shown.

[0332] When the image size input to the second downsampling module is h*w*c, h represents the height of the image, that is, the number of vertical pixels of the image, w represents the width of the image, that is, the number of horizontal pixels of the image, and c represents the number of channels of the image:

[0333] The maximum pooling layer is used to perform the maximum pooling operation (MaxPooling) on ​​the image input to the second downsampling module using a pooling window of size 2*2, and select the largest element value in each 2*2 area, thereby outputting a feature map of size (h / 2)*(w / 2)*c; the padding unit is used to splice dc all-zero feature maps of size (h / 2)*(w / 2) on the feature map output by the maximum pooling layer, thereby completing the padding operation (padding operation) and expanding the number of channels from c to d.

[0334] The second convolutional layer is used to reduce the dimension of the image input to the second down-sampling module by using a convolution kernel of size 1*1 and number c / 4, and output a feature map of size h*w*(c / 4); the third convolutional layer is used to extract features from the feature map output by the first convolutional layer by using a convolution kernel of size 3*3, step size 2 and number (c / 4), and output a feature map of size (h / 2)*(w / 2)*(c / 4); the fourth convolutional layer is used to increase the dimension of the feature map output by the third convolutional layer by using a convolution kernel of size 1*1 and number d, and output a feature map of size (h / 2)*(w / 2)*d.

[0335] In an embodiment of the present application, the training method of the coarse wrinkle detection model further includes: after the fourth convolutional layer in the second downsampling module outputs a feature map, a regularization operation (dropout operation) is performed on the feature map to obtain a first regularized feature map. The first regularized feature map is a feature map obtained by the regularization operation in the second downsampling module. The regularization operation sets the output to zero during the training process to randomly discard a certain proportion of neurons to reduce the complex co-adaptation relationship between neurons and increase the generalization ability of the model. It can be understood that the dropout operation is usually only used in the training phase. In the inference or testing phase of the model, all neurons will be used.

[0336] Furthermore, the first activation layer is used to perform a nonlinear activation operation (Rectified Linear Unit, ReLU) on the regularized feature map to increase the nonlinearity of the network and help the network learn more complex features. The second addition unit is used to add the feature map output by the padding unit and the feature map output by the first activation layer element by element, and output a feature map of size (h / 2)*(w / 2)*d.

[0337] In the embodiment of the present application, the sizes of h, w, c, and d can be set by those skilled in the art according to the size of the skin image of the face, and are not limited here. For example, c is 3, and d=c*2.

[0338] In an embodiment of the present application, downsampling is completed by performing maximum pooling and convolution operations on the input in parallel in the maximum pooling layer and the convolution layer in the first downsampling module and the second downsampling module. Compared with the existing downsampling scheme that only uses the maximum pooling operation, the present application can reduce information loss.

[0339] In the embodiment of the present application, the feature extraction module includes three sequentially connected convolutional layers, an activation layer and a third addition unit. The three sequentially connected convolutional layers are the fifth convolutional layer, the sixth convolutional layer and the seventh convolutional layer. The activation layer is the second activation layer. The third addition unit is used to add the feature map output by the activation layer in the feature extraction module to the feature map input to the feature extraction module. The specific structure of the feature extraction module is as follows: Fig.17 shown.

[0340] When the feature map size of the input feature extraction module is h*w*c, h represents the height of the image, w represents the width of the image, and c represents the number of channels of the image:

[0341] The fifth convolutional layer is used to use a convolution kernel with a size of 1*1 and a number of c / 4 to reduce the dimension of the feature map of the input feature extraction module, and output a feature map with a size of h*w*(c / 4); the sixth convolutional layer is used to use a convolution kernel with a size of 3*3, a step size of 1, and a number of (c / 4) to extract features from the feature map output by the fifth convolutional layer, and output a feature map with a size of h*w*(c / 4); the seventh convolutional layer is used to use a convolution kernel with a size of 1*1 and a number of c to increase the dimension of the feature map output by the sixth convolutional layer, and output a feature map with a size of h*w*c.

[0342] In the embodiment of the present application, the training method of the coarse wrinkle detection model further includes: after the seventh convolutional layer in the feature extraction module outputs the feature map, performing a regularization operation (dropout operation) on the feature map to obtain a second regularized feature map. The second regularized feature map is a feature map obtained by the regularization operation in the feature extraction module.

[0343] Furthermore, the second activation layer is used to perform a nonlinear activation operation (Rectified Linear Unit, ReLU) on the second regularized feature map to increase the nonlinearity of the network and help the network learn more complex features. The third addition unit is used to add the feature map of the input feature extraction module and the feature map output by the second activation layer element by element, and output a feature map of size h*w*c.

[0344] Step S2142: Based on the second encoder, extract the second feature of the first coding feature map to obtain a second coding feature map;

[0345] Specifically, the second encoder takes the first encoding feature map as input, extracts the second feature from the first encoding feature map, and outputs the second encoding feature map. The first feature is different from the second feature, and the second feature is a high-level, abstract semantic feature, such as the semantic meaning of the area where the coarse wrinkles are located, the relationship between the coarse wrinkles and other facial features, etc. The second encoding feature map is a feature map output by the second encoder with a size of (H / 8)*(W / 8).

[0346] Among them, the second encoder includes six feature extraction modules connected in sequence, wherein the convolution methods adopted by the six feature extraction modules are standard convolution, hole convolution, asymmetric convolution, standard convolution, hole convolution, and asymmetric convolution in sequence.

[0347] Specifically, the six sequentially connected feature extraction modules include a first feature extraction module, a second feature extraction module, a third feature extraction module, a fourth feature extraction module, a fifth feature extraction module, and a sixth feature extraction module. The structures of the six feature extraction modules are similar to Fig.17 The structures of the feature extraction modules shown are the same, except that: the number of convolution kernels used in the seventh convolution layer of the six feature extraction modules is d, d=c*2; the sixth convolution layer in the first feature extraction module and the fourth feature extraction module adopts standard convolution operation; the sixth convolution layer in the second feature extraction module and the fifth feature extraction module adopts hole convolution; the sixth convolution layer in the third feature extraction module and the sixth feature extraction module adopts asymmetric convolution (i.e., a convolution kernel of size 5*1 and a convolution kernel of size 1*5 are serially convolved), thereby outputting a feature map with a resolution of (H / 8)*(W / 8), and the number of channels is doubled to facilitate richer feature extraction.

[0348] In the embodiment of the present application, by using hole convolution in the second feature extraction module and the sixth convolution layer in the fourth feature extraction module, the receptive field of the feature map can be increased; by using asymmetric convolution in the third feature extraction module and the sixth convolution layer in the sixth feature extraction module, both the receptive field can be increased and the diversity of features can be increased.

[0349] Step S2143: Based on the third encoder, extract the second feature of the second encoding feature map to obtain a third encoding feature map;

[0350] Specifically, the third encoder takes the second encoding feature map as input, extracts the second feature from the second encoding feature map, and outputs a third encoding feature map. The third encoding feature map is a feature map output by the third encoder with a size of (H / 8)*(W / 8).

[0351] Among them, the second encoder has the same structure as the third encoder. The second encoder and the third encoder both include six feature extraction modules connected in sequence. The convolution methods used by the six feature extraction modules are standard convolution, hole convolution, asymmetric convolution, standard convolution, hole convolution, and asymmetric convolution.

[0352] The difference from the second encoder is that the number of convolution kernels used in the seventh convolution layer of the six feature extraction modules of the third encoder is c, so the size and number of channels of the third encoded feature map output by the third encoder are the same as the second encoded feature map input to the third encoder. Figure 1 To.

[0353] In an embodiment of the present application, since the resolution of the feature map input to the first encoder is relatively large, the first encoder extracts more detailed, lower-level first features, and the second encoder and the third encoder extract higher-level, more abstract second features. The present application can improve the richness of the extracted features.

[0354] Step S2144: concatenate the second coding feature map with the third coding feature map to obtain a concatenated feature map.

[0355] Among them, the spliced ​​feature map is a feature map obtained by splicing the second encoding feature map and the third encoding feature map.

[0356] Step S2105: Based on the decoder module, performing a wrinkle classification operation on the spliced ​​feature map to obtain a first coarse wrinkle image;

[0357] The decoder module includes a first decoder and a second decoder. The first coarse wrinkle image is a binary black-and-white image containing only coarse wrinkles output by the coarse wrinkle detection model. The first decoder and the second decoder are connected in sequence. The first decoder and the second decoder are used to perform wrinkle classification operations pixel by pixel to determine whether any pixel point belongs to the coarse wrinkle area, that is, to determine whether the pixel point is located in the coarse wrinkle. Fig.15 As shown, the feature map output by the second encoder and the feature map output by the third decoder are concatenated and used as the input of the first decoder.

[0358] In the embodiment of the present application, step S2105 includes steps S2151 to S2153:

[0359] Step S2151: Based on the first decoder, performing a wrinkle classification operation at a first resolution on the spliced ​​feature map to obtain a first decoded feature map;

[0360] Specifically, the first decoder takes the spliced ​​feature map as input, performs a wrinkle classification operation at a first resolution on the pixels in the spliced ​​feature map to determine whether any pixel belongs to a coarse wrinkle area, that is, to determine whether the pixel is located in a coarse wrinkle, thereby outputting a first decoded feature map. The first decoded feature map is a feature map of size (H / 4)*(W / 4) output by the first decoder, and the first resolution is the resolution size of the feature map output by the first decoder. The first resolution can be set by those skilled in the art according to actual conditions, and is not limited here. For example, the first resolution is (H / 4)*(W / 4).

[0361] The first decoder includes an upsampling layer and three feature extraction modules connected in sequence. The upsampling layer is used to upsample the spliced ​​feature map and expand the resolution of the spliced ​​feature map to (H / 4)*(W / 4). The three feature extraction modules include the seventh feature extraction module, the eighth feature extraction module and the ninth feature extraction module. The structures of these three feature extraction modules are similar to Fig.16 The structures of the feature extraction modules shown are the same. The seventh feature extraction module is used to fuse features and reduce the number of channels by half. The eighth feature extraction module and the ninth feature extraction module are used to restore the details of the feature map, thereby outputting a first decoding feature map of size (H / 4)*(W / 4).

[0362] Step S2152: concatenating the compressed image with the first decoding feature map to obtain a second decoding feature map;

[0363] The second decoding feature map is a feature map obtained by concatenating the compressed image and the first decoding feature map.

[0364] Step S2153: Based on the second decoder, a wrinkle classification operation is performed on the second decoded feature map at a second resolution to obtain a first coarse wrinkle image.

[0365] Specifically, the second decoder takes the second decoded feature map as input, performs a wrinkle classification operation at a second resolution on the pixels in the second decoded feature map, to determine whether any pixel belongs to a coarse wrinkle region, that is, to determine whether the pixel is located in a coarse wrinkle, thereby outputting a first coarse wrinkle image. The first coarse wrinkle image is a feature map of size H*W*1 output by the second decoder, the second resolution is greater than the first resolution, and the second resolution is the resolution of a skin image of a human face.

[0366] The second decoder includes an upsampling layer, two feature extraction modules, and a transposed convolution layer connected in sequence. The upsampling layer is used to upsample the second decoding feature map and expand the resolution of the second decoding feature map to (H / 2)*(W / 2). The two feature extraction modules include the tenth feature extraction module and the eleventh feature extraction module. The structures of these two feature extraction modules are similar to Fig.17 The structures of the feature extraction modules shown are the same. The tenth feature extraction module is used to fuse features and reduce the number of channels by half, and the eleventh feature extraction module is used to restore the details of the feature map, thereby outputting a feature map of size (H / 2)*(W / 2).

[0367] The transposed convolution layer is used to upsample the feature map output by the eleventh feature extraction module to the same resolution as the skin image of the human face, that is, a resolution of H*W, and set the number of channels to the number of categories to be segmented, for example, the number of categories to be segmented is set to 1, thereby outputting the first coarse wrinkle image of size H*W*1. The categories to be segmented include two categories: coarse wrinkles and no coarse wrinkles, that is, two categories where the pixel is located in the coarse wrinkles or the pixel is located outside the coarse wrinkles.

[0368] Step S2106: construct a loss function, and train the coarse wrinkle detection model based on the loss function until the loss function converges to generate a trained coarse wrinkle detection model.

[0369] Specifically, the loss function is used to train the coarse wrinkle detection model, construct the loss function, adjust the parameters of the coarse wrinkle detection model, until the loss function converges, and the coarse wrinkle detection model at this time is used as the trained coarse wrinkle detection model. It can be understood that convergence means that under certain model parameters, the sum of the differences between the true label of each pixel point in each second skin image and the predicted probability value of each pixel point in the corresponding first coarse wrinkle image is less than a preset threshold or fluctuates within a certain range.

[0370] In the embodiment of the present application, the training method of the coarse wrinkle detection model further includes: determining the first probability value of the first category and the second probability value of the second category corresponding to each pixel in the first coarse wrinkle image based on the activation function, and taking the maximum probability value as the predicted probability value of the pixel. Wherein, the first category is coarse wrinkles, that is, the pixel is located in the coarse wrinkles, the second category is no coarse wrinkles, that is, the pixel is located outside the coarse wrinkles, the first probability value is the probability that the pixel is located in the coarse wrinkles, the second probability value is the probability that the pixel is located outside the coarse wrinkles, the maximum probability value is the maximum value of the first probability value and the second probability value corresponding to a pixel, and the activation function includes but is not limited to the softmax function, which is used to convert the input into a probability distribution and output the probability value of each pixel corresponding to each category.

[0371] Specifically, the training process of the coarse wrinkle detection model includes steps S2161 to S2167:

[0372] Step S2161: constructing a coarse wrinkle detection model;

[0373] Specifically, the specific content of the coarse wrinkle detection model can refer to the content mentioned in the above embodiment, which will not be repeated here.

[0374] Step S2162: Determine the predicted probability value of each pixel;

[0375] Step S2163: constructing a loss function;

[0376] In some embodiments, the loss function comprises a cross entropy loss function, which comprises:

[0377]

[0378] Where L represents the loss function, N represents the number of pixels contained in a second skin image, and y i represents the true label of the i-th pixel, p i Represents the predicted probability value of the i-th pixel. The true label includes a first value or a second value, the first value is used to represent the presence of coarse wrinkles at the pixel, and the second value is used to represent the absence of coarse wrinkles at the pixel. For example, the first value is 1 and the second value is 0.

[0379] Step S2164: iteratively training the coarse wrinkle detection model based on the loss function;

[0380] Step S2165: Determine whether the number of iterations is greater than the first number threshold;

[0381] The embodiment of the present application uses the Adam algorithm (Adaptive Moment Estimation Algorithm) to optimize the model parameters. For example, the number of iterations is set to 500, the initial learning rate is set to 0.001, the weight decay is set to 0.0005, and the learning rate decays to 1 / 10 of the original after every 50 iterations.

[0382] Specifically, the Adam algorithm is used to optimize the model parameters. For example, the number of iterations is set to 10,000, the initialization learning rate is set to 0.001, the weight decay of the learning rate is set to 0.0005, and the learning rate decays to 1 / 10 of the original value every 1,000 iterations. The learning rate and the difference between the true label and the predicted probability value of each pixel can be input into the Adam algorithm to obtain the adjusted model parameters output by the Adam algorithm, and the adjusted model parameters are used for the next training until the cross entropy loss function converges.

[0383] If the cross entropy loss function converges, it indicates that the training of the coarse wrinkle detection model is completed, and the model parameters of the coarse wrinkle detection model at this time are output, thereby obtaining a trained coarse wrinkle detection model.

[0384] It can be understood that the Adam algorithm (Adaptive Moment Estimation Algorithm) can be seen as a combination of the momentum method and the RMSprop algorithm. It not only uses momentum as the parameter update direction, but also can adaptively adjust the learning rate.

[0385] Specifically, it is determined whether the number of iterations is greater than a first number threshold, which is preset, for example, 500 times. If the number of iterations is greater than the first number threshold, the process proceeds to step S2167; if the number of iterations is less than or equal to the first number threshold, the process proceeds to step S2166.

[0386] It is understandable that the first number threshold is specifically set according to specific needs and is not limited here.

[0387] Step S2166: determining whether the loss of the coarse wrinkle detection model is less than a first loss threshold;

[0388] Specifically, determine whether the loss of the coarse wrinkle detection model is less than the first loss threshold, if so, proceed to step S2167; if not, return to step S2164.

[0389] In the embodiment of the present application, the first loss threshold may be set to 0.0005 or 0.001. It is understandable that the first loss threshold is set according to specific needs and is not limited here.

[0390] Step S2167: Training is completed.

[0391] Furthermore, after the training is completed, a trained coarse wrinkle detection model is obtained. At this time, the trained coarse wrinkle detection model can be called to detect coarse wrinkles in the skin image of the human face and output a first coarse wrinkle image.

[0392] In an embodiment of the present application, a training method for a coarse wrinkle detection model is provided, the coarse wrinkle detection model includes a first downsampling module, an encoder module, and a decoder module, and the training method for the coarse wrinkle detection model includes: acquiring an image data set, wherein the image data set includes a first skin image; performing a data enhancement operation on each first skin image to obtain a plurality of second skin images; based on the first downsampling module, performing image compression on the second skin image to obtain a compressed image; based on the encoder module, performing feature extraction on the compressed image to obtain a spliced ​​feature map; based on the decoder module, performing a wrinkle classification operation on the spliced ​​feature map to obtain a first coarse wrinkle image; constructing a loss function, and training the coarse wrinkle detection model based on the loss function until the loss function converges to generate a trained coarse wrinkle detection model.

[0393] By performing a data enhancement operation on each first skin image to obtain a plurality of second skin images, based on the first downsampling module, the second skin images are compressed to obtain compressed images, based on the encoder module, features are extracted on the compressed images to obtain a spliced ​​feature map, based on the decoder module, a wrinkle classification operation is performed on the spliced ​​feature map to obtain a first coarse wrinkle image, a loss function is constructed, and a coarse wrinkle detection model is trained based on the loss function until the loss function converges to generate a trained coarse wrinkle detection model. The present application can improve the generalization ability of the coarse wrinkle detection model, the accuracy of the coarse wrinkle detection model in coarse wrinkle detection, and the stability of the coarse wrinkle detection model.

[0394] Embodiment 4

[0395] See also Fig. 22 , Fig. 22 is a structural schematic diagram of a wrinkle detection device provided in an embodiment of the present application;

[0396] The wrinkle detection device is applied to an electronic device. Specifically, the wrinkle detection device is applied to one or at least two processors of the electronic device.

[0397] like Fig. 22 As shown, the wrinkle detection device 220 comprises:

[0398] The image acquisition unit 221 is used to acquire a skin image of a human face, where the skin image includes multiple types of wrinkles, and the multiple types of wrinkles are located at different positions on the human face.

[0399] The cropping unit 222 is used to crop the skin image according to the positions of different types of wrinkles on the face of the person to obtain a local wrinkle image.

[0400] The feature enhancement unit 223 is used to perform a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image.

[0401] The mask unit 224 is used to extract a first pixel region in the local wrinkle image and perform an AND operation on the first pixel region and the feature enhancement image to obtain a mask image, wherein the first pixel region is a non-black pixel region in the local wrinkle image.

[0402] The feature extraction unit 225 is used to perform a feature extraction operation on the mask image to obtain a fine wrinkle image.

[0403] In the embodiments of the present application, the wrinkle detection device can also be constructed by hardware devices, for example, the wrinkle detection device can be constructed by one or more chips, and the chips can work in coordination with each other to complete the wrinkle detection methods described in the above embodiments. For another example, the wrinkle detection device can also be constructed by various logic devices, such as general-purpose processors, digital signal processors (Digital Signal Process, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field Programmable Gate Array, FPGA), single-chip microcomputers, ARM processors (Advanced RISC Machines, ARM) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components or any combination of these components.

[0404] The wrinkle detection device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0405] The wrinkle detection device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0406] The wrinkle detection device provided in the embodiment of the present application can achieve Figure 3 To avoid repetition, the various implementation processes will not be described here.

[0407] It should be noted that the wrinkle detection device can execute the wrinkle detection method provided in the above embodiment, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the wrinkle detection device embodiment, please refer to the wrinkle detection method provided in the above embodiment.

[0408] In an embodiment of the present application, a wrinkle detection device is provided, which includes: an image acquisition unit, used to acquire a skin image of a human face, the skin image includes multiple types of wrinkles, and the multiple types of wrinkles are located at different positions on the human face; a cropping unit, used to crop the skin image according to the positions of different types of wrinkles on the human face to obtain a local wrinkle image, the local wrinkle image includes a first pixel area; a feature enhancement unit, used to perform a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image; a mask unit, used to extract the first pixel area in the local wrinkle image, and perform an AND operation on the first pixel area and the feature enhanced image to obtain a mask image; a feature extraction unit, used to perform a feature extraction operation on the mask image to obtain a fine wrinkle image.

[0409] An image acquisition unit is used to acquire a skin image of a human face, the skin image includes multiple types of wrinkles, and the multiple types of wrinkles are located at different positions on the human face; a cropping unit is used to crop the skin image according to the positions of different types of wrinkles on the human face to obtain a local wrinkle image, the local wrinkle image includes a first pixel area; a feature enhancement unit is used to perform a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image; a mask unit is used to extract the first pixel area in the local wrinkle image, and perform an AND operation on the first pixel area and the feature enhanced image to obtain a mask image; a feature extraction unit is used to perform a feature extraction operation on the mask image to obtain a fine wrinkle image. The present application can identify fine wrinkles on a human face, reduce the interference of facial hair on fine wrinkle detection, and improve the accuracy and reliability of facial fine wrinkle detection.

[0410] Embodiment 5

[0411] See also Fig.23 , Fig.23 It is a structural schematic diagram of a wrinkle display device provided in an embodiment of the present application;

[0412] The wrinkle display device is applied to an electronic device. Specifically, the wrinkle display device is applied to one or at least two processors of the electronic device.

[0413] like Fig.23 As shown, the wrinkle display device 230 comprises:

[0414] The image acquisition unit 221 is used to acquire a skin image of a human face.

[0415] The coarse wrinkle detection unit 231 is used to extract coarse wrinkles in the skin image based on the coarse wrinkle detection model to obtain a coarse wrinkle image.

[0416] The image fusion unit 232 is used to fuse the coarse wrinkle image and the fine wrinkle image to obtain a facial wrinkle image, wherein the coarse wrinkle image and the fine wrinkle image correspond to the same skin image, and the fine wrinkle image is obtained according to the wrinkle detection device 220.

[0417] In the embodiments of the present application, the wrinkle display device can also be constructed by hardware devices, for example, the wrinkle display device can be constructed by one or more chips, and the chips can work in coordination with each other to complete the wrinkle display methods described in the above embodiments. For another example, the wrinkle display device can also be constructed by various logic devices, such as general-purpose processors, digital signal processors (Digital Signal Process, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field Programmable Gate Array, FPGA), single-chip microcomputers, ARM processors (Advanced RISC Machines, ARM) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components or any combination of these components.

[0418] The wrinkle display device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0419] The wrinkle display device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0420] The wrinkle display device provided in the embodiment of the present application can achieve Fig.14 To avoid repetition, the various implementation processes will not be described here.

[0421] It should be noted that the wrinkle display device can execute the wrinkle display method provided in the above embodiment, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the wrinkle display device embodiment, please refer to the wrinkle display method provided in the above embodiment.

[0422] In an embodiment of the present application, a wrinkle display device is provided, which includes: an image acquisition unit for acquiring a skin image of a human face; a coarse wrinkle detection unit for extracting coarse wrinkles in the skin image based on a coarse wrinkle detection model to obtain a coarse wrinkle image; an image fusion unit for fusing the coarse wrinkle image with the fine wrinkle image to obtain a facial wrinkle image, wherein the coarse wrinkle image and the fine wrinkle image correspond to the same skin image, and the fine wrinkle image is acquired according to the wrinkle detection device.

[0423] The image acquisition unit is used to acquire a skin image of a human face; the coarse wrinkle detection unit is used to extract coarse wrinkles in the skin image based on a coarse wrinkle detection model to obtain a coarse wrinkle image; the image fusion unit is used to fuse the coarse wrinkle image with the fine wrinkle image to obtain a human face wrinkle image, the coarse wrinkle image and the fine wrinkle image correspond to the same skin image, the fine wrinkle image is acquired according to the wrinkle detection device, the present application can identify fine wrinkles and coarse wrinkles on a human face, improve the accuracy and reliability of facial fine wrinkle and coarse wrinkle detection, and then can output the human face wrinkle image for visualization.

[0424] Embodiment 6

[0425] See also Fig.24 , Fig.24 It is a structural schematic diagram of a training device for a coarse wrinkle detection model provided in an embodiment of the present application;

[0426] The training device for the coarse wrinkle detection model is applied to an electronic device. Specifically, the training device for the coarse wrinkle detection model is applied to one or at least two processors of the electronic device.

[0427] Among them, the coarse wrinkle detection model includes a first downsampling module, an encoder module, and a decoder module.

[0428] like Fig.24 As shown, the training device 240 of the coarse wrinkle detection model includes:

[0429] The image acquisition unit 221 is used to acquire an image data set, wherein the image data set includes a first skin image.

[0430] The data enhancement unit 242 is used to perform a data enhancement operation on each first skin image to obtain a plurality of second skin images.

[0431] The image compression unit 243 is used to perform image compression on the second skin image based on the first down-sampling module to obtain a compressed image.

[0432] The encoding unit 244 is used to extract features from the compressed image based on the encoder module to obtain a spliced ​​feature map.

[0433] The decoding unit 245 is used to perform a wrinkle classification operation on the spliced ​​feature map based on the decoder module to obtain a first coarse wrinkle image.

[0434] The training unit 246 is used to construct a loss function and train the coarse wrinkle detection model based on the loss function until the loss function converges to generate a trained coarse wrinkle detection model.

[0435] In the embodiments of the present application, the training device of the coarse wrinkle detection model can also be constructed by hardware devices. For example, the training device of the coarse wrinkle detection model can be constructed by one or more chips, and each chip can work in coordination with each other to complete the training method of the coarse wrinkle detection model described in the above embodiments. For another example, the training device of the coarse wrinkle detection model can also be constructed by various logic devices, such as a general-purpose processor, a digital signal processor (Digital Signal Process, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA), a single-chip microcomputer, an ARM processor (Advanced RISC Machines, ARM) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components or any combination of these components.

[0436] The training device of the coarse wrinkle detection model in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0437] The training device for the coarse wrinkle detection model in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0438] The training device for the coarse wrinkle detection model provided in the embodiment of the present application can achieve Fig.21 To avoid repetition, the various implementation processes will not be described here.

[0439] It should be noted that the above-mentioned training device for the coarse wrinkle detection model can execute the training method for the coarse wrinkle detection model provided in the above-mentioned embodiment, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the embodiment of the training device for the coarse wrinkle detection model, reference can be made to the training method for the coarse wrinkle detection model provided in the above-mentioned embodiment.

[0440] In an embodiment of the present application, a training device for a coarse wrinkle detection model is provided, and the coarse wrinkle detection model includes a first downsampling module, an encoder module, and a decoder module. The training device for the coarse wrinkle detection model includes: an image acquisition unit, used to acquire an image data set, wherein the image data set includes a first skin image; a data enhancement unit, used to perform a data enhancement operation on each first skin image to obtain a plurality of second skin images; an image compression unit, used to perform image compression on the second skin image based on the first downsampling module to obtain a compressed image; an encoding unit, used to perform feature extraction on the compressed image based on the encoder module to obtain a spliced ​​feature map; a decoding unit, used to perform a wrinkle classification operation on the spliced ​​feature map based on the decoder module to obtain a first coarse wrinkle image; and a training unit, used to construct a loss function, and train the coarse wrinkle detection model based on the loss function until the loss function converges to generate a trained coarse wrinkle detection model.

[0441] A data enhancement unit is used to perform a data enhancement operation on each first skin image to obtain a plurality of second skin images; an image compression unit is used to perform image compression on the second skin image based on a first downsampling module to obtain a compressed image; an encoding unit is used to perform feature extraction on the compressed image based on an encoder module to obtain a spliced ​​feature map; a decoding unit is used to perform a wrinkle classification operation on the spliced ​​feature map based on a decoder module to obtain a first coarse wrinkle image; a training unit is used to construct a loss function, and train a coarse wrinkle detection model based on the loss function until the loss function converges to generate a trained coarse wrinkle detection model. The present application can improve the generalization ability of the coarse wrinkle detection model, the accuracy of the coarse wrinkle detection model in coarse wrinkle detection, and the stability of the coarse wrinkle detection model.

[0442] Embodiment 7

[0443] The present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called by a processor, the processor executes the wrinkle detection method provided in the above embodiment, for example, Figure 3 The wrinkle detection method shown, or the wrinkle display method provided in the above embodiments, for example, Fig.14 The wrinkle display method shown, or the training method of the coarse wrinkle detection model provided in the above embodiment, for example, Fig.21 The training method of the coarse wrinkle detection model shown.

[0444] In the embodiments of the present application, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0445] In an embodiment of the present application, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as an independent program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0446] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0447] As an example, executable instructions may be deployed to be executed on a computing device (including devices such as smart terminals and servers), or on multiple computing devices located in one location, or on multiple computing devices distributed in multiple locations and interconnected by a communication network.

[0448] The present application also provides a computer program product, which includes one or more program codes stored in a computer-readable storage medium. The processor of the electronic device reads the program code from the computer-readable storage medium, and the processor executes the program code to complete the method steps of the wrinkle detection method or wrinkle display method or coarse wrinkle detection model training method provided in the above embodiments.

[0449] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0450] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0451] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A wrinkle detection method, characterized in that: include: Acquire a skin image of a human face, wherein the skin image includes multiple types of wrinkles, and the multiple types of wrinkles are located at different positions on the human face; According to the positions of different types of wrinkles on the face of the person, the skin image is cropped to obtain a local wrinkle image; Performing a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image; Extracting a first pixel region in the local wrinkle image, and performing an AND operation on the first pixel region and the feature enhancement image to obtain a mask image, wherein the first pixel region is a non-black pixel region in the local wrinkle image; A feature extraction operation is performed on the mask image to obtain a fine wrinkle image.

2. The method according to claim 1, characterized in that The local wrinkle image includes a forehead wrinkle image; The step of cropping the skin image according to the positions of different types of wrinkles on the face of the person to obtain a local wrinkle image includes: According to the position of the forehead wrinkles on the face of the person, the skin image is cropped to obtain a forehead wrinkle image; The step of performing a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image includes: Performing grayscale processing on the forehead wrinkle image to obtain a first grayscale image; Based on an adaptive threshold segmentation algorithm, binarizing the first grayscale image to obtain a binary image; Performing a closing operation on the binary image to obtain a closed operation image; Performing contour detection on the closed operation image, and deleting contour areas satisfying a first contour condition from the detected contour areas, so as to obtain a first contour image; performing dilation operations and erosion operations on the first contour image in sequence in the horizontal direction to obtain a feature-enhanced image of the forehead wrinkles; The first contour condition includes: the aspect ratio of the contour region is within a preset aspect ratio interval, or the beveling angle of the contour region is within a first preset angle interval, or the area of ​​the contour region is smaller than a preset area threshold.

3. The method according to claim 1, characterized in that The local wrinkle image includes a glabellar wrinkle image; The step of cropping the skin image according to the positions of different types of wrinkles on the face of the person to obtain a local wrinkle image includes: According to the position of the glabellar lines on the face of the person, the skin image is cropped to obtain a glabellar line image; The step of performing a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image includes: Performing color channel separation on the glabellar lines image to obtain a second grayscale image corresponding to a green channel; performing a filtering operation on the second grayscale image to obtain a third grayscale image; Threshold processing is performed on the third grayscale image to obtain a feature-enhanced image of the glabellar lines.

4. The method according to claim 1, characterized in that The local wrinkle image includes a crow's feet image or an eye periorbital fine wrinkle image; The step of cropping the skin image according to the positions of different types of wrinkles on the face of the person to obtain a local wrinkle image includes: According to the position of crow's feet on the face of the person, the skin image is cropped to obtain a crow's feet image; Alternatively, the skin image is cropped according to the positions of the fine lines around the eyes on the face of the person to obtain an image of the fine lines around the eyes; The step of performing a feature enhancement operation on the local wrinkle image to obtain a feature enhanced image includes: grayscale the crow's feet wrinkle image or the eye periorbital fine wrinkle image to obtain a first grayscale image; Based on an adaptive threshold segmentation algorithm, binarizing the first grayscale image to obtain a binary image; A closing operation is performed on the binary image to obtain a feature-enhanced image of the crow's feet or the fine lines around the eyes.

5. The method according to claim 3, characterized in that: The fine wrinkle image includes a wrinkle image of glabellar lines; The step of performing a feature extraction operation on the mask image to obtain a fine wrinkle image comprises: Performing contour extraction on the mask image of the glabellar lines, and deleting the contour area in the mask image that meets the second contour condition, so as to obtain a second contour image; performing a thinning operation on the second contour image to obtain a wrinkle image of the glabellar lines; The second contour condition includes: the aspect ratio of the contour area is within a preset aspect ratio interval, or the beveling angle of the contour area is within a second preset angle interval, or the area of ​​the contour area is smaller than a preset area threshold.

6. The method according to claim 4, characterized in that The fine wrinkle image includes a wrinkle image of fine wrinkles around the eyes; The step of performing a feature extraction operation on the mask image to obtain a fine wrinkle image comprises: Performing contour detection on the mask image of fine lines around the eyes, and deleting contour areas satisfying the third contour condition from the detected contour areas, so as to obtain a third contour image; Performing a thinning operation on the third contour image to obtain a thinned image; Traversing each independent contour in the thinned image, and connecting the highest point and the lowest point of each independent contour with a straight line to obtain a one-to-one connecting line segment for each independent contour; superimposing a plurality of the connecting line segments to obtain a wrinkle image of the fine lines around the eyes; The third contour condition includes: the beveling angle of the contour area is within a third preset angle interval, or the area of ​​the contour area is smaller than a preset area threshold.

7. The method according to claim 4, characterized in that The fine wrinkle image includes a wrinkle image of crow's feet; The step of performing a feature extraction operation on the mask image to obtain a fine wrinkle image comprises: Perform contour detection on the mask image of crow's feet wrinkles, and sort the detected contours in descending order of their area; Obtaining a preset number of contours according to the arrangement order of the contours; Determine the coordinates of the left boundary point and the right boundary point of each contour; Determine a curve state of the contour based on the coordinates of the left boundary point and the coordinates of the right boundary point, wherein the curve state includes an upward state or a downward state; Based on the state of the curve, determining the coordinates of the midpoint of the contour; Based on the coordinates of the left boundary point, the middle point and the right boundary point of each contour, a curve corresponding to each contour is obtained by fitting; Superimposing a plurality of the curves to obtain a wrinkle image of the crow's feet; Wherein, the coordinates include a ordinate value, and when the curve state is an upward state, the ordinate value of the midpoint is less than the median value of the ordinate; When the curve state is a downward tilt state, the ordinate value of the midpoint is greater than the median value of the ordinate; The median value of the ordinate is the average value of the ordinate value of the left boundary point and the ordinate value of the right boundary point.

8. A wrinkle display method, characterized in that: include: Acquire a skin image of a human face; Extracting coarse wrinkles in the skin image based on a coarse wrinkle detection model to obtain a coarse wrinkle image; The coarse wrinkle image and the fine wrinkle image are fused to obtain a facial wrinkle image, wherein the coarse wrinkle image and the fine wrinkle image correspond to the same skin image, and the fine wrinkle image is obtained according to the wrinkle detection method according to any one of claims 1-7.

9. An electronic device, characterized in that: include: at least one processor, and a memory communicatively coupled to the at least one processor, wherein: The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the wrinkle detection method according to any one of claims 1 to 7 or the wrinkle display method according to claim 8.

10. A computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions executable by a processor, wherein when the computer program instructions are called by the processor, the processor executes the wrinkle detection method according to any one of claims 1 to 7 or the wrinkle display method according to claim 8.

Citation Information

Cited By

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

    CN121599908A