Image data optimization method, device, electronic device and storage medium

CN112967329BActive Publication Date: 2024-10-01GUANGZHOU HUYA TECH CO LTD
View PDF -1 Cites 0 Cited by

Patent Information

Application Number
CN202110309128.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-23
Publication Date
2024-10-01
Estimated Expiration
2041-03-23

AI Technical Summary

Technical Problem

Existing 3D face reconstruction technology cannot achieve complete accuracy in face reconstruction. In particular, the contour fit of key points such as eyes and mouth cannot reach the level of fit of 2D key points, and it cannot meet the application scenarios for accurate facial recognition. positioning needs.

Method used

By obtaining the face image to be processed, using the two-dimensional key point set to perform position correction on the three-dimensional key point set, a target three-dimensional key point set is generated, so that the projected position of the three-dimensional key point corresponding to the same position of the part of interest is consistent with the two-dimensional key point set. The position difference between the points is within the preset range, thereby improving the fit between the three-dimensional key points and the contour of the area of ​​interest.

Benefits of technology

The accuracy and fit of three-dimensional key points are improved, meeting the application scenario's demand for accurate face positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112967329B_ABST
    Figure CN112967329B_ABST
Patent Text Reader

Abstract

The image data optimization method, device, electronic device and storage medium provided by the present invention include: obtaining a face image to be processed, wherein the contour of the part of interest does not match the boundary line formed by connecting the three-dimensional key points in the three-dimensional key point set; performing position correction on the three-dimensional key points in the three-dimensional key point set corresponding to the part of interest according to the two-dimensional key point set corresponding to the part of interest in the face image, and obtaining a target three-dimensional key point set corresponding to the part of interest; in the target face image generated according to the target three-dimensional key point set, the position difference between the projection position of the three-dimensional key point corresponding to the same position of the part of interest and the two-dimensional key point is within a preset range. The present application can realize the alignment of three-dimensional key points with two-dimensional key points, improve the degree of fit between the three-dimensional key points and the contour of the part of interest, and improve the accuracy of the three-dimensional key points.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of face reconstruction, and in particular to an image data optimization method, device, electronic equipment and storage medium. Background Art

[0002] Three-dimensional (three3D) face reconstruction based on image data has been widely used, such as facial expression driving, AI three-dimensional animation, etc. The above application scenarios are all based on three-dimensional face reconstruction technology. The demand for this type of three-dimensional animation needs to be based on the accurate positioning of the face.

[0003] However, the current three-dimensional face reconstruction technology has the defect of being unable to achieve completely accurate face reconstruction. For example, the key points reconstructed on the eyes of the reconstructed face cannot fit the eye contour to the same degree as the two-dimensional key points, and cannot meet the application scenario's requirements for accurate face positioning. Summary of the invention

[0004] In view of this, the present invention provides an image data optimization method, device, electronic device and storage medium to achieve alignment of three-dimensional key points with two-dimensional key points, improve the degree of fit between the three-dimensional key points and the contours of the parts of interest, and improve the accuracy of the three-dimensional key points.

[0005] The embodiments of the present invention can be implemented as follows:

[0006] In a first aspect, the present invention provides an image data optimization method, the method comprising: obtaining a facial image to be processed; wherein, there is a part of interest matching a business requirement in the facial image; the part of interest corresponds to a three-dimensional key point set and a two-dimensional key point set; the contour of the part of interest does not match a boundary line formed by connecting each three-dimensional key point in the three-dimensional key point set; based on the two-dimensional key point set, position correction is performed on the three-dimensional key points in the three-dimensional key point set to obtain a target three-dimensional key point set corresponding to the part of interest; based on the target three-dimensional key point set, a target facial image is generated; the position difference between the projection position of the three-dimensional key point corresponding to the same position of the part of interest and the two-dimensional key point is within a preset range.

[0007] Optionally, performing position correction on the three-dimensional key points in the three-dimensional key point set according to the two-dimensional key point set to obtain a target three-dimensional key point set, including: determining a plurality of three-dimensional sampling points of the part of interest and a two-dimensional sampling point at a position corresponding to each of the three-dimensional sampling points; the three-dimensional sampling point is included in the three-dimensional key point set; the two-dimensional sampling point is included in the two-dimensional key point set; constructing a correction matrix according to the three-dimensional sampling points and the two-dimensional sampling points; and performing position correction on the three-dimensional key points in the three-dimensional key point set according to the correction matrix to obtain the target three-dimensional key point set.

[0008] Optionally, after performing position correction on the three-dimensional key points in the three-dimensional key point set according to the correction matrix to obtain the target three-dimensional key point set, it also includes: determining the facial posture angle in the facial image based on face reconstruction technology; and performing angle correction on the target three-dimensional key points in the target three-dimensional key point set according to the facial posture angle.

[0009] Optionally, after performing position correction on the three-dimensional key points in the three-dimensional key point set according to the two-dimensional key point set to obtain the target three-dimensional key point set corresponding to the part of interest, it also includes: determining a linkage area corresponding to the part of interest; the linkage area represents an area connected to the part of interest, and the position state of the key points in the linkage area is affected by the position state of the key points corresponding to the part of interest; performing position correction on the three-dimensional key points in the linkage area according to the two-dimensional key point set and the three-dimensional key point set corresponding to the linkage area to obtain the target three-dimensional key point set corresponding to the linkage area.

[0010] Optionally, generating a target facial image according to the target three-dimensional key point set includes: generating the target facial image according to the target three-dimensional key point sets corresponding to the part of interest and the linkage area respectively.

[0011] Optionally, determining a plurality of three-dimensional sampling points of the part of interest and a two-dimensional feature point at a position corresponding to each of the three-dimensional sampling points includes: determining two contour vertices of the part of interest with the largest distance in the horizontal direction as the three-dimensional sampling points; and determining an intersection point of a perpendicular bisector of a line connecting the two contour vertices and a contour boundary of the part of interest in the vertical direction as the three-dimensional sampling point.

[0012] Optionally, the method further includes: processing the target facial image to generate a three-dimensional image matching the business requirement.

[0013] In a second aspect, the present invention provides an image data optimization device, comprising: an acquisition module, used to acquire a facial image to be processed; wherein, there is a part of interest matching the business needs in the facial image; the part of interest corresponds to a three-dimensional key point set and a two-dimensional key point set; the contour of the part of interest does not match the boundary line formed by connecting each three-dimensional key point in the three-dimensional key point set; a processing module, used to perform position correction on the three-dimensional key points in the three-dimensional key point set according to the two-dimensional key point set, and obtain a target three-dimensional key point set corresponding to the part of interest; a generation module, used to generate a target facial image according to the target three-dimensional key point set; the position difference between the projection position of the three-dimensional key point corresponding to the same position of the part of interest and the two-dimensional key point is within a preset range.

[0014] In a third aspect, the present invention provides an electronic device, comprising a memory and a storage device, wherein the memory stores a computer program that can be executed by the memory, and the memory can execute the computer program to implement the image data optimization method described in the first aspect.

[0015] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a memory, implements the image data optimization method described in the first aspect.

[0016] The present invention provides an image data optimization method, device, electronic device and storage medium. After obtaining a face image to be processed, the method corrects the position of the three-dimensional key points in the three-dimensional key point set corresponding to the part of interest according to the two-dimensional key point set corresponding to the part of interest in the face image, and obtains a target three-dimensional key point set corresponding to the part of interest; wherein the part of interest corresponds to a three-dimensional key point set and a two-dimensional key point set; the contour of the part of interest does not match the boundary line formed by connecting the three-dimensional key points in the three-dimensional key point set; in the target face image generated according to the target three-dimensional key point set, the position difference between the projection position of the three-dimensional key point corresponding to the same position of the part of interest and the two-dimensional key point is within a preset range. Since the three-dimensional key points obtained by the existing three-dimensional face reconstruction technology are not highly fitted with the contour, and the key point positioning is inaccurate, the present application uses the accurately positioned two-dimensional key points to correct the position of the three-dimensional key points, so as to achieve the alignment of the three-dimensional key points with the two-dimensional key points, thereby improving the fit between the three-dimensional key points and the contour of the part of interest and improving the accuracy of the three-dimensional key points. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 is a scene instance diagram;

[0019] Figure 2 Schematic diagram of the difference in semantics between 2D key points and 3D key points;

[0020] Figure 3 A schematic flow chart of an image data optimization method provided by an embodiment of the present invention;

[0021] Figure 4 Another scenario schematic diagram provided for an embodiment of the present invention;

[0022] Figure 5 A schematic flow chart of an implementation method of step S32 provided in an embodiment of the present invention;

[0023] Figure 6 A schematic flowchart of an implementation method of step S321 provided in an embodiment of the present application;

[0024] Figure 7 A schematic diagram of obtaining sampling points provided by an embodiment of the present invention;

[0025] Figure 8 One of the schematic flow charts of another image data optimization method provided by an embodiment of the present invention;

[0026] Fig. 9 A schematic diagram of a mouth linkage area;

[0027] Fig.10 A second schematic flow chart of another image data optimization method provided by an embodiment of the present invention;

[0028] Fig.11 A 2D facial diagram of key points is provided;

[0029] Fig.12 A functional module diagram of an image data optimization device provided by an embodiment of the present invention;

[0030] Fig.13 This is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to make the purpose, 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 in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0032] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0034] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0035] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0036] At present, three-dimensional (three3D) face reconstruction based on image data has been widely used. For example, in some application scenarios, there is a demand for three-dimensional dynamic effects, such as adding rabbit ears, pig masks, hats and other special effects to the face. There are also some applications that can meet the user's needs for face pinching, that is, after the user takes a selfie, a three-dimensional cartoon image similar to the user's image can be generated. In addition, there are also applications for facial expression driving, etc. The above application scenarios are all based on three-dimensional face reconstruction technology. For this type of three-dimensional dynamic effect needs, it needs to be based on the precise positioning of the face. The positioning of the face not only includes the positioning of some key points, but also includes the current state information of the face, such as the rotation angle information of the head.

[0037] However, there are already a large number of 3D face reconstruction methods, which can be roughly divided into two categories, methods based on parametric models and methods based on non-parametric models. Parametric model methods are methods that can express a face model with parameters, and non-parametric methods are methods that cannot express the model with parameters. Since the process of converting a two-dimensional face image to a three-dimensional face is actually a process from a low dimension to a high dimension with information loss, this process cannot obtain the optimal solution, but can only approximate the optimal solution. Usually, the optimal solution is to make the result of projecting the three-dimensional key points onto the image (projected two-dimensional key points) closest to the real two-dimensional key points. However, even so, it is still impossible to achieve the level of facial details reaching the level of two-dimensional key points. Therefore, both parametric and non-parametric model methods have the defect of not being able to achieve completely accurate face reconstruction. For example, see Figure 1 , Figure 1 is a scene instance diagram. Figure 1 Taking the eyes as an example, it can be seen that using the two-dimensional reconstruction technology, the reconstructed two-dimensional key points have a high degree of fit with the eye contour, and the boundary line connected by the two-dimensional key points basically coincides with the boundary of the eye contour. However, the three-dimensional key points obtained by the three-dimensional reconstruction technology cannot reach the same level of fit as the two-dimensional key points, and cannot meet the application scenario's requirements for accurate face positioning.

[0038] On the other hand, due to the semantic differences between 2D key points and 3D key points, the same 2D projection result can correspond to a variety of 3D faces, for example, see Figure 2 , Figure 2 This is a schematic diagram of the difference in semantics between two-dimensional key points and three-dimensional key points. Figure 2 (a) is the display of two-dimensional key points. Figure 2 (b) is the display of 3D key points. Figure 2 The key points of the reconstructed facial contour in (a) are not actually the true contour of the face. Similarly, combined with Figure 2 (a) and Figure 2 (b) It can be seen that, taking the eyes as an example, the two-dimensional key points and the three-dimensional key points at the same position of the eyes are also different. Therefore, the existing technology cannot use the two-dimensional key points to optimize the face reconstruction process to achieve the best details.

[0039] In order to solve the above technical problems, the present invention proposes a technical solution for optimizing the details of key points of 3D human faces, which is equivalent to optimizing the details of 3D human face reconstruction, so as to achieve the matching of the reconstructed 3D key points with the real face area. Figure 3 , Figure 3 A schematic flow chart of an image data optimization method provided by an embodiment of the present invention, the method comprising:

[0040] S31, obtaining a face image to be processed.

[0041] It is understood that a face image can be obtained by an electronic device, which may be, but is not limited to:

[0042] Among them, there may be parts of interest in the face image that match the business needs, and the parts of interest can be customized according to business needs. For example, in some applications, it is necessary to add various special effects to the eyes to obtain various animations that simulate the eyes, and the parts of interest can be defined as the eyes; in other applications, users have various animation requirements for the mouth, so the part of interest can be defined as the mouth, and there is no limitation here.

[0043] It is understandable that the above-mentioned parts of interest correspond to a three-dimensional key point set and a two-dimensional key point set, and the above-mentioned two-dimensional key point set can be obtained by any existing two-dimensional face reconstruction technology and any three-dimensional key point technology. Among them, the key points can be used to reflect the contour of the part of interest, and the three-dimensional key point set and the two-dimensional key point set both maintain the position coordinates of the key points, for example, the coordinates (X, Y, Z) contained in the three-dimensional key point set, where Z represents the depth information of the key point, and the two-dimensional key point set contains the coordinates (X, Y).

[0044] It can also be understood that due to the high accuracy of two-dimensional face reconstruction technology, it can be considered that the contour of the part of interest matches the boundary line formed by connecting the various two-dimensional key points in the two-dimensional key point set; but since the three-dimensional face reconstruction technology is more complex than the two-dimensional face key points, it is impossible to achieve completely accurate face reconstruction in terms of data and algorithm, and can only achieve overall optimization. Therefore, the fit of the reconstructed face at the eye and mouth key points cannot reach the fit of the two-dimensional key points. Therefore, in the embodiment of the present application, the above-mentioned contour does not match the boundary line formed by connecting the various three-dimensional key points in the three-dimensional key point set. It can also be understood that the difference between the result of projecting the three-dimensional key point corresponding to the same contour position of the part of interest onto the image (two-dimensional key point) and the actual two-dimensional key point is outside the preset range.

[0045] S32. According to the two-dimensional key point set, position correction is performed on the three-dimensional key points in the three-dimensional key point set to obtain a target three-dimensional key point set corresponding to the part of interest.

[0046] It can be understood that since the two-dimensional key points have a high degree of fit with the contour of the part of interest and high accuracy, the three-dimensional key point set is positionally corrected based on the two-dimensional key point set to achieve alignment between the three-dimensional key points and the two-dimensional key points, thereby improving the degree of fit between the three-dimensional key points and the contour of the part of interest and improving the accuracy of the three-dimensional key points.

[0047] S37, generating a target face image according to the target three-dimensional key point set.

[0048] It can be understood that the position difference between the projection position of the three-dimensional key point corresponding to the same position of the part of interest in the generated target facial image and the two-dimensional key point is within a preset range. The projection position here refers to the position of the three-dimensional key point projected onto the plane where the two-dimensional key point is located. For example, the three-dimensional key point coordinates corresponding to the left corner of the eye contour are (X', Y', Z), and the two-dimensional key point coordinates are (X, Y). Then, the projection position obtained by projecting (X', Y', Z) onto the two-dimensional plane is (X', Y'), and then the position difference between (X', Y') and (X, Y) is calculated, and finally the three-dimensional key point and the two-dimensional key point are aligned. The generated target facial image can be provided to users for various operations matching business needs with high accuracy.

[0049] For example, taking the eyes and mouth as the areas of interest, see Figure 4 , Figure 4 Another scenario diagram provided for an embodiment of the present invention, wherein Figure 4 (a) shows the face image to be processed. It can be seen that in the image, the left eye of the face is closed and the left corner of the mouth is raised. However, the 3D key points reconstructed according to the existing 3D face reconstruction technology are as follows: Figure 4 As shown in (b), the 3D key points do not fit the eye contour after closing the eyes and the upward mouth contour. Through the above process, the following can be achieved: Figure 4 (c) effect.

[0050] The present invention provides an image data optimization method, including obtaining a face image to be processed; performing position correction on a three-dimensional key point in a three-dimensional key point set corresponding to a part of interest in the face image according to a two-dimensional key point set corresponding to the part of interest, and obtaining a target three-dimensional key point set corresponding to the part of interest; in a target face image generated according to the target three-dimensional key point set, the position difference between the projection position of the three-dimensional key point corresponding to the same position of the part of interest and the two-dimensional key point is within a preset range. Since the key points of the existing three-dimensional face reconstruction technology are not well fitted with the facial contour, and the key point positioning is inaccurate, the present application uses accurately positioned two-dimensional key points to perform position correction on the three-dimensional key points, and realizes the alignment of the three-dimensional key points with the two-dimensional key points, thereby improving the fit between the three-dimensional key points and the contour of the part of interest and improving the accuracy of the three-dimensional key points.

[0051] In some possible embodiments, in order to achieve alignment of the three-dimensional key points with the two-dimensional key points, a method for correcting the three-dimensional key points is given below. Figure 5 , Figure 5 A schematic flowchart of an implementation of step S32 provided in an embodiment of the present invention, step S32 may include:

[0052] S321, determining a plurality of three-dimensional sampling points of a part of interest and a two-dimensional sampling point at a position corresponding to each three-dimensional sampling point.

[0053] It is understandable that the above three-dimensional sampling points are included in the three-dimensional key point set, and similarly, the two-dimensional sampling points are also included in the two-dimensional key point set. The number of sampling points is much smaller than the number of key points in the key point set.

[0054] S322: construct a correction matrix according to the three-dimensional sampling points and the two-dimensional sampling points.

[0055] For example, taking the eye as the part of interest, select the three-dimensional key points corresponding to the left eye corner point, the right eye corner point, and the absolute vertex in the vertical direction of the eye contour curve, a total of four points A_3D, B_3D, C_3D, D_3D to form a 4*3 matrix A 3D B 3D C 3D D 3D , as the three-dimensional sampling point, similarly, find the two-dimensional key points corresponding to the left eye corner point, the right eye corner point, and the absolute vertex in the vertical direction of the eye contour curve. A total of four points A_2D, B_2D, C_2D, D_2D form a 4*2 matrix A 2D B 2D C 2D D 2D , based on A 3D B 3D C 3D D 3D Computing and A 2D B 2D C 2D D 2D The least squares relationship of affine , where the correction matrix A affine With A 3D B 3D C 3D D 3D and A 2D B 2D C 2D D 2D The relationship between them can be expressed as: 3D B 3D C 3D D 3D *A affine =A 2D B 2D C 2D D 2D .

[0056] It should be noted that for other parts of interest on the face, such as the mouth, the above processing method can also be used to obtain sampling points and correction matrices, which will not be repeated here. However, it should be noted that since the mouth is composed of inner lips and outer lips, and the outer lips are connected to the nose and chin, it is necessary to separate the inner and outer lips, and select 4 points for the inner and outer lips, the four vertices of the leftmost, rightmost, topmost and bottommost, and find the points corresponding to the 2D key points. And the sampling points and correction matrix are obtained by following the eye processing method.

[0057] S323. Perform position correction on the three-dimensional key points in the three-dimensional key point set according to the correction matrix to obtain a target three-dimensional key point set.

[0058] It can be understood that the correction matrix A calculated based on the sampling points affine Then, the optimized target 3D key point set can be obtained by applying it to the 3D key point set of the region of interest. Assuming that the 3D key point set is X 3D , the target three-dimensional key point set is Y 3D , then the relationship between the 3D key point set, the target 3D key point set and the correction matrix can be: 3D *A affine =Y 3D .

[0059] In some possible embodiments, in order to obtain effective sampling points and thus achieve the above technical effects, a method for selecting sampling points is given below. Figure 6 , Figure 6 A schematic flowchart of an implementation method of step S321 provided in an embodiment of the present application, step S321 may include the following sub-processes:

[0060] S321-1. Determine the two contour vertices with the largest horizontal distance between the part of interest as three-dimensional sampling points.

[0061] S321-2: Determine the intersection of the perpendicular bisector of the line connecting the two contour vertices and the contour boundary of the part of interest in the vertical direction as a three-dimensional sampling point.

[0062] It can be understood that the purpose of the above selection method is to ensure that the points used for calculation are real vertices.

[0063] For easier understanding, see Figure 7 , Figure 7A schematic diagram of obtaining sampling points provided by an embodiment of the present invention. Continuing with the eyes as an example, the two contour vertices with the largest distance in the horizontal direction are determined as three-dimensional sampling points, namely the left eye corner point A_3D and the right eye corner point C_3D of the eyes, and then the intersection of the perpendicular bisector of the line connecting the AC points and the upper and lower edges are used as B_3D and D_3D, where the upper and lower edges can be understood as the lines connecting the two key points farthest from AC. Similarly, the corresponding two-dimensional sampling points can be obtained in the same way, which will not be repeated here.

[0064] It should be noted that the number of the above selected sampling points can be defined according to actual needs and is not limited here.

[0065] In some possible embodiments, since the semantics of 2D key points and 3D key points are different when the angle is slightly larger, for example, when there is posture information of the face, the facial contour located by 2D key points is different from the facial contour located by 3D key points, so it is necessary to perform secondary angle post-processing on the 3D key point set according to the facial posture information to ensure the accuracy of the result. Figure 1 Based on this, a possible implementation is given, see Figure 8 , Figure 8 Another method for optimizing image data provided by an embodiment of the present invention further includes:

[0066] S33. Determine the facial posture angle in the facial image based on the facial reconstruction technology.

[0067] S34, performing angle correction on the target three-dimensional key points in the target three-dimensional key point set according to the facial posture angle.

[0068] It can be understood that the face posture angle (equivalent to the head rotation angle) alpha / 180.0 that can be obtained through face reconstruction technology controls the face posture angle range between 0 and 1, and then uses the face posture angle to perform secondary optimization of the target 3D key point set. The optimization method is as follows:

[0069] Z 3D =X 3D *(1.0-alpha / 180.0)+Y 3D *alpha / 180.0).

[0070] Among them, Z 3D Degree is the target 3D key point set after angle optimization, X 3D is the set of three-dimensional key points before optimization, Y 3Dis the target 3D key point set, and alpha is the face pose angle. It can be seen that if the angle is 45 degrees, that is, alpha is equal to 0.5, then the output target 3D key point set after angle optimization is the average point of the points before and after XY processing.

[0071] In some possible embodiments, for some interesting parts of the face, the corresponding 3D key points will affect the positions of key points in other areas, that is, these key points have corresponding linkage key points, for example, see Fig. 9 , Fig. 9 is a schematic diagram of the mouth linkage area. It can be seen from the figure that the area between the upper lip and the nose can be understood as the mouth linkage area. That is to say, when the mouth posture changes, the linkage area will change accordingly. The position of the key points in the linkage area will be affected by the position of the key points of the upper lip. Similarly, the area between the lower lip and the chin can also be understood as the mouth linkage area. In order to realize the position correction of the key points in these areas, the following Figure 8 Based on this, a possible implementation method is given, see Fig.10 , Fig.10 A second schematic flow chart of another image data optimization method provided by an embodiment of the present invention.

[0072] S35. Determine a linkage region corresponding to the site of interest.

[0073] It can be understood that the above linkage area represents the area connected to the part of interest, and the positions of key points in the area are affected by the positions of key points in the part of interest.

[0074] S36, performing position correction on the three-dimensional key points in the linkage area according to the two-dimensional key point set and the three-dimensional key point set corresponding to the linkage area, to obtain a target three-dimensional key point set corresponding to the linkage area.

[0075] A possible implementation of step S37 is: S37a, generating a target face image according to the target three-dimensional key point sets corresponding to the part of interest and the linkage area.

[0076] For ease of understanding, see Fig.11 , Fig.11 A facial diagram of two-dimensional key points is provided, which contains 106 key points. Taking the mouth as an example, among the linkage points of the nose and the upper lip of the mouth, the selected two-dimensional key points can be Fig.11 Points 82, 47, 48, 49, 50, 51, 83, 84, 86, 88, and 90 in the figure are roughly located at the corresponding positions. Three-dimensional sampling points are selected from the three-dimensional key points corresponding to the linkage area, and the correction matrix A is calculated similarly to the above eye processing method.ffine , and then calibrate the key points in the linkage area. Similarly, in the linkage points between the chin and the lower lip of the mouth, the selected two-dimensional key points can be Fig.11 Points 13, 14, 15, 16, 17, 18, 19, 84, 95, 93, 91, and 90 in the area, and then the three-dimensional key points corresponding to the area are concentrated to select the three-dimensional sampling points at the corresponding positions to calculate the correction matrix A ffine , and acts on the three-dimensional key points of the linkage area between the chin and the lower lip of the mouth to achieve the purpose of correction.

[0077] It should be noted that the above method of selecting points in the linkage area is only an example. The user can define the size of the linkage area according to his or her own needs, and perform the above operation based on the determined linkage area, so as to realize the correction of the three-dimensional key points of the linkage area and achieve the purpose of accurate positioning.

[0078] In some possible embodiments, the target face image may also be processed to generate a three-dimensional image matching the business requirements.

[0079] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing the image data optimization device is given below. Fig.12 , Fig.12 This is a functional module diagram of an image data optimization device provided by an embodiment of the present invention. It should be noted that the basic principle and technical effects of the image data optimization device 20 provided by this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above-mentioned embodiments. The image data optimization device 20 includes:

[0080] An acquisition module 21 is used to acquire a face image to be processed;

[0081] Among them, there is a part of interest matching the business demand in the face image; the part of interest corresponds to a three-dimensional key point set and a two-dimensional key point set; the contour of the part of interest does not match the boundary line formed by connecting the three-dimensional key points in the three-dimensional key point set;

[0082] A processing module 22 is used to perform position correction on the three-dimensional key points in the three-dimensional key point set according to the two-dimensional key point set to obtain a target three-dimensional key point set corresponding to the part of interest;

[0083] The generating module 23 is used to generate a target face image according to the target three-dimensional key point set; the position difference between the projection position of the three-dimensional key point and the two-dimensional key point corresponding to the same position of the part of interest is within a preset range.

[0084] Optionally, the processing module 22 is specifically used to: determine multiple three-dimensional sampling points of the part of interest and two-dimensional sampling points at the corresponding position of each three-dimensional sampling point; the three-dimensional sampling points are included in the three-dimensional key point set; the two-dimensional sampling points are included in the two-dimensional key point set; construct a correction matrix based on the three-dimensional sampling points and the two-dimensional sampling points; according to the correction matrix, perform position correction on the three-dimensional key points in the three-dimensional key point set to obtain a target three-dimensional key point set.

[0085] Optionally, the processing module 22 is specifically used to: determine the two contour vertices with the largest distance in the horizontal direction of the part of interest as three-dimensional sampling points; determine the intersection of the perpendicular bisector of the line connecting the two contour vertices and the contour boundary of the part of interest in the vertical direction as the three-dimensional sampling point.

[0086] Optionally, the image data optimization device 20 also includes: a determination module, used to determine the facial posture angle in the facial image based on the facial reconstruction technology; a processing module 22, also used to perform angle correction on the target three-dimensional key points in the target three-dimensional key point set according to the facial posture angle.

[0087] Optionally, the determination module is also used to determine the linkage area corresponding to the part of interest; the linkage area represents the area connected to the part of interest, and the position of the key points in the linkage area is affected by the position of the key points of the part of interest; the processing module 22 is also used to perform position correction on the three-dimensional key points in the linkage area according to the two-dimensional key point set and the three-dimensional key point set corresponding to the linkage area, and obtain the target three-dimensional key point set corresponding to the linkage area.

[0088] Optionally, the generating module 23 is specifically configured to generate a target face image according to the target three-dimensional key point sets corresponding to the part of interest and the linkage area.

[0089] Optionally, the processing module 22 is further used to process the target face image to generate a three-dimensional image matching the business requirements.

[0090] The embodiment of the present invention further provides an electronic device, such as Fig.13 , Fig.13A block diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device 30 includes a communication interface 31, a processor 32 and a memory 33. The processor 32, the memory 33 and the communication interface 31 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 33 can be used to store software programs and modules, such as program instructions / modules corresponding to the image data optimization method provided in an embodiment of the present invention. The processor 32 executes various functional applications and data processing by executing the software programs and modules stored in the memory 33. The communication interface 31 can be used to communicate signaling or data with other node devices. In the present invention, the electronic device 30 can have multiple communication interfaces 31.

[0091] Among them, the memory 33 can be but is not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.

[0092] The processor 32 may be an integrated circuit chip with signal processing capability. The processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0093] Optionally, the image data optimization device 20 may be stored in the form of software or firmware. Figure 7 The memory 33 shown in the figure may be fixed in the operating system (OS) of the electronic device 30 and may be Figure 7 The processor 32 in the processor 32 is executed. At the same time, the data, program codes, etc. required to execute the above modules can be stored in the memory 33.

[0094] It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0095] The present application also provides a computer-readable storage medium having a computer program stored thereon. The computer program can Fig.13 The processor 32 in the electronic device 30 shown implements the electronic device image data optimization method described in any of the above embodiments when executed. The storage medium may include, but is not limited to: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0096] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0097] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0098] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.

[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for optimizing image data, characterized in that: The method comprises: Acquire a face image to be processed; wherein, there is a part of interest matching the business requirement in the face image; the part of interest corresponds to a three-dimensional key point set and a two-dimensional key point set; the contour of the part of interest does not match a boundary line formed by connecting the three-dimensional key points in the three-dimensional key point set; According to the two-dimensional key point set, position correction is performed on the three-dimensional key points in the three-dimensional key point set to obtain a target three-dimensional key point set corresponding to the part of interest; Generate a target face image according to the target three-dimensional key point set; the position difference between the projection position of the three-dimensional key point and the two-dimensional key point corresponding to the same position of the part of interest is within a preset range; After performing position correction on the three-dimensional key points in the three-dimensional key point set according to the two-dimensional key point set to obtain the target three-dimensional key point set corresponding to the part of interest, it also includes: determining a linkage area corresponding to the part of interest; the linkage area represents an area connected to the part of interest, and the position state of the key points in the linkage area is affected by the position state of the key points corresponding to the part of interest; performing position correction on the three-dimensional key points in the linkage area according to the two-dimensional key point set and the three-dimensional key point set corresponding to the linkage area to obtain the target three-dimensional key point set corresponding to the linkage area.

2. The image data optimization method according to claim 1, characterized in that According to the two-dimensional key point set, the three-dimensional key points in the three-dimensional key point set are corrected in position to obtain a target three-dimensional key point set, including: Determine a plurality of three-dimensional sampling points of the part of interest and a two-dimensional sampling point at a position corresponding to each of the three-dimensional sampling points; the three-dimensional sampling points are included in the three-dimensional key point set; the two-dimensional sampling points are included in the two-dimensional key point set; Constructing a correction matrix according to the three-dimensional sampling points and the two-dimensional sampling points; According to the correction matrix, the positions of the three-dimensional key points in the three-dimensional key point set are corrected to obtain the target three-dimensional key point set.

3. The image data optimization method according to claim 2, characterized in that: After performing position correction on the three-dimensional key points in the three-dimensional key point set according to the correction matrix to obtain the target three-dimensional key point set, the method further includes: Determining the facial posture angle in the facial image based on the facial reconstruction technology; Angle correction is performed on the target three-dimensional key points in the target three-dimensional key point set according to the facial posture angle.

4. The image data optimization method according to claim 1, characterized in that: Generating a target face image according to the target three-dimensional key point set includes: The target face image is generated according to the target three-dimensional key point sets corresponding to the part of interest and the linkage area.

5. The image data optimization method according to claim 2, characterized in that: Determining a plurality of three-dimensional sampling points of the part of interest and a two-dimensional feature point at a corresponding position of each of the three-dimensional sampling points includes: Determine the two contour vertices with the largest horizontal distance between the part of interest as the three-dimensional sampling points; The intersection point of the perpendicular bisector of the line connecting the two contour vertices and the contour boundary of the part of interest in the vertical direction is determined as the three-dimensional sampling point.

6. The image data optimization method according to claim 1, characterized in that: Also includes: The target face image is processed to generate a three-dimensional image matching the business requirements.

7. An image data optimization device, characterized in that: include: An acquisition module is used to acquire a face image to be processed; wherein, there is a part of interest matching the business requirement in the face image; the part of interest corresponds to a three-dimensional key point set and a two-dimensional key point set; the contour of the part of interest does not match a boundary line formed by connecting the three-dimensional key points in the three-dimensional key point set; A processing module, configured to perform position correction on the three-dimensional key points in the three-dimensional key point set according to the two-dimensional key point set, so as to obtain a target three-dimensional key point set corresponding to the part of interest; A generating module, configured to generate a target face image according to the target three-dimensional key point set; the position difference between the projection position of the three-dimensional key point and the two-dimensional key point corresponding to the same position of the part of interest is within a preset range; The image data optimization device also includes: a determination module, used to determine the linkage area corresponding to the part of interest; the linkage area represents the area connected to the part of interest, and the position state of the key points in the linkage area is affected by the position state of the key points corresponding to the part of interest; according to the two-dimensional key point set and the three-dimensional key point set corresponding to the linkage area, the three-dimensional key points in the linkage area are positionally corrected to obtain the target three-dimensional key point set corresponding to the linkage area.

8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the method according to any one of claims 1 to 6.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.