A close-up three-dimensional face reconstruction device
By collecting images of the lower half of the face with a fisheye camera near the nose pad and using deep learning technology, the problem of accuracy loss and sensor dependence in existing 3D face reconstruction technology is solved, and an efficient and stable 3D face is achieved. reconstruction.
Patent Information
- Application Number
- CN202111441281.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-11-30
AI Technical Summary
Existing 3D face reconstruction technology suffers from accuracy loss errors and high sensor dependence in real-time applications. It is especially difficult to accurately capture expressions and subtle movements around the eyebrows.
Two fisheye cameras near the nose pads are used to collect images of the lower half of the human face. Deep learning is used for preprocessing, feature extraction and splicing to construct a complete face image, eliminating dependence on strain signals and realizing the need for external sensors. 3D face reconstruction.
It improves the accuracy and stability of 3D face reconstruction, simplifies equipment design, reduces dependence on sensors, and realizes a lightweight and easy-to-use 3D face reconstruction solution.
Smart Images

Figure CN114387388B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of facial image reconstruction, and in particular relates to a close-up three-dimensional facial reconstruction device. Background Art
[0002] Augmented reality refers to the superposition of virtual objects in the observed real scene, and the use of virtual objects to enhance the real world; among them, three-dimensional reconstruction is widely used in augmented reality, virtual reality and other fields. Three-dimensional face reconstruction aims to effectively restore the real three-dimensional shape and depth information of the face through the two-dimensional image of the face. It can be applied to the fields of virtual image generation, virtual courses, special effects film production, game production, etc. For example, based on the reconstruction of three-dimensional face models based on facial key points, head posture estimation and tracking, expression and motion capture technology, etc., it can effectively improve the interactive fun and richness of short videos, live broadcasts, mobile phones and other industries. There are currently three important three-dimensional face reconstruction methods: face reconstruction based on traditional methods, face reconstruction based on models, and face reconstruction based on deep learning end-to-end.
[0003] The 3D reconstruction technology used in virtual reality / augmented reality scenarios usually requires taking RGB images of the object at different angles to obtain complete image information for 3D reconstruction; or combining with sensing devices such as stress sensors to analyze the changes in strain signals, superimpose partial image information, and then reconstruct a complete 3D model. However, this method will produce a variety of loss errors, which seriously affect the reconstruction accuracy.
[0004] The head-mounted display device adopted in the prior art can realize three-dimensional facial performance-driven animation in real time; the wearable system adopts multiple ultra-thin flexible electronic materials, which are mounted on the foam padding of the headset to measure the surface strain signals corresponding to the upper facial expressions. The strain signals are combined with the head-mounted RGB-D camera to enhance the tracking of the oral region and give the inaccurate position of the head-mounted display device. In order to map the input signal to the three-dimensional face model, single-instance offline training is performed for each person. For reusable and accurate online operation, a short calibration step is proposed to readjust the mapped Gaussian mixture distribution before each use. The resulting animation is visually comparable to the advanced depth sensor-driven facial performance capture system and is therefore suitable for social interaction in virtual worlds. Figure 1 A schematic diagram of a head mounted display device according to a comparative example of the present invention for implementing face reconstruction. The sensor is embedded in the foam board to capture the expression of the upper part of the player's face by sensing the twitching of the facial muscles, while the camera extending from the front is used to track the movement of the user's chin and mouth.
[0005] From a hardware perspective, although each user only needs one complete training to use the device, a short trial calibration is still required before each use. It is not suitable for real-time 3D face reconstruction. Since the pressure distribution changes with the placement of the head-mounted display device and the direction of the head, the strain signal measurement may drift or slightly reduce the accuracy. The strain gauges are sometimes not in close contact with the face. And too many external measurement devices add a burden to the existing hardware equipment. In this case, it is difficult to accurately restore the expressions around the eyebrows. In addition, it is difficult to capture subtle expressions such as blinking or squinting using sparsely placed strain gauges on the foam pad. From a software perspective, the reconstruction involves the reconstruction of facial details of the mouth and eyes, involving many coefficients and parameters, and the human reconstruction process is more complicated. Summary of the invention
[0006] In order to solve the above technical problems, the present application proposes a close-up three-dimensional face reconstruction solution, which uses two fisheye cameras near the nose pad to obtain the lower half of the face, and then uses deep learning to analyze the facial expression of the lower half to restore the complete face; that is, only the image of the lower half of the face is needed to reconstruct the complete face image, and there is no need to collect facial information from multiple perspectives; the reconstruction effect of deep learning has the facial expression details and can accurately express the emotions of the face; the entire reconstruction does not require other sensor hardware, and there is no need to consider the loose contact problem caused by the strain gauge, and the equipment is simple, light and easy to implement.
[0007] The first aspect of the present invention discloses a close-up three-dimensional face reconstruction method. The method comprises:
[0008] Step S1, using an image acquisition device to simultaneously acquire a first image and a second image of a face, wherein the first image is an image of the lower left half of the face, and the second image is an image of the lower right half of the face;
[0009] Step S2, preprocessing the first image and the second image, wherein the preprocessing includes correction processing and splicing processing to obtain a fused image of the lower half of the face;
[0010] Step S3, using a pre-trained feature extraction model to determine feature points of the face from the lower half of the fused image, so as to segment the face from the background image;
[0011] Step S4: using a pre-trained face reconstruction model, taking the segmented face image and the feature points of the face as input, to construct a complete image of the face.
[0012] According to the method of the first aspect of the present invention, the image acquisition device includes a first fisheye image collector for acquiring the first image and a second fisheye image collector for acquiring the second image, and the image acquisition device is installed on a wearable device so that when the wearable device is worn, the image acquisition device is located at any position of the fundus, temple, corner of the eye, or nose pad of the human face, and the first fisheye image collector and the second fisheye image collector are respectively located on the left and right sides of any position of the fundus, temple, corner of the eye, or nose pad of the human face.
[0013] According to the method of the first aspect of the present invention, in the step S2, the correction processing performed on the first image and the second image includes, based on the actual position point P in the real world and the imaging position point P' distorted during the imaging process, using a camera model to calculate the corrected distortion projection point P0, the camera model being:
[0014] r d =fθ d =θ(1+k1θ 2 +k2θ 4 +k3θ 6 +k4θ 8 ) (1)
[0015] Among them, r d =|OP'|, represents the distance from the imaging position point P' to the midpoint O of the imaging plane, f is the focal length, θ is the imaging incident angle at point P, θ d is the emission angle of point P when the imaging position point P' is distorted during the imaging process, and k1, k2, k3, and k4 are distortion parameters.
[0016] According to the method of the first aspect of the present invention, in step S2, the splicing process includes:
[0017] Extracting features from the calibrated first image and the calibrated second image, and performing corner point detection on the features to establish a geometric correspondence between the calibrated first image and the calibrated second image in the same coordinate system;
[0018] Based on the geometric correspondence, the region outside the overlapping region of the calibrated first image and the calibrated second image is deleted by using homography matrix estimation, so as to fuse the calibrated first image and the calibrated second image based on the overlapping region.
[0019] According to the method of the first aspect of the present invention, in step S3:
[0020] Pre-training the feature extraction model includes: using an open source data set to train the feature extraction model so that the feature extraction model has the ability to extract all feature points of a complete face;
[0021] The feature points of the human face determined by the feature extraction model include: extracted feature data of the lower half of the human face and predicted feature data of the upper half of the human face.
[0022] According to the method of the first aspect of the present invention, in step S4, the training environment of the pre-trained face reconstruction model is: windows10+cuda10.2+cudann 7.6.5+pytorch1.6+pytorch3d0.2, the number of iterations is 300, and the number of selected samples is batchsizes=48, to complete the pre-training of the face reconstruction model.
[0023] According to the method of the first aspect of the present invention, in the step S4, during the pre-training process of the face reconstruction model, for the pre-training of the lossy rough face reconstruction, the face key point loss, eye closure loss, photo-based loss, shape continuity loss, and contour regularization loss are used as measurement basis; for the pre-training of the detailed face reconstruction, the photo detail loss, soft symmetry loss, and detail regularization loss are used as measurement basis.
[0024] The second aspect of the present invention discloses a close-up three-dimensional face reconstruction device. The device comprises:
[0025] A first processing unit is configured to call an image acquisition device to simultaneously acquire a first image and a second image of a face, wherein the first image is an image of a left lower half of the face, and the second image is an image of a right lower half of the face;
[0026] A second processing unit is configured to preprocess the first image and the second image, wherein the preprocessing includes a correction process and a splicing process to obtain a fused image of the lower half of the face;
[0027] A third processing unit is configured to call a pre-trained feature extraction model to determine feature points of the face from the lower half fused image to segment the face from the background image;
[0028] The fourth processing unit is configured to call a pre-trained face reconstruction model, take the segmented face image and the feature points of the face as input, and construct a complete image of the face.
[0029] According to the device of the second aspect of the present invention, the image acquisition device includes a first fisheye image collector for acquiring the first image and a second fisheye image collector for acquiring the second image, and the image acquisition device is installed on a wearable device so that when the wearable device is worn, the image acquisition device is located at any position of the fundus, temple, corner of the eye, or nose pad of the human face, and the first fisheye image collector and the second fisheye image collector are respectively located on the left and right sides of any position of the fundus, temple, corner of the eye, or nose pad of the human face.
[0030] According to the device of the second aspect of the present invention, the second processing unit is specifically configured to perform the correction processing on the first image and the second image, including calculating the corrected distorted projection point P0 using a camera model based on an actual position point P in the real world and an imaging position point P' distorted during the imaging process, wherein the camera model is:
[0031] r d =fθ d =θ(1+k1θ 2 +k2θ 4 +k 3θ 6 +k4θ 8 ) (1)
[0032] Among them, r d =|OP'|, represents the distance from the imaging position point P' to the midpoint O of the imaging plane, f is the focal length, θ is the imaging incident angle at point P, θ d is the emission angle of point P when the imaging position point P' is distorted during the imaging process, and k1, k2, k3, and k4 are distortion parameters.
[0033] According to the device of the second aspect of the present invention, the second processing unit is specifically configured such that the splicing process includes:
[0034] Extracting features from the calibrated first image and the calibrated second image, and performing corner point detection on the features to establish a geometric correspondence between the calibrated first image and the calibrated second image in the same coordinate system;
[0035] Based on the geometric correspondence, the region outside the overlapping region of the calibrated first image and the calibrated second image is deleted by using homography matrix estimation, so as to fuse the calibrated first image and the calibrated second image based on the overlapping region.
[0036] According to the device of the second aspect of the present invention, the third processing unit is specifically configured as follows:
[0037] Pre-training the feature extraction model includes: using an open source data set to train the feature extraction model so that the feature extraction model has the ability to extract all feature points of a complete face;
[0038] The feature points of the human face determined by the feature extraction model include: extracted feature data of the lower half of the human face and predicted feature data of the upper half of the human face.
[0039] According to the device of the second aspect of the present invention, the training environment of the pre-trained face reconstruction model is: windows10+cuda10.2+cudann 7.6.5+pytorch1.6+pytorch3d0.2, the number of iterations is 300, and the number of selected samples is batchsizes=48, to complete the pre-training of the face reconstruction model.
[0040] According to the device of the second aspect of the present invention, in the pre-training process of the face reconstruction model, for the pre-training of the lossy rough face reconstruction, the face key point loss, eye closure loss, photo-based loss, shape continuity loss, and contour regularization loss are used as measurement basis; for the pre-training of the detailed face reconstruction, the photo detail loss, soft symmetry loss, and detail regularization loss are used as measurement basis.
[0041] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in any one of the close-up three-dimensional face reconstruction methods described in the first aspect of the present disclosure are implemented.
[0042] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any one of the close-up 3D face reconstruction methods described in the first aspect of the present disclosure are implemented.
[0043] The technical solution provided by the present invention can effectively reduce the system's dependence on sensors. Users only need to wear VR glasses and the three-dimensional face reconstruction device described in this article to realize action collection of behavioral content, three-dimensional face modeling, and data synchronization; it can also be connected to AR / VR glasses of different brands or models through a communication interface, and has high portability; at the same time, it does not affect the scope of existing commercial hardware usage scenarios, can face open spaces and eliminate the obstruction of external image acquisition devices, has strong stability, and is beautiful and lightweight. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A framework diagram of a head mounted display device according to a comparative example of the present invention for implementing face reconstruction;
[0046] Figure 2a is a flow chart of a close-up 3D face reconstruction method according to an embodiment of the present invention;
[0047] Figure 2b is a first schematic diagram of a wearable device and an image acquisition device according to an embodiment of the present invention;
[0048] Figure 2c is a second schematic diagram of a wearable device and an image acquisition device according to an embodiment of the present invention;
[0049] Figure 2d is a schematic diagram of distortion correction according to an embodiment of the present invention;
[0050] Figure 2e A schematic diagram of splicing and fusion according to an embodiment of the present invention;
[0051] Figure 2f An image example of an open source dataset according to an embodiment of the present invention;
[0052] Figure 2g is a flowchart of face reconstruction according to an embodiment of the present invention;
[0053] Figure 3a is a flowchart of a specific example 1 according to an embodiment of the present invention;
[0054] Figure 3b is a flowchart of a specific example 2 according to an embodiment of the present invention;
[0055] Figure 3c is a flowchart of a specific example 3 according to an embodiment of the present invention;
[0056] Figure 4 is a structural diagram of an internal threat intelligent detection device based on spatiotemporal feature fusion according to an embodiment of the present invention;
[0057] Figure 5 The figure is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0059] Figure 2a FIG. 4 is a flowchart of a method for close-up 3D face reconstruction according to an embodiment of the present invention; Figure 2a As shown, the method includes:
[0060] Step S1, using an image acquisition device to simultaneously acquire a first image and a second image of a face, wherein the first image is an image of the lower left half of the face, and the second image is an image of the lower right half of the face;
[0061] Step S2, preprocessing the first image and the second image, wherein the preprocessing includes correction processing and splicing processing to obtain a fused image of the lower half of the face;
[0062] Step S3, using a pre-trained feature extraction model to determine feature points of the face from the lower half of the fused image, so as to segment the face from the background image;
[0063] Step S4: using a pre-trained face reconstruction model, taking the segmented face image and the feature points of the face as input, to construct a complete image of the face.
[0064] In step S1, an image acquisition device is used to simultaneously acquire a first image and a second image of a face, wherein the first image is an image of the left lower half of the face, and the second image is an image of the right lower half of the face.
[0065] In some embodiments, the image acquisition device includes a first fisheye image acquisition device for acquiring the first image and a second fisheye image acquisition device for acquiring the second image. The image acquisition device is installed on a wearable device so that when the wearable device is worn, the image acquisition device is located at any position of the fundus, temple, eye corner, or nose pad of the face, and the first fisheye image acquisition device and the second fisheye image acquisition device are respectively located on the left and right sides of any position of the fundus, temple, eye corner, or nose pad of the face. For details, see Figure 2b and Figure 2c , Figure 2b is a first schematic diagram of a wearable device and an image acquisition device according to an embodiment of the present invention, Figure 2c2 is a second schematic diagram of a wearable device and an image acquisition apparatus according to an embodiment of the present invention.
[0066] In step S2, the first image and the second image are preprocessed, wherein the preprocessing includes correction processing and stitching processing to obtain a fused image of the lower half of the face.
[0067] In some embodiments, in step S2, the correction processing performed on the first image and the second image includes calculating the corrected distortion projection point P0 using a camera model based on an actual position point P in the real world and an imaging position point P' that is distorted during the imaging process, and the camera model is:
[0068] r d =fθ d =θ(1+k1θ 2 +k2θ 4 +k3θ 6 +k4θ 8 ) (1)
[0069] Among them, r d =|OP'|, represents the distance from the imaging position point P' to the midpoint O of the imaging plane, f is the focal length, θ is the imaging incident angle at point P, θ d is the emission angle of point P when the imaging position point P' is distorted during the imaging process, and k1, k2, k3, and k4 are distortion parameters.
[0070] Specifically, two wide-angle cameras are connected to the device to obtain distorted images of the left and right halves of the face, respectively. The distorted images are first corrected. Taking a fisheye camera (which can shoot close-up objects of 15mm-45mm) as an example, due to the distortion of fisheye images, an isometric projection model is generally used in reality to analyze distortion correction. Generally, the first five terms of the Taylor expansion are taken to approximate the actual projection function of the wide-angle camera:
[0071] r(θ)≈k0θ+k1θ 3 +k2θ 5 +k3θ 7 +k4θ 9
[0072] like Figure 2d As shown, Figure 2d Schematic diagram of distortion correction according to an embodiment of the present invention. There is a point P(x, y, z) in the real world. If there is no distortion according to the pinhole camera projection, the image point is P0 (a, b). Assuming the focal length f = 1, the coordinates of the point P0 and the incident angle θ can be obtained according to the following formula:
[0073]
[0074] Due to the existence of distortion, the actual image point position is P'(x',y'). Combined with the equidistant projection function, the final wide-angle camera model is:
[0075] r d =fθ d =k0θ+k1θ 3 +k2θ 5 +k3θ 7 +k4θ 9
[0076] Because f = 1, the first-order coefficient k0 of θ can be approximated to 1, and the final fisheye camera model can be expressed as:
[0077] r d =fθ d =θ(1+k1θ 2 +k2θ 4 +k3θ 6 +k4θ 8 )
[0078] There is also the principle of similar triangles:
[0079]
[0080] The coordinates of the distorted point P' are obtained as follows:
[0081]
[0082] Finally, the camera intrinsic parameters are used to convert the points on the image plane to the pixel coordinate system to obtain the points on the final image:
[0083]
[0084] The distortion correction process of a fisheye camera is actually to find the actual incident angle θ when the distorted image point position (x′, y′) is known. The camera parameters are known, and θ can be calculated based on (x′, y′) and the camera focal length. d The essence of distortion correction is to solve a univariate high-order equation about θ:
[0085] θ d =θ(1+k1θ 2 +k2θ 4 +k3θ 6 +k4θ 8 )
[0086] Commonly used methods for solving single-variable high-order equations include bisection method, fixed point iteration method, and Newton iteration method. 2 +k2θ 4 +k3θ 6 +k4θ8 )-θ d The loop iterates until f(θ)≈0, or the number of iterations reaches the upper limit.
[0087] Finally, the coordinates of the distorted projection point P0 are obtained:
[0088]
[0089] Finally, the camera intrinsic parameters are used to convert P0(a,b) to the pixel coordinate system to obtain the undistorted pixel coordinates.
[0090] In some embodiments, in step S2, the correction processing performed on the first image and the second image includes calculating the corrected distortion projection point P0 using a camera model based on an actual position point P in the real world and an imaging position point P' that is distorted during the imaging process, and the camera model is:
[0091] r d =fθ d =θ(1+k1θ 2 +k2θ 4 +k3θ 6 +k4θ 8 ) (1)
[0092] Among them, r d =|OP'|, f is the focal length, θ is the incident angle of imaging at point P, θ d is the emission angle of point P when the imaging position point P' is distorted during the imaging process, and k1, k2, k3, and k4 are distortion parameters.
[0093] Specifically, Figure 2e As shown, Figure 2e Schematic diagram of stitching and fusion according to an embodiment of the present invention. Since the corrected image 1 and image 2 have overlapping content, image 1 and image 2 are stitched together to obtain a complete lower half face image. The image stitching output is the union of the two images. The basic process is as follows: (1) Load the input image, load the two photos captured by the camera at the same time point. (2) Feature extraction, detect feature points in all input images, and use the SURF algorithm to detect corners of the image. (3) Image registration, establish the geometric correspondence between images so that they can be transformed, compared and analyzed in a common reference system. In this embodiment, the correspondence is determined by the normalized cross-correlation method. (4) Calculate the homography matrix. In the homography matrix estimation, unnecessary corners that do not belong to the overlapping area are deleted. (5) Deformation and fusion, deform all input images and fuse them into a matching output image. Basically, all input images can be simply deformed to a plane, which is a composite panoramic plane.
[0094] In step S3, the feature points of the human face are determined from the lower half fused image using a pre-trained feature extraction model to segment the human face from the background image.
[0095] In some embodiments, in step S3:
[0096] Pre-training the feature extraction model includes: using an open source data set to train the feature extraction model so that the feature extraction model has the ability to extract all feature points of a complete face;
[0097] The feature points of the human face determined by the feature extraction model include: extracted feature data of the lower half of the human face and predicted feature data of the upper half of the human face.
[0098] Specifically, the VGGFace2 dataset, BUPT-Balancedface dataset, and VoxCeleb2 dataset are an open source dataset containing 30,000 face images. The dataset contains a large number of occluded face images, such as Figure 2f As shown, Figure 2f is an image example of an open source dataset according to an embodiment of the present invention. A deep convolutional neural network is used to train the multi-view face image data in the above dataset to obtain a pre-trained model. For the input user video stream data, after each frame undergoes the above correction and splicing process, 68 2D facial feature points are first detected, and then face segmentation is performed. In some embodiments, a face alignment algorithm is used to obtain the three-dimensional face landmarks of the training dataset image, and a face segmentation algorithm is used to obtain the face segmentation result.
[0099] In step S4, a pre-trained face reconstruction model is used to construct a complete image of the face by taking the segmented face image and the feature points of the face as input.
[0100] In some embodiments, in step S4, the training environment of the pre-trained face reconstruction model is: windows10+cuda10.2+cudann 7.6.5+pytorch1.6+pytorch3d0.2, the number of iterations is 300, and the number of selected samples is batchsizes=48 to complete the pre-training of the face reconstruction model.
[0101] In some embodiments, in the step S4, during the pre-training process of the face reconstruction model, for the pre-training of the lossy rough face reconstruction, the face key point loss, eye closure loss, photo-based loss, shape continuity loss, and contour regularization loss are used as measurement basis; for the pre-training of the detailed face reconstruction, the photo detail loss, soft symmetry loss, and detail regularization loss are used as measurement basis.
[0102] Specifically, in the reconstruction stage, based on the segmented face image and the feature points of the face, the trained face reconstruction model is used to output the predicted face details, shape, albedo, expression, posture, lighting and other parameters, and the above parameters are input into the FLAME (a lightweight and expressive universal head model, which can be learned from more than 33,000 accurately aligned 3D scans, combining the linear identity shape space (trained by head scans of 3,800 subjects) with articulated necks, jaws and eyeballs, posture-related correction blend shapes and other global expression blend shapes) model to obtain the vertex data of the face, and finally obtain the face 3D model file, thereby completing the reconstruction process of the face. Figure 2g As shown in the figure, a deep convolutional neural network is used to train the multi-view face image data in the above dataset to obtain a training model. The training model outputs the predicted face details, shape, albedo, expression, posture and lighting parameters, etc. The above parameters are input into the FLAME model to obtain vertex data, triangles and texture features. The above three-dimensional information is written into an obj file to obtain a three-dimensional face model file.
[0103] Specific examples
[0104] Figure 3a is a flowchart of a specific example 1 according to an embodiment of the present invention; Figure 3b is a flowchart of a specific example 2 according to an embodiment of the present invention; Figure 3c Flowchart of specific example 3 according to an embodiment of the present invention.
[0105] Specifically, in Example 2:
[0106] Turn on the camera and rebuild the system switch;
[0107] The angle of the fisheye camera is 180 degrees and the focal length is 15mm;
[0108] Perform fisheye camera distortion correction on the obtained face image;
[0109] The stitching used panoramic stitching;
[0110] The operating environment of the 3D face reconstruction code training phase based on deep learning is:
[0111] windows10+cuda10.2+cudann 7.6.5+pytorch1.6+pytorch3d0.2, 30,000 face images were used for training, 300 iterations, batchsizes=48;
[0112] The trained model is used for model inference of face reconstruction. The running environment of the inference model is windows10+cuda10.2+cudann 7.6.5+pytorch1.6+pytorch3d0.2;
[0113] Get three-dimensional face driving data, which can be used in remote conferences.
[0114] Specifically, in Example 3:
[0115] Turn on the camera and rebuild the system switch;
[0116] The fisheye camera angle is 180;
[0117] Perform fisheye camera distortion correction on the obtained face image;
[0118] The stitching used panoramic stitching;
[0119] The operating environment of the 3D face reconstruction code training phase based on deep learning is:
[0120] windows10+cuda10.2+cudann 7.6.5+pytorch1.6+pytorch3d0.2, 30,000 face images were used for training, 300 iterations, batchsizes=48;
[0121] The trained model is used for model inference of face reconstruction. The running environment of the inference model is windows10+cuda10.2+cudann 7.6.5+pytorch1.6+pytorch3d0.2;
[0122] Get the actor's 3D face model.
[0123] The second aspect of the present invention discloses a close-up three-dimensional face reconstruction device. Figure 4 is a structural diagram of an internal threat intelligent detection device based on spatiotemporal feature fusion according to an embodiment of the present invention; Figure 4 As shown, the device 400 includes:
[0124] The first processing unit 401 is configured to call an image acquisition device to simultaneously acquire a first image and a second image of a face, wherein the first image is an image of a left lower half of the face, and the second image is an image of a right lower half of the face;
[0125] The second processing unit 402 is configured to preprocess the first image and the second image, wherein the preprocessing includes correction processing and splicing processing to obtain a fused image of the lower half of the face;
[0126] The third processing unit 403 is configured to call a pre-trained feature extraction model to determine feature points of the face from the lower half fused image to segment the face from the background image;
[0127] The fourth processing unit 404 is configured to call a pre-trained face reconstruction model, take the segmented face image and the feature points of the face as input, and construct a complete image of the face.
[0128] According to the device of the second aspect of the present invention, the image acquisition device includes a first fisheye image collector for acquiring the first image and a second fisheye image collector for acquiring the second image, and the image acquisition device is installed on a wearable device so that when the wearable device is worn, the image acquisition device is located at any position of the fundus, temple, corner of the eye, or nose pad of the human face, and the first fisheye image collector and the second fisheye image collector are respectively located on the left and right sides of any position of the fundus, temple, corner of the eye, or nose pad of the human face.
[0129] According to the device of the second aspect of the present invention, the second processing unit 402 is specifically configured to perform the correction processing on the first image and the second image, including calculating the corrected distortion projection point P0 using a camera model based on an actual position point P in the real world and an imaging position point P' that is distorted during the imaging process, wherein the camera model is:
[0130] r d =fθ d =θ(1+k1θ 2 +k2θ 4 +k3θ 6 +k4θ 8 ) (1)
[0131] Among them, r d =|OP'|, represents the distance from the imaging position point P' to the midpoint O of the imaging plane, f is the focal length, θ is the imaging incident angle at point P, θ d is the emission angle of point P when the imaging position point P' is distorted during the imaging process, and k1, k2, k3, and k4 are distortion parameters.
[0132] According to the device of the second aspect of the present invention, the second processing unit 402 is specifically configured as follows: the splicing process includes:
[0133] Extracting features from the calibrated first image and the calibrated second image, and performing corner point detection on the features to establish a geometric correspondence between the calibrated first image and the calibrated second image in the same coordinate system;
[0134] Based on the geometric correspondence, the region outside the overlapping region of the calibrated first image and the calibrated second image is deleted by using homography matrix estimation, so as to fuse the calibrated first image and the calibrated second image based on the overlapping region.
[0135] According to the device of the second aspect of the present invention, the third processing unit 403 is specifically configured as follows:
[0136] Pre-training the feature extraction model includes: using an open source data set to train the feature extraction model so that the feature extraction model has the ability to extract all feature points of a complete face;
[0137] The feature points of the human face determined by the feature extraction model include: extracted feature data of the lower half of the human face and predicted feature data of the upper half of the human face.
[0138] According to the device of the second aspect of the present invention, the training environment of the pre-trained face reconstruction model is: windows10+cuda10.2+cudann 7.6.5+pytorch1.6+pytorch3d0.2, the number of iterations is 300, and the number of selected samples is batchsizes=48, to complete the pre-training of the face reconstruction model.
[0139] According to the device of the second aspect of the present invention, in the pre-training process of the face reconstruction model, for the pre-training of the lossy rough face reconstruction, the face key point loss, eye closure loss, photo-based loss, shape continuity loss, and contour regularization loss are used as measurement basis; for the pre-training of the detailed face reconstruction, the photo detail loss, soft symmetry loss, and detail regularization loss are used as measurement basis.
[0140] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in any one of the close-up three-dimensional face reconstruction methods described in the first aspect of the present disclosure are implemented.
[0141] Figure 5 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 5As shown, the electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the housing of the electronic device, or an external keyboard, touch pad or mouse, etc.
[0142] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a structural diagram of the part related to the technical solution of the present disclosure, and does not constitute a limitation on the electronic device to which the technical solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0143] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any one of the close-up 3D face reconstruction methods described in the first aspect of the present disclosure are implemented.
[0144] In summary, the present invention uses two fisheye cameras near the nose pad to obtain the lower half of the face, and then uses deep learning to analyze the facial expression of the lower half to restore the complete face; that is, only the lower half of the face image is needed to reconstruct the complete face image, and there is no need to collect face information from multiple perspectives; the reconstruction effect of deep learning has the facial expression details and can accurately express the emotions of the face; the entire reconstruction does not require other sensor hardware, and there is no need to consider the loose contact problem caused by the strain gauge, and the equipment is simple, light and easy to implement.
[0145] The technical solution provided by the present invention can effectively reduce the system's dependence on sensors. Users only need to wear VR glasses and the three-dimensional face reconstruction device described in this article to realize action collection of behavioral content, three-dimensional face modeling, and data synchronization; it can also be connected to AR / VR glasses of different brands or models through a communication interface, and has high portability; at the same time, it does not affect the scope of existing commercial hardware usage scenarios, can face open spaces and eliminate the obstruction of external image acquisition devices, has strong stability, and is beautiful and lightweight.
[0146] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.
Claims
1. A close-up 3D face reconstruction method, characterized in that: The method comprises: Step S1, using an image acquisition device to simultaneously acquire a first image and a second image of a face, wherein the first image is an image of the lower left half of the face, and the second image is an image of the lower right half of the face; Step S2, preprocessing the first image and the second image, wherein the preprocessing includes correction processing and splicing processing to obtain a fused image of the lower half of the face; Step S3, using a pre-trained feature extraction model to determine feature points of the face from the lower half of the fused image, so as to segment the face from the background image; Step S4: using a pre-trained face reconstruction model, taking the segmented face image and the feature points of the face as input, to construct a complete image of the face.
2. A close-up 3D face reconstruction method according to claim 1, characterized in that: The image acquisition device includes a first fisheye image collector for acquiring the first image and a second fisheye image collector for acquiring the second image. The image acquisition device is installed on a wearable device so that when the wearable device is worn, the image acquisition device is located at any position of the fundus, temple, eye corner, or nose pad of the human face, and the first fisheye image collector and the second fisheye image collector are respectively located on the left and right sides of any position of the fundus, temple, eye corner, or nose pad of the human face.
3. A close-up 3D face reconstruction method according to claim 2, characterized in that: In the step S2, the correction processing performed on the first image and the second image includes calculating the corrected distortion projection point P0 using a camera model based on an actual position point P in the real world and an imaging position point P' that is distorted during the imaging process, and the camera model is: r d =fθ d =θ(1+k1θ 2 +k2θ 4 +k3θ 6 +k4θ 8 ) (1) Among them, r d =|OP'|, represents the distance from the imaging position point P' to the midpoint O of the imaging plane, f is the focal length, θ is the imaging incident angle at point P, θ d is the emission angle of point P when the imaging position point P' is distorted during the imaging process, and k1, k2, k3, and k4 are distortion parameters.
4. The method for close-up 3D face reconstruction according to claim 3, characterized in that: In step S2, the splicing process includes: Extracting features from the calibrated first image and the calibrated second image, and performing corner point detection on the features to establish a geometric correspondence between the calibrated first image and the calibrated second image in the same coordinate system; Based on the geometric correspondence, the region outside the overlapping region of the calibrated first image and the calibrated second image is deleted by using homography matrix estimation, so as to fuse the calibrated first image and the calibrated second image based on the overlapping region.
5. A close-up 3D face reconstruction method according to claim 4, characterized in that: In step S3: Pre-training the feature extraction model includes: using an open source data set to train the feature extraction model so that the feature extraction model has the ability to extract all feature points of a complete face; The feature points of the human face determined by the feature extraction model include: extracted feature data of the lower half of the human face and predicted feature data of the upper half of the human face.
6. A close-up 3D face reconstruction method according to claim 5, characterized in that: In the step S4, the training environment of the pre-trained face reconstruction model is: windows10+cuda10.2+cudann 7.6.5+pytorch1.6+pytorch3d0.2, the number of iterations is 300, and the number of selected samples is batchsizes=48, to complete the pre-training of the face reconstruction model.
7. The method for close-up 3D face reconstruction according to claim 6, characterized in that: In the step S4, during the pre-training process of the face reconstruction model, the pre-training of lossy rough face reconstruction is measured based on face key point loss, eye closure loss, photo-based loss, shape continuity loss, and contour regularization loss; and the pre-training of detailed face reconstruction is measured based on photo detail loss, soft symmetry loss, and detail regularization loss.
8. A close-up three-dimensional face reconstruction device, characterized in that: The device comprises: A first processing unit is configured to call an image acquisition device to simultaneously acquire a first image and a second image of a face, wherein the first image is an image of a left lower half of the face, and the second image is an image of a right lower half of the face; A second processing unit is configured to preprocess the first image and the second image, wherein the preprocessing includes a correction process and a splicing process to obtain a fused image of the lower half of the face; A third processing unit is configured to call a pre-trained feature extraction model to determine feature points of the face from the lower half fused image to segment the face from the background image; The fourth processing unit is configured to call a pre-trained face reconstruction model, take the segmented face image and the feature points of the face as input, and construct a complete image of the face.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the close-up three-dimensional face reconstruction method described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps in the close-up three-dimensional face reconstruction method described in any one of claims 1 to 7 are implemented.
