CN114596221A - Face contour automatic smoothing method and device, electronic equipment and storage medium - Google Patents

Face contour automatic smoothing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114596221A
CN114596221A CN202210115560.6A CN202210115560A CN114596221A CN 114596221 A CN114596221 A CN 114596221A CN 202210115560 A CN202210115560 A CN 202210115560A CN 114596221 A CN114596221 A CN 114596221A
Authority
CN
China
Prior art keywords
contour
face
points
smoothing
contour points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210115560.6A
Other languages
Chinese (zh)
Inventor
戴吟臻
李明悦
林继亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Meitu Technology Co Ltd
Original Assignee
Xiamen Meitu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Meitu Technology Co Ltd filed Critical Xiamen Meitu Technology Co Ltd
Priority to CN202210115560.6A priority Critical patent/CN114596221A/en
Publication of CN114596221A publication Critical patent/CN114596221A/en
Pending legal-status Critical Current

Links

Classifications

    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Abstract

The invention discloses a face contour automatic smoothing processing method, a face contour automatic smoothing processing device, electronic equipment and a storage medium, wherein face contour points are extracted according to a face detection result by carrying out face detection on a user image; calculating the distance and/or angle of the face contour points, and screening available contour points according to the calculation result; and sequentially carrying out Gaussian smoothing processing and cubic curve fitting processing on the available contour points to obtain a smooth contour: the invention can automatically and smoothly adjust the face contour of the user by accurately identifying the face contour of the user, not only retains the face shape of the user, but also ensures the smooth and fluent contour, is greatly convenient for the user, solves the problem that the user can repair the smooth face shape only by complicated and tedious manual operation, realizes intelligent beauty, meets the face shape fine-repair requirement of the user, and also improves the picture-repairing efficiency of the user.

Description

Face contour automatic smoothing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method for automatically smoothing a face contour, and a device, an electronic device, and a computer-readable storage medium using the method.
Background
The facial contour (i.e., facial shape) has a large influence on the appearance of a person. The facial contour comprises an upper half contour and a lower half contour, wherein the upper half is a circular arc structure consisting of a maxilla, a zygomatic bone, a temporal bone, a frontal bone and a parietal bone, and the lower half depends on the shape of a mandible. According to the characteristics of Asian facial shapes, the facial shapes can be generally divided into almond facial shapes, oval facial shapes, round facial shapes, long round facial shapes, square facial shapes, rectangular facial shapes, rhombic facial shapes and triangular facial shapes.
Although various facial shapes have different styles of beauty, in daily life, some facial features bring certain troubles to users, for example, facial features such as suncave, zygomatic bone protrusion, apple muscle depression and the like can make the face look stiff and old. Most users tend to prefer smooth face contours, a goose egg face with a 'girl' feeling is pursued, image face filling, zygomatic bone reduction and the like are more popular items in the medical and beauty field, and therefore the users also expect that the face looks young, full and smooth when taking pictures.
However, the existing facial makeup software on the market usually only adopts a contour adjustment scheme with fixed position and force, and cannot adjust the facial contour defects of the user, so that the facial contour of the user after photographing is not smooth enough or even more uneven, the user needs to manually adjust the facial contour to achieve the effect of smooth contour, and the requirement of the user on automatic contour adjustment cannot be met.
Disclosure of Invention
The invention mainly aims to provide a face contour automatic smoothing method, a face contour automatic smoothing device, electronic equipment and a storage medium, and the face contour automatic smoothing method, the face contour automatic smoothing device, the electronic equipment and the storage medium can achieve the effect of automatically smoothing contours of users with different contour characteristics.
In order to achieve the above object, the present invention provides an automatic face contour smoothing method, which comprises the following steps:
carrying out face detection on the user image, and extracting face contour points according to a face detection result;
calculating the distance and/or angle of the face contour points, and screening available contour points according to the calculation result;
and sequentially carrying out Gaussian smoothing processing and cubic curve fitting processing on the available contour points to obtain a smooth contour.
Preferably, the extracting of the face contour points further comprises:
extracting an initial contour point set P0 from the face detection result;
carrying out face segmentation on the user image to obtain a mask image M marking a face region;
and searching and marking a connected region for the initial contour point set P0 through the mask image M, and extracting the face contour points according to a marking result.
Preferably, further comprising:
performing morphological expansion and corrosion treatment on the mask image M to obtain an outer contour point set PL0 of the mask image M;
carrying out interpolation processing or smooth extension processing on the contour points of the initial contour point set P0 to obtain a corrected contour point set P1;
and selecting the contour point in the outer contour point set PL0 of the mask image M and the point which is closest to the contour point in the normal direction of the contour point in the corrected contour point set P1 in the vertical distance to obtain the final face contour point PL 1.
Preferably, the distance calculation is performed on the face contour points to filter available contour points, and further includes:
calculating the vertical distance between the face contour point and the initial contour point in the normal direction;
and performing threshold calculation on the vertical distance, and screening face contour points with the vertical distance smaller than a preset threshold value as available contour points, or screening face contour points with the vertical distance larger than or equal to the preset threshold value as unavailable points.
Preferably, the calculating of the angles of the face contour points to screen the available contour points further includes:
calculating the angle variation of the face contour points;
and performing threshold calculation on the angle variation, and screening face contour points with the angle variation smaller than a preset threshold value as available contour points, or screening face contour points with the angle variation larger than or equal to the preset threshold value as unavailable points.
Preferably, interpolation correction is further performed on the contour region where the unavailable point is located according to the adjacent available contour point as a reference point; the interpolation correction method comprises the following steps:
for the unavailable points of the temple recessed area, carrying out extended interpolation on the contour of the recessed area along the contour tangential direction on one side of the available contour points;
for other unavailable points outside the depressed area of the temple, linear interpolation is carried out by adopting available contour points at two ends of the unavailable area;
wherein the number of interpolated contour points coincides with the number of unavailable points.
Preferably, the available contour points are subjected to gaussian smoothing, and the calculation formula is as follows:
Figure BDA0003496197960000031
wherein p isiIs a usable contour point within a preset radius range, wiIs a Gaussian weight; the preset radius range is preferably 5 pixel points;
and carrying out cubic curve fitting processing based on the Gaussian smoothing processing result, wherein a fitting formula is as follows:
Figure BDA0003496197960000032
wherein p isxIs the x-coordinate, p, of the Gaussian smoothed contour pointyAnd a, b, c and d are fitting coefficients of the y coordinate of the contour point after Gaussian smoothing.
Preferably, the side face degree of the user is further calculated, and a corresponding gaussian smoothing weight is set according to the side face degree: the larger the side face degree is, the smaller the Gaussian smoothing weight of the inner side of the side face is; and calculating the face contour points after Gaussian smoothing according to the Gaussian smoothing weight, wherein the calculation formula is as follows:
p=pori+pΔ*wLR
wherein p is a face contour point after Gaussian smoothing, poriIs a facial contour point before Gaussian smoothing, wLRIs a Gaussian smoothing weight, p, corresponding to the degree of sidednessΔIs a smooth deformation quantity; said wLRJudging by adopting the distance ratio from the left and right contour points to the center point between eyes, and calculating a Gaussian smooth weight value corresponding to the side face degree according to the distance ratio.
Preferably, distances between eyes and mouth and the face contour point are further calculated, and the closer the distance is, the smaller the Gaussian smoothing weight is.
Preferably, the face contour points are further subjected to inward interpolation and outward interpolation to obtain a deformation grid of a contour region; and performing deformation rendering on the smooth contour according to the deformation grid to obtain a result image of the user image after contour smoothing.
Corresponding to the face contour automatic smoothing method, the invention provides a face contour automatic smoothing device, which comprises:
the contour point extraction module is used for carrying out face detection on the user image and extracting face contour points according to a face detection result;
the contour point screening module is used for calculating the distance and/or the angle of the face contour points and screening available contour points according to the calculation result;
and the contour smoothing module is used for sequentially carrying out Gaussian smoothing processing and cubic curve fitting processing on the available contour points to obtain a smooth contour.
Furthermore, to achieve the above object, the present invention further provides an electronic device, which includes a memory, a processor and a face contour automatic smoothing program stored on the memory and executable on the processor, wherein the face contour automatic smoothing program, when executed by the processor, implements the steps of the face contour automatic smoothing method as described above.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a face contour automatic smoothing processing program which, when executed by a processor, implements the steps of the face contour automatic smoothing processing method as described above.
The invention has the beneficial effects that:
(1) according to the invention, the available contour points are smoothed by screening the face contour points, so that the fixation of a contour correction object is avoided, the method is more flexible, the application range is wider, the processing effect is more natural, and the effect of automatically smoothing the contour of users with different contour characteristics can be achieved;
(2) the method comprises the steps of carrying out Gaussian smoothing on available contour points to shrink contour protruding areas such as cheekbones and the like; through the cubic curve fitting treatment, the contour can be smoother, and the smooth face contour can not become fat than the original image;
(3) the method carries out search and marking of the communication area on the initial contour points by combining the mask image of the face area, can realize rapid extraction of the face contour points, and can rapidly and accurately screen the contour points;
(4) according to the invention, different correction methods (interpolation correction or extension correction) are adopted for the contour points of different contour areas, so that the smoothing effect of the corrected contour points is better;
(5) the invention further combines the side face degree of the user, and sets different smooth weights according to the side face degree, thereby avoiding image distortion;
(6) the invention can automatically and smoothly adjust the face contour of the user by accurately identifying the face contour of the user, not only retains the face shape of the user, but also ensures the smooth and fluent contour, is greatly convenient for the user, solves the problem that the user can repair the smooth face shape only by complicated and tedious manual operation, realizes intelligent beauty, meets the face shape fine-repair requirement of the user, and also improves the picture-repairing efficiency of the user.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to specific embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The automatic face contour smoothing method of the present embodiment includes the following steps:
step 10 (contour point extraction): carrying out face detection on the user image, and extracting face contour points according to a face detection result;
step 20 (contour point screening): calculating the distance and/or angle of the face contour points, and screening available contour points according to the calculation result;
step 30 (contour smoothing): and sequentially carrying out Gaussian smoothing processing and cubic curve fitting processing on the available contour points to obtain a smooth contour.
In the step 10, the extracting of the face contour points further includes:
step 11: extracting an initial contour point set P0 from the face detection result;
step 12: carrying out face segmentation on the user image to obtain a mask image M marking a face region; preferably, a face frame region is further calculated according to the initial contour point set P0, and the mask image M is cut and scaled to a preset size;
step 13: and searching and marking a connected region for the initial contour point set P0 through the mask image M, and extracting the face contour points according to a marking result.
Step 13 further includes:
step 131: performing morphological expansion and corrosion treatment on the mask image M to obtain an outer contour point set PL0 of the mask image M; the step is mainly to connect disconnected areas in the mask image through morphological expansion and corrosion treatment; the outer contour point set PL0 is the longest contour in the face region;
step 132: carrying out interpolation processing or smooth extension processing on the contour points of the initial contour point set P0 to obtain a corrected contour point set P1; for example, interpolating a sparse region of contour points to obtain dense contour points, and extending a disconnected region of contour points to obtain continuous contour points;
step 133: and selecting a point which is closest to the contour point in the outline point set PL0 of the mask image M in the vertical distance in the normal direction of the contour point in the corrected contour point set P1 to obtain a final face contour point PL 1. (since the outer contour point set PL0 of the mask image M is very dense and has no semantic information, the embodiment further selects sparse contour points within the face contour range, namely the face contour points PL1, by combining the corrected contour point set P1 of the initial contour point set P0)
In this embodiment, by selecting, as the final face contour point PL1, a point having the closest 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, instead of using the shortest distance method, it is possible to avoid the distance unevenness between points selected from the region having a large deviation between the contour and the face point.
In the step 20, since the mask image M has inaccuracy or occlusion, etc., and the facial contour point PL1 may include a point having a large deviation from the facial contour, the embodiment further performs distance and/or angle calculation on the facial contour point to screen a usable contour point, where the distance calculation further includes:
step 21: calculating the vertical distance between the face contour point and the initial contour point in the normal direction;
step 22: and performing threshold calculation on the vertical distance, and screening face contour points with the vertical distance smaller than a preset threshold value as available contour points, or screening face contour points with the vertical distance larger than or equal to the preset threshold value as unavailable points.
The calculation of the angle further comprises:
step 23: calculating the angle variation of the face contour points;
step 24: and performing threshold calculation on the angle variation, and screening face contour points with the angle variation smaller than a preset threshold value as available contour points, or screening face contour points with the angle variation larger than or equal to the preset threshold value as unavailable points.
It should be noted that steps 21, 22, 23, and 24 do not indicate that they need to be performed in sequence, but are merely for convenience of distinguishing the steps; wherein, steps 21 and 22 can be executed independently, and steps 23 and 24 can be executed independently; alternatively, steps 21 and 23 may be executed synchronously, and steps 22 and 24 may be executed synchronously, but not limited thereto.
The distance calculation further comprises the following calculation of an included angle: inaccurate points with too large distance and included angle in PL1 are preliminarily screened out by calculating the distance and included angle between the facial contour point PL1 and the initial contour point P0.
The angle change amount is calculated by calculating the curvature of the face contour point PL1 itself, and a continuous angle change amount is calculated from the curvature, thereby screening out an unusable point having a too large change amount.
In step 20, interpolation correction is further performed on the contour region where the unavailable point is located according to the adjacent available contour points as reference points; the interpolation correction method comprises the following steps:
for the unavailable points (preferably, the number of the unavailable points is less than 5), carrying out extended interpolation on the contour of the depressed area along the contour tangential direction on one side of the available contour points;
for other unavailable points (preferably, the number of the unavailable points is less than 5) outside the temple concave region (such as the cheek region), linear interpolation is carried out by using available contour points at two ends of the unavailable region;
wherein the number of interpolated contour points coincides with the number of unavailable points.
By the above algorithm of linear interpolation and extended interpolation, the unusable points are corrected to usable points, and the final smoothing point PL2 is obtained, so that more contour points can be utilized to the maximum extent.
In the step 30, in this embodiment, a contour set L of continuous available contour points is preferably selected for the contour points PL2, and a contour with a length greater than 8 points in L is subjected to a smoothing calculation. The smoothing calculation further comprises:
step 31: and performing Gaussian smoothing processing on the available contour points, wherein the calculation formula is as follows:
p=∑pi*wi
wherein p isiIs a usable contour point within a preset radius range, wiIs a Gaussian weight; the preset radius range is preferably 5 pixel points;
step 32: and carrying out cubic curve fitting processing based on the Gaussian smoothing processing result, wherein a fitting formula is as follows:
Figure BDA0003496197960000091
wherein p isxIs the x-coordinate, p, of the Gaussian smoothed contour pointyAnd a, b, c and d are fitting coefficients of the y coordinate of the contour point after Gaussian smoothing.
When the cubic curve is fitted, fitting weights at two ends of the outline are increased, and unsmooth transition at a joint caused by overlarge variable quantity of the two ends is avoided.
The present embodiment further includes step 33: and further calculating the side face degree of the user, and setting corresponding Gaussian smooth weight according to the side face degree: the larger the side face degree is, the smaller the Gaussian smoothing weight of the inner side of the side face is; and calculating the face contour points after Gaussian smoothing according to the Gaussian smoothing weight, wherein the calculation formula is as follows:
p=pori+pΔ*wLR
wherein p is a face contour point after Gaussian smoothing, poriIs a facial contour point before Gaussian smoothing, wLRIs a Gaussian smoothing weight, p, corresponding to the degree of sidednessΔIs a smooth deformation quantity; said wLRJudging by adopting the distance ratio from the left and right contour points to the center point between eyes, and calculating a Gaussian smooth weight value corresponding to the side face degree according to the distance ratio. Preferably, the eye is further calculatedThe distance between the eyes and the mouth and the face contour point is smaller as the distance is closer, so that the deformation of the eyes and the mouth is avoided, and the picture is distorted.
In this embodiment, the method further includes step 40: further carrying out inward interpolation and outward interpolation on the face contour points to obtain a deformation grid of a contour region; and performing deformation rendering on the smooth contour according to the deformation grid to obtain a result image of the user image after contour smoothing.
The present embodiment further provides an apparatus for automatically smoothing a face contour, which includes:
the contour point extraction module is used for carrying out face detection on the user image and extracting face contour points according to a face detection result;
the contour point screening module is used for calculating the distance and/or the angle of the face contour points and screening available contour points according to the calculation result;
and the contour smoothing module is used for sequentially carrying out Gaussian smoothing processing and cubic curve fitting processing on the available contour points to obtain a smooth contour.
The present embodiment further provides an electronic device, which includes the above-mentioned apparatus for automatically smoothing face contour, where the apparatus for automatically smoothing face contour may adopt the structure of the embodiment in fig. 2, and correspondingly, the technical solution of the embodiment in fig. 1 may be implemented, and the implementation principle and the technical effect of the apparatus are similar, which may refer to the relevant descriptions in the above-mentioned embodiments in detail, and are not described herein again.
The electronic device includes: an electronic device having a photographing function, such as a mobile phone, a digital camera, or a tablet computer, or an electronic device having an image processing function, or an electronic device having an image display function. The electronic device may include components such as a memory, a processor, an input unit, a display unit, a power supply, and the like.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and data processing by operating the software programs and modules stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (e.g., an image playing function, etc.) required by at least one function, and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may further include a memory controller to provide access to the memory by the processor and the input unit.
The input unit may be used to receive input numeric or character or image information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. Specifically, the input unit of the present embodiment may include a touch-sensitive surface (e.g., a touch display screen) and other input electronic devices in addition to the camera.
The display unit may be used to display information input by or provided to a user and various graphic user interfaces of the electronic device, which may be configured of graphics, text, icons, video, and any combination thereof. The Display unit may include a Display panel, and optionally, the Display panel may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface may overlie the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation is transmitted to the processor to determine the type of touch event, and the processor then provides a corresponding visual output on the display panel in accordance with the type of touch event.
The embodiment of the present embodiment also provides a computer-readable storage medium, which may be the computer-readable storage medium contained in the memory in the above-mentioned embodiment; or it may be a computer-readable storage medium that exists separately and is not built into the electronic device. The computer readable storage medium has at least one instruction stored therein, and the instruction is loaded and executed by a processor to implement the face contour automatic smoothing method shown in fig. 1. The computer readable storage medium may be a read-only memory, a magnetic or optical disk, or the like.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the apparatus embodiment, the electronic device embodiment and the storage medium embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Also, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or electronic device that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or device. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
While the above description shows and describes the preferred embodiments of the present invention, it is to be understood that the invention is not limited to the forms disclosed herein, but is not to be construed as excluding other embodiments and is capable of use in various other combinations, modifications, and environments and is capable of changes within the scope of the inventive concept as expressed herein, commensurate with the above teachings, or the skill or knowledge of the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (13)

1. An automatic face contour smoothing method is characterized by comprising the following steps:
carrying out face detection on the user image, and extracting face contour points according to a face detection result;
calculating the distance and/or angle of the face contour points, and screening available contour points according to the calculation result;
and sequentially carrying out Gaussian smoothing processing and cubic curve fitting processing on the available contour points to obtain a smooth contour.
2. The method of claim 1, wherein the extracting of the face contour points further comprises:
extracting an initial contour point set P0 from the face detection result;
carrying out face segmentation on the user image to obtain a mask image M marking a face region;
and searching and marking a connected region for the initial contour point set P0 through the mask image M, and extracting the face contour points according to a marking result.
3. The method of claim 2, further comprising:
performing morphological expansion and corrosion treatment on the mask image M to obtain an outer contour point set PL0 of the mask image M;
carrying out interpolation processing or smooth extension processing on the contour points of the initial contour point set P0 to obtain a corrected contour point set P1;
and selecting the contour point in the outer contour point set PL0 of the mask image M and the point which is closest to the contour point in the normal direction of the contour point in the corrected contour point set P1 in the vertical distance to obtain the final face contour point PL 1.
4. The method of claim 3, wherein the distance calculation is performed on the face contour points to filter the available contour points, further comprising:
calculating the vertical distance between the face contour point and the initial contour point in the normal direction;
and performing threshold calculation on the vertical distance, and screening face contour points with the vertical distance smaller than a preset threshold value as available contour points, or screening face contour points with the vertical distance larger than or equal to the preset threshold value as unavailable points.
5. The method of claim 4, wherein the calculating of the angles of the face contour points to filter the available contour points further comprises:
calculating the angle variation of the face contour points;
and performing threshold calculation on the angle variation, and screening face contour points with the angle variation smaller than a preset threshold value as available contour points, or screening face contour points with the angle variation larger than or equal to the preset threshold value as unavailable points.
6. The method according to claim 5, wherein the interpolation correction is further performed on the contour region where the unavailable point is located according to the neighboring available contour points as reference points; the interpolation correction method comprises the following steps:
for the unavailable points of the temple concave region, carrying out extended interpolation on the contour of the concave region along the contour tangential direction on one side of the available contour points;
for other unavailable points outside the depressed area of the temple, linear interpolation is carried out by adopting available contour points at two ends of the unavailable area;
wherein the number of interpolated contour points coincides with the number of unavailable points.
7. The method of claim 1, wherein the available contour points are gaussian smoothed by the following formula:
p=∑pi*wi
wherein p isiIs a usable contour point within a preset radius range, wiIs a Gaussian weight; the preset radius range is preferably 5 pixel points;
and carrying out cubic curve fitting processing based on the Gaussian smoothing processing result, wherein a fitting formula is as follows:
Figure FDA0003496197950000031
wherein p isxIs the x-coordinate, p, of the Gaussian smoothed contour pointyAnd a, b, c and d are fitting coefficients of the y coordinate of the contour point after Gaussian smoothing.
8. The method according to any one of claims 1 to 7, wherein a side face degree of the user is further calculated, and a corresponding Gaussian smoothing weight is set according to the side face degree: the larger the side face degree is, the smaller the Gaussian smoothing weight of the inner side of the side face is; and calculating the face contour points after Gaussian smoothing according to the Gaussian smoothing weight, wherein the calculation formula is as follows:
p=pori+pΔ*wLR
wherein p is a face contour point after Gaussian smoothing, poriIs a facial contour point before Gaussian smoothing, wLRIs a Gaussian smoothing weight, p, corresponding to the degree of sidednessΔIs a smooth deformation quantity; said wLRJudging by adopting the distance ratio from the left and right contour points to the center point between eyes, and calculating a Gaussian smooth weight value corresponding to the side face degree according to the distance ratio.
9. The method of claim 8, wherein distances between eyes and mouth and the face contour points are further calculated, and the closer the distances are, the smaller the weight of Gaussian smoothing is.
10. The method according to any one of claims 1 to 7, wherein the face contour points are further interpolated inward and outward to obtain a deformed mesh of a contour region; and performing deformation rendering on the smooth contour according to the deformation grid to obtain a result image of the user image after contour smoothing.
11. An apparatus for automatically smoothing a face contour, comprising:
the contour point extraction module is used for carrying out face detection on the user image and extracting face contour points according to a face detection result;
the contour point screening module is used for calculating the distance and/or the angle of the face contour points and screening available contour points according to the calculation result;
and the contour smoothing module is used for sequentially carrying out Gaussian smoothing processing and cubic curve fitting processing on the available contour points to obtain a smooth contour.
12. An electronic device comprising a memory, a processor, and a face contour automatic smoothing program stored on the memory and executable on the processor, the face contour automatic smoothing program when executed by the processor implementing the steps of the face contour automatic smoothing method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a face contour automatic smoothing program which, when executed by a processor, implements the steps of the face contour automatic smoothing method according to any one of claims 1 to 10.
CN202210115560.6A 2022-02-07 2022-02-07 Face contour automatic smoothing method and device, electronic equipment and storage medium Pending CN114596221A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210115560.6A CN114596221A (en) 2022-02-07 2022-02-07 Face contour automatic smoothing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210115560.6A CN114596221A (en) 2022-02-07 2022-02-07 Face contour automatic smoothing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114596221A true CN114596221A (en) 2022-06-07

Family

ID=81805168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210115560.6A Pending CN114596221A (en) 2022-02-07 2022-02-07 Face contour automatic smoothing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114596221A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116168041A (en) * 2023-04-26 2023-05-26 湖南隆深氢能科技有限公司 Real-time detection method and system applied to laminating device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116168041A (en) * 2023-04-26 2023-05-26 湖南隆深氢能科技有限公司 Real-time detection method and system applied to laminating device

Similar Documents

Publication Publication Date Title
US10853686B2 (en) Generation of salient contours using live video
US8698796B2 (en) Image processing apparatus, image processing method, and program
CN103839250B (en) The method and apparatus processing for face-image
US20110273466A1 (en) View-dependent rendering system with intuitive mixed reality
US10109083B2 (en) Local optimization for curvy brush stroke synthesis
US8976182B2 (en) Facial sketch creation device, configuration information generation device, configuration information generation method, and storage medium
CN105573485B (en) A kind of display content adjustment method and terminal
CN111161395A (en) Method and device for tracking facial expression and electronic equipment
CN109659006B (en) Facial muscle training method and device and electronic equipment
KR20200107957A (en) Image processing method and device, electronic device and storage medium
CN113407095A (en) Terminal device and method and device for processing drawing content of terminal device
CN106447604A (en) Method and device for transforming facial frames in videos
CN110580733A (en) Data processing method and device and data processing device
CN116126183A (en) Interface display state adjusting method and device, equipment and storage medium
CN110503599A (en) Image processing method and device
CN114596221A (en) Face contour automatic smoothing method and device, electronic equipment and storage medium
JP4188487B2 (en) Eye makeup simulation system
CN111652795A (en) Face shape adjusting method, face shape adjusting device, live broadcast method, live broadcast device, electronic equipment and storage medium
CN112837213A (en) Face shape adjustment image generation method, model training method, device and equipment
JP5920858B1 (en) Program, information processing apparatus, depth definition method, and recording medium
CN111507925A (en) Picture repairing processing method, device, equipment and storage medium
CN114255230A (en) Face feature point-based portrait mandible line repairing method, device and equipment
CN112348069B (en) Data enhancement method, device, computer readable storage medium and terminal equipment
CN107481194B (en) Photo rotation self-adaptive scaling method in photo frame based on photo album application
Monteiro Fit to frame: image and edge in contemporary interfaces

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination