Facial contour automatic smoothing processing method, device, electronic device and storage medium
By performing face detection and facial contour point screening on user images, combined with Gaussian smoothing and cubic curve fitting processing, the method of automatically adjusting the face shape is realized, solving the problem of unable to automatically smooth the face shape in the existing technology, and providing a more natural and flexible processing effect.
Patent Information
- Application Number
- CN202210115560.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-07
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-02-07
AI Technical Summary
Existing beauty software cannot automatically adjust the user's face shape and contour defects, resulting in the face shape not being smooth enough after taking a photo and cannot meet the user's automatic contour adjustment needs.
By performing face detection and facial contour point extraction on user images, calculating distance and/or angle, filtering available contour points, and performing Gaussian smoothing and cubic curve fitting processing, a smooth contour is obtained.
The effect of automatically smoothing the profile for users with different profile features is achieved. The processing results are natural and have a wide range of applications, avoiding the fixation of the outline correction object.
Smart Images

Figure SMS_1 
Figure SMS_4 
Figure SMS_13
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a facial contour automatic smoothing processing method and a device, electronic equipment and computer-readable storage medium applying the method. Background Art
[0002] Facial contour (i.e. face shape) has a great influence on a person's appearance. The facial contour includes the upper and lower contours. The upper part is an arc-shaped structure composed of the maxilla, zygomatic bone, temporal bone, frontal bone and parietal bone, while the lower part depends on the shape of the mandible. According to the characteristics of Asian faces, they can generally be divided into: almond-shaped face, oval face, round face, oblong face, square face, rectangular face, diamond face and triangular face.
[0003] Although different face shapes have different styles of beauty, some facial features bring certain troubles to users in daily life. For example, sunken temples, prominent cheekbones, sunken apple muscles and other facial features will make the face look stiff and old. Most users tend to prefer smooth and flowing facial contours and pursue an oval face with a "girly feel". Facial fillers and cheekbone reduction surgeries are popular projects in the field of medical beauty, so users also expect their faces to look young, plump and smooth when taking photos.
[0004] However, the beauty software currently on the market usually only uses contour adjustment solutions with fixed position and strength, and is unable to adjust for the user's facial contour defects, resulting in the user's face being less smooth or even more uneven after taking pictures. The user needs to manually adjust the face to achieve a smooth contour effect, and is unable to meet the user's needs for automated contour adjustment. Summary of the invention
[0005] The main purpose of the present invention is to provide a facial contour automatic smoothing processing method, device, electronic device and storage medium, so as to achieve the effect of automatic contour smoothing for users with different contour features.
[0006] To achieve the above object, the present invention provides a facial contour automatic smoothing method, which comprises the following steps:
[0007] Perform face detection on the user image and extract facial contour points based on the face detection results;
[0008] Calculating the distance and / or angle of the facial contour points, and screening available contour points according to the calculation results;
[0009] The available contour points are subjected to Gaussian smoothing processing and cubic curve fitting processing in sequence to obtain a smooth contour.
[0010] Preferably, the extraction of facial contour points further comprises:
[0011] Extract the initial contour point set P0 from the face detection results;
[0012] Performing facial segmentation on the user image to obtain a mask image M marking the facial area;
[0013] The mask image M is used to search and mark the connected areas of the initial contour point set P0, and the facial contour points are extracted according to the marking results.
[0014] Preferably, further comprising:
[0015] Performing morphological dilation and erosion processing on the mask image M to obtain an outer contour point set PL0 of the mask image M;
[0016] Performing interpolation processing or smoothing extension processing on the contour points of the initial contour point set P0 to obtain a modified contour point set P1;
[0017] The point whose vertical distance in the normal direction between the contour point in the outer contour point set PL0 of the mask image M and the contour point in the modified contour point set P1 is shortest is selected to obtain the final facial contour point PL1.
[0018] Preferably, calculating the distances of the facial contour points to screen available contour points further comprises:
[0019] Calculate the vertical distance between the facial contour point and the initial contour point in the normal direction;
[0020] A threshold value is calculated for the vertical distance, and facial contour points with a vertical distance less than a preset threshold value are screened as available contour points, or facial contour points with a vertical distance greater than or equal to the preset threshold value are screened as unavailable points.
[0021] Preferably, calculating the angles of the facial contour points to screen available contour points further comprises:
[0022] Calculate the angle change of facial contour points;
[0023] A threshold value is calculated for the angle variation, and facial contour points whose angle variation is less than a preset threshold value are screened as available contour points, or facial contour points whose angle variation is greater than or equal to the preset threshold value are screened as unavailable points.
[0024] Preferably, the contour area where the unusable point is located is further interpolated and corrected based on adjacent available contour points as reference points; the interpolation correction method is as follows:
[0025] For unavailable points in the temple concave area, extending and interpolating the contour of the concave area along the contour tangent direction of the available contour point;
[0026] For other unavailable points outside the temple depression area, linear interpolation is performed using the available contour points at both ends of the unavailable area;
[0027] The number of interpolated contour points is consistent with the number of unavailable points.
[0028] Preferably, Gaussian smoothing is performed on the available contour points, and the calculation formula is as follows:
[0029]
[0030] are available contour points within the preset radius. is a Gaussian weight; the preset radius range is preferably 5 pixels;
[0031] Based on the Gaussian smoothing results, cubic curve fitting is performed, and the fitting formula is as follows:
[0032]
[0033] in, is the x-coordinate of the contour point after Gaussian smoothing, is the y coordinate of the contour point after Gaussian smoothing, and a, b, c, and d are the fitting coefficients.
[0034] Preferably, the user's profile degree is further calculated, and a corresponding Gaussian smoothing weight is set according to the profile degree: the greater the profile degree, the smaller the Gaussian smoothing weight of the inner side of the profile; the facial contour points after Gaussian smoothing are calculated according to the Gaussian smoothing weight, and the calculation formula is as follows:
[0035]
[0036] in, is the facial contour point after Gaussian smoothing, is the facial contour point before Gaussian smoothing, is the Gaussian smoothing weight corresponding to the profile degree, is the smoothing deformation; The judgment is made by using the distance ratio between the left and right contour points and the center point between the eyes, and the Gaussian smoothing weight value corresponding to the degree of profile is calculated based on the distance ratio.
[0037] Preferably, the distance between the eyes and the mouth and the facial contour points is further calculated, and the closer the distance is, the smaller the Gaussian smoothing weight is.
[0038] Preferably, the facial contour points are further interpolated inwardly and outwardly to obtain a deformed mesh of the contour area; and the smooth contour is deformed and rendered according to the deformed mesh to obtain a result image of the user image after contour smoothing.
[0039] Corresponding to the facial contour automatic smoothing processing method, the present invention provides a facial contour automatic smoothing processing device, which comprises:
[0040] The contour point extraction module is used to perform face detection on the user image and extract facial contour points based on the face detection result;
[0041] A contour point screening module, used to calculate the distance and / or angle of the facial contour points, and screen available contour points according to the calculation results;
[0042] The contour smoothing module is used to perform Gaussian smoothing processing and cubic curve fitting processing on the available contour points in sequence to obtain a smooth contour.
[0043] In addition, to achieve the above-mentioned purpose, the present invention also provides an electronic device, which includes a memory, a processor, and a facial contour automatic smoothing processing program stored in the memory and executable on the processor, wherein the facial contour automatic smoothing processing program, when executed by the processor, implements the steps of the facial contour automatic smoothing processing method as described above.
[0044] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a facial contour automatic smoothing processing program is stored. When the facial contour automatic smoothing processing program is executed by a processor, the steps of the facial contour automatic smoothing processing method as described above are implemented.
[0045] The beneficial effects of the present invention are:
[0046] (1) The present invention screens facial contour points and performs smoothing on available contour points, thereby avoiding the fixation of contour correction objects. The present invention is more flexible, has a wider range of applications, and has a more natural processing effect. It can achieve the effect of automatically smoothing contours for users with different contour features.
[0047] (2) The present invention first performs Gaussian smoothing on the available contour points to shrink the prominent contour areas such as the cheekbones; and then performs cubic curve fitting processing, which not only makes the contour smoother, but also does not make the smoothed facial contour fatter than the original image;
[0048] (3) The present invention combines the mask image of the facial area to search and mark the connected area of the initial contour points, which can quickly extract facial contour points and quickly and accurately screen contour points;
[0049] (4) The present invention adopts different correction methods (interpolation correction or extension correction) for contour points in different contour areas, so that the smoothing effect of the corrected contour points is better;
[0050] (5) The present invention further combines the profile of the user and sets different smoothing weights according to the profile to avoid image distortion;
[0051] (6) The present invention can automatically and smoothly adjust the user's facial contour by accurately identifying the user's facial contour, thereby retaining the user's facial shape and ensuring the smoothness of the contour, greatly facilitating the user and solving the problem that the user needs complex and tedious manual operations to achieve a smooth face shape. It realizes intelligent beautification, meets the user's facial shape refinement needs, and improves the user's efficiency in photo editing. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the specific embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0053] The present embodiment provides a facial contour automatic smoothing processing method, which comprises the following steps:
[0054] Step 10 (contour point extraction): perform face detection on the user image, and extract facial contour points based on the face detection result;
[0055] Step 20 (contour point screening): calculating the distance and / or angle of the facial contour points, and screening available contour points according to the calculation results;
[0056] Step 30 (contour smoothing): performing Gaussian smoothing and cubic curve fitting processing on the available contour points in sequence to obtain a smooth contour.
[0057] In step 10, the extraction of facial contour points further includes:
[0058] Step 11: Extract the initial contour point set P0 from the face detection result;
[0059] Step 12: performing facial segmentation on the user image to obtain a mask image M marking the facial area; preferably, further calculating the face frame area according to the initial contour point set P0, and cropping and scaling the mask image M to a preset size;
[0060] Step 13: Search and mark the connected areas of the initial contour point set P0 using the mask image M, and extract the facial contour points according to the marking results.
[0061] The step 13 further comprises:
[0062] Step 131: performing morphological dilation and erosion processing on the mask image M to obtain an outer contour point set PL0 of the mask image M; this step mainly connects the disconnected areas in the mask image through morphological dilation and erosion processing; the outer contour point set PL0 is the longest contour in the face area;
[0063] Step 132: performing interpolation processing or smoothing extension processing on the contour points of the initial contour point set P0 to obtain a modified contour point set P1; for example, performing interpolation processing on a sparse contour point area to obtain dense contour points, and performing extension processing on a disconnected contour point area to obtain continuous contour points;
[0064] Step 133: Select the point whose normal distance in the outer contour point set PL0 of the mask image M is closest to the point in the normal direction of the contour point in the modified contour point set P1, and obtain the final facial contour point PL1. (Since the outer contour point set PL0 of the mask image M is very dense and has no semantic information, this embodiment further selects the sparse contour points within the facial contour range by combining the initial contour point set P0 with the modified contour point set P1, i.e., the facial contour point PL1)
[0065] This embodiment selects the point with the shortest vertical distance in the normal direction between the contour point in the outer contour point set PL0 of the mask image M and the contour point in the corrected contour point set P1 as the final facial contour point PL1, instead of using the shortest distance method, so as to avoid uneven distances between points selected in areas with large deviations between contours and facial points.
[0066] In step 20, since the mask image M is inaccurate or blocked, the facial contour points PL1 may include points that deviate greatly from the facial contour. Therefore, this embodiment further calculates the distance and / or angle of the facial contour points to screen available contour points, wherein the distance calculation further includes:
[0067] Step 21: Calculate the vertical distance between the facial contour point and the initial contour point in the normal direction;
[0068] Step 22: performing threshold calculation on the vertical distance, filtering the facial contour points whose vertical distance is less than the preset threshold as available contour points, or filtering the facial contour points whose vertical distance is greater than or equal to the preset threshold as unavailable points.
[0069] The angle calculation further includes:
[0070] Step 23: Calculate the angle change of the facial contour points;
[0071] Step 24: performing threshold calculation on the angle variation, filtering the facial contour points whose angle variation is less than a preset threshold as available contour points, or filtering the facial contour points whose angle variation is greater than or equal to the preset threshold as unavailable points.
[0072] It should be noted that steps 21, 22, 23, and 24 do not necessarily need to be executed in sequence, but are just for the convenience of distinguishing each step; wherein, steps 21 and 22 can be executed separately, and steps 23 and 24 can be executed separately; or, steps 21 and 23 can be executed synchronously, and steps 22 and 24 can be executed synchronously, without being limited thereto.
[0073] The distance calculation further includes angle calculation: by calculating the distance and angle between the facial contour point PL1 and the initial contour point P0, inaccurate points with too large distance and angle in PL1 are preliminarily screened out.
[0074] The angle variation is obtained by calculating the curvature of the facial contour point PL1 itself, and calculating continuous angle variations according to the curvature, thereby filtering out unusable points with too large variations.
[0075] In step 20, the contour area where the unusable point is located is further interpolated and corrected based on adjacent available contour points as reference points; the interpolation correction method is as follows:
[0076] For unavailable points in the temple sunken area (preferably the number of unavailable points is less than 5), extending and interpolating the sunken area contour along the contour tangent direction on one side of the available contour points;
[0077] For other unavailable points (preferably the number of unavailable points is less than 5) outside the temple concave area (such as the cheek area), linear interpolation is performed using available contour points at both ends of the unavailable area;
[0078] The number of interpolated contour points is consistent with the number of unavailable points.
[0079] Through the above linear interpolation and extended interpolation algorithms, unusable points are corrected to usable points, and the final smoothing point PL2 is obtained, which can maximize the use of more contour points.
[0080] In step 30, this embodiment preferably selects a contour set L of continuous available contour points for the contour point PL2, and performs smoothing calculation on the contours in L with a length greater than 8 points. The smoothing calculation further includes:
[0081] Step 31: Perform Gaussian smoothing on the available contour points. The calculation formula is as follows:
[0082]
[0083] are available contour points within the preset radius. is a Gaussian weight; the preset radius range is preferably 5 pixels;
[0084] Step 32: Perform cubic curve fitting based on the Gaussian smoothing result. The fitting formula is as follows:
[0085]
[0086] in, is the x-coordinate of the contour point after Gaussian smoothing, is the y coordinate of the contour point after Gaussian smoothing, and a, b, c, and d are the fitting coefficients.
[0087] When the cubic curve is fitted, the fitting weights at both ends of the contour are increased to avoid an unsmooth transition at the joint due to excessive changes at both ends.
[0088] This embodiment also includes step 33: further calculating the profile degree of the user, and setting the corresponding Gaussian smoothing weight according to the profile degree: the greater the profile degree, the smaller the Gaussian smoothing weight of the inner side of the profile; and calculating the facial contour points after Gaussian smoothing according to the Gaussian smoothing weight, the calculation formula is as follows:
[0089]
[0090] in, is the facial contour point after Gaussian smoothing, is the facial contour point before Gaussian smoothing, is the Gaussian smoothing weight corresponding to the profile degree, is the smoothing deformation; The judgment is made by using the distance ratio of the left and right contour points to the center point between the eyes, and the Gaussian smoothing weight value corresponding to the profile degree is calculated according to the distance ratio. Preferably, the distance between the eyes and the mouth and the facial contour points is further calculated, and the closer the distance is, the smaller the Gaussian smoothing weight is, so as to avoid deformation of the eyes and mouth and distortion of the picture.
[0091] In this embodiment, step 40 is also included: further inward interpolation and outward interpolation are performed on the facial contour points to obtain a deformed mesh of the contour area; and deformation rendering is performed on the smooth contour according to the deformed mesh to obtain a result image of the user image after contour smoothing.
[0092] This embodiment also provides a facial contour automatic smoothing processing device, which includes:
[0093] The contour point extraction module is used to perform face detection on the user image and extract facial contour points based on the face detection result;
[0094] A contour point screening module, used to calculate the distance and / or angle of the facial contour points, and screen available contour points according to the calculation results;
[0095] The contour smoothing module is used to perform Gaussian smoothing processing and cubic curve fitting processing on the available contour points in sequence to obtain a smooth contour.
[0096] This embodiment also provides an electronic device, which includes the automatic smoothing processing device for facial contours as described above, wherein the automatic smoothing processing device for facial contours can execute the technical solution of the method embodiment, and its implementation principle and technical effects are similar. For details, please refer to the relevant records in the above embodiments, which will not be repeated here.
[0097] The electronic device includes: an electronic device with a camera function such as a mobile phone, a digital camera or a tablet computer, or an electronic device with an image processing function, or an electronic device with an image display function. The electronic device may include components such as a memory, a processor, an input unit, a display unit, and a power supply.
[0098] Among them, the memory can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 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 volatile solid-state storage devices. Accordingly, the memory may also include a memory controller to provide the processor and the input unit with access to the memory.
[0099] The input unit can be used to receive input digital or character or image information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit of this embodiment includes not only a camera, but also a touch-sensitive surface (such as a touch display) and other input electronic devices.
[0100] The display unit can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit may include a display panel, and optionally, the display panel may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface may cover the display panel, and when the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor to determine the type of touch event, and then the processor provides a corresponding visual output on the display panel according to the type of touch event.
[0101] This embodiment also provides a computer-readable storage medium, which may be a computer-readable storage medium contained in the memory in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled in an electronic device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement the automatic smoothing processing method for facial contours. The computer-readable storage medium may be a read-only memory, a disk, or an optical disk, etc.
[0102] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, electronic device embodiment and storage medium embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0103] Furthermore, in this document, the terms "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or electronic device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or elements that are inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.
[0104] The above description shows and describes the preferred embodiments of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the invention, through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not depart from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.
Claims
1. A facial contour automatic smoothing method, characterized in that: The following steps are involved: Perform face detection on the user image and extract facial contour points based on the face detection results; Calculating the distance and / or angle of the facial contour points, and screening available contour points according to the calculation results; Performing Gaussian smoothing and cubic curve fitting on the available contour points in sequence to obtain a smooth contour; The extraction of facial contour points further comprises: Extract the initial contour point set P0 from the face detection results; Performing facial segmentation on the user image to obtain a mask image M marking the facial area; Searching and marking the connected areas of the initial contour point set P0 by using the mask image M, and extracting the facial contour points according to the marking results; Performing morphological dilation and erosion processing on the mask image M to obtain an outer contour point set PL0 of the mask image M; Performing interpolation processing or smoothing extension processing on the contour points of the initial contour point set P0 to obtain a modified contour point set P1; The point whose vertical distance in the normal direction between the contour point in the outer contour point set PL0 of the mask image M and the contour point in the modified contour point set P1 is shortest is selected to obtain the final facial contour point PL1.
2. The method for automatic smoothing of facial contour according to claim 1, characterized in that: Calculating the distances of the facial contour points to screen available contour points further includes: Calculate the vertical distance between the facial contour point and the initial contour point in the normal direction; A threshold value is calculated for the vertical distance, and facial contour points with a vertical distance less than a preset threshold value are screened as available contour points, or facial contour points with a vertical distance greater than or equal to the preset threshold value are screened as unavailable points.
3. The method for automatic smoothing of facial contour according to claim 2, characterized in that: Calculating the angles of the facial contour points to screen available contour points further includes: Calculate the angle change of facial contour points; A threshold value is calculated for the angle variation, and facial contour points whose angle variation is less than a preset threshold value are screened as available contour points, or facial contour points whose angle variation is greater than or equal to the preset threshold value are screened as unavailable points.
4. The method for automatic smoothing of facial contour according to claim 3, characterized in that: Further, the contour area where the unavailable point is located is interpolated and corrected based on the adjacent available contour points as reference points; the interpolation correction method is as follows: For unavailable points in the temple concave area, extending and interpolating the contour of the concave area along the contour tangent direction of the available contour point; For other unavailable points outside the temple depression area, linear interpolation is performed using the available contour points at both ends of the unavailable area; The number of interpolated contour points is consistent with the number of unavailable points.
5. The method for automatic smoothing of facial contour according to claim 1, characterized in that: Gaussian smoothing is performed on the available contour points, and the calculation formula is as follows: are available contour points within the preset radius. is a Gaussian weight; the preset radius range is 5 pixels; Based on the Gaussian smoothing results, cubic curve fitting is performed, and the fitting formula is as follows: in, is the x-coordinate of the contour point after Gaussian smoothing, is the y coordinate of the contour point after Gaussian smoothing, and a, b, c, and d are the fitting coefficients.
6. A facial contour automatic smoothing method according to any one of claims 1 to 5, characterized in that: The user's profile degree is further calculated, and the corresponding Gaussian smoothing weight is set according to the profile degree: the greater the profile degree, the smaller the Gaussian smoothing weight of the inner side of the profile; the facial contour points after Gaussian smoothing are calculated according to the Gaussian smoothing weight, and the calculation formula is as follows: in, is the facial contour point after Gaussian smoothing, is the facial contour point before Gaussian smoothing, is the Gaussian smoothing weight corresponding to the profile degree, is the smoothing deformation; The judgment is made by using the distance ratio between the left and right contour points and the center point between the eyes, and the Gaussian smoothing weight value corresponding to the degree of profile is calculated based on the distance ratio.
7. The method for automatic smoothing of facial contour according to claim 6, characterized in that: The distances between the eyes and the mouth and the facial contour points are further calculated, and the closer the distances are, the smaller the Gaussian smoothing weights are.
8. The method for automatic smoothing of facial contour according to any one of claims 1 to 5, characterized in that: The facial contour points are further interpolated inwardly and outwardly to obtain a deformed mesh of the contour area; the smooth contour is deformed and rendered according to the deformed mesh to obtain a result image of the user image after contour smoothing.
9. A facial contour automatic smoothing processing device, characterized in that: include: The contour point extraction module is used to perform face detection on the user image and extract facial contour points based on the face detection result; A contour point screening module, used to calculate the distance and / or angle of the facial contour points, and screen available contour points according to the calculation results; A contour smoothing module, used for sequentially performing Gaussian smoothing processing and cubic curve fitting processing on the available contour points to obtain a smooth contour; The extraction of facial contour points further comprises: Extract the initial contour point set P0 from the face detection results; Performing facial segmentation on the user image to obtain a mask image M marking the facial area; Searching and marking the connected areas of the initial contour point set P0 by using the mask image M, and extracting the facial contour points according to the marking results; Performing morphological dilation and erosion processing on the mask image M to obtain an outer contour point set PL0 of the mask image M; Performing interpolation processing or smoothing extension processing on the contour points of the initial contour point set P0 to obtain a modified contour point set P1; The point whose vertical distance in the normal direction between the contour point in the outer contour point set PL0 of the mask image M and the contour point in the modified contour point set P1 is shortest is selected to obtain the final facial contour point PL1.
10. An electronic device, characterized in that: The electronic device includes a memory, a processor, and a facial contour automatic smoothing processing program stored in the memory and executable on the processor. When the facial contour automatic smoothing processing program is executed by the processor, the steps of the facial contour automatic smoothing processing method as described in any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a facial contour automatic smoothing processing program, and when the facial contour automatic smoothing processing program is executed by the processor, the steps of the facial contour automatic smoothing processing method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Figure outline setting method, shooting terminal, figure image blurring method and system
CN105389801A
Image processing method and device, terminal and storage medium
CN109325924A