Disclosure of Invention
The present invention is directed to the above problems in the prior art, and provides a method for synthesizing a 3D human face model by using optical reflection.
In order to realize the purpose of the invention, the invention adopts the following technical scheme: a method for synthesizing a 3D face model by utilizing optical reflection comprises the following steps:
s100, acquiring a plurality of human face three-dimensional images and RGB (red, green and blue) color images at a plurality of angles relative to a front face from an optical reflector by rotating a 3D structured light rotating module, wherein the optical reflector corresponds to the human face three-dimensional image acquisition positions at all angles respectively;
s200, generating point cloud images and color maps corresponding to all angles according to the human face three-dimensional images and the RGB color images.
S300, synthesizing corresponding point cloud images in two human face three-dimensional images with the minimum positive face angle absolute value into a first synthesized image;
s400, sequentially synthesizing point cloud images corresponding to the human face three-dimensional images with the residual angles with a first synthetic image;
and S500, rendering the synthesized image according to the color map to obtain a 3D face model.
The working principle and the beneficial effects are as follows: 1. compared with the prior art, the whole equipment does not need to be rotated to shoot the face of the user, so that a large-structure driving mechanism is omitted, only a simple and small rotating mechanism is needed to rotate the 3D structured light rotating module, and the shooting of all angles of the face can be realized under the conditions that the equipment does not rotate and the face does not rotate by matching with the multi-surface light reflector, so that the defects of slow rotation of the whole machine and long imaging time are overcome, the equipment cost is obviously reduced, and the equipment has the advantages of simple structure, convenience in operation, short shooting time and good user experience;
2. compared with the fixed single-lens scheme in the prior art, the method can generate the human face three-dimensional image in the same-size equipment, and the structural light camera is adopted, so that more accurate human face depth information can be obtained, and the single-lens scheme can only generate a two-dimensional human face image, so that the two human face three-dimensional image and the single-lens scheme have obvious difference;
3. compared with the scheme of multiple lenses, the method has the advantages that only one lens is provided, the cost is obviously lower, and the structure is simpler.
4. The two human face three-dimensional images with the minimum relative frontal face angle absolute value are the two human face three-dimensional images closest to the front face of the human face, and comprise lips, noses and eyes of the human face, the depth information has large fluctuation and is easy to register, so that the two human face three-dimensional images are used as registration starting points and can be conveniently positioned.
Further, the number of the optical reflectors is four, and the four optical reflectors correspond to-15 degrees, -45 degrees and 45 degrees of the opposite frontal face respectively, wherein the synthesizing step comprises:
s300, synthesizing point cloud images corresponding to the two human face three-dimensional images at the angles of-15 degrees and 15 degrees to obtain a first synthesized image;
s400, synthesizing a point cloud image corresponding to a human face three-dimensional image at-45 degrees or 45 degrees with the first synthetic image to obtain a second synthetic image;
s500, synthesizing the corresponding point cloud image in the remaining three-dimensional face image with a second synthetic image to obtain a complete 3D face image;
s600, rendering the complete face 3D image according to the color map to obtain a 3D face model.
Further, the step of synthesizing the image comprises:
s410, point cloud data output by the 3D structured light rotating module are obtained;
s420, performing coarse registration of the position and the rotation angle of a preset 3D structured light rotation module according to the point cloud data;
s430, performing fine registration according to the coincident points in the point cloud data;
s440, filtering coincident points to complete synthesis and splicing.
Through the steps, the two synthetic images can be spliced quickly to form a complete human face 3D model for subsequent rendering.
Further, the rendering step includes:
s450, performing three-dimensional reconstruction on the spliced point cloud data to produce a triangular mesh;
and S460, obtaining a mapping picture obtained by the RGB camera in the 3D structured light rotation module, and pasting the mapping picture on the grid of the reconstructed three-dimensional model to generate the 3D face model.
Through the steps, the face 3D model can be covered with the color two-dimensional photos to obtain the vivid 3D face model, the face model can be rotatably observed on computer equipment, doctors can observe the face model conveniently, and the height of the nose, the depression of eyes, the depth of wrinkles, the size of the mouth and the protruding condition can be clearly known.
The 3D structured light full-face imaging device comprises a head holding area, a 3D structured light rotating module and a plurality of optical reflectors; the 3D structured light rotating module is positioned in the center of the front of the head holding area and can rotate by taking the 3D structured light rotating module as an axis by being driven by the rotating shaft; the optical reflector is arranged around the 3D structured light rotating module; the number of the optical reflectors is four, and the optical reflectors are respectively correspondingly positioned at-45 degrees, -15 degrees, 15 degrees and 45 degrees of the human face in the head resting area. The device can quickly scan the face of the user, thereby conveniently forming the 3D face model of the user.
Furthermore, the optical reflector is divided into a first reflector, a second reflector, a third reflector and a fourth reflector, the connecting line of the 3D structured light rotating module and the head holding area is a 0-degree line, the included angle between the connecting line of the first reflector and the head holding area and the 0-degree line is 90 degrees, the included angle between the connecting line of the second reflector and the head holding area and the 0-degree line is 45 degrees, the third reflector and the second reflector are arranged in a mirror image mode with the 0-degree line, and the fourth reflector and the first reflector are arranged in a mirror image mode with the 0-degree line. According to the scheme, the position of each reflector can be quickly positioned, and the installation of each reflector is convenient. This scheme only need rotate the pivot in proper order can, pivot clockwise or anticlockwise rotation promptly, get back to initial position at last, rotate at every turn all accessible motor and fix a position, also can stop through opening of control motor and stop and shoot the operation, and control is convenient, realizes that the degree of difficulty is low.
Furthermore, the rotating shaft drives the 3D structured light rotating module to sequentially turn to the first reflecting mirror, the second reflecting mirror, the third reflecting mirror and the fourth reflecting mirror. This scheme only need rotate the pivot in proper order can, pivot clockwise or anticlockwise rotation promptly, get back to initial position at last, rotate at every turn all accessible motor and fix a position, also can stop through opening of control motor and stop and shoot the operation, and control is convenient, realizes that the degree of difficulty is low.
Furthermore, the three-dimensional light source further comprises a light shield and an illuminating lamp arranged in the light shield, and the light shield shields the head holding area, the 3D structured light rotating module and the plurality of optical reflectors. This scheme can remove external light source's influence from effectively, and the light that inside was opened can be opened according to the demand.
Furthermore, the head resting area is provided with a chin rest and a forehead rest, and the face of a person is fixed through the chin rest and the forehead rest. According to the scheme, the head of the user can be conveniently fixed, the use experience is good, the head of the user can be always located at the optimal height, and a complete human face model is generated.
Further, the reflectivity of each optical reflector is greater than or equal to 90%. The optical reflector with the reflectivity of more than 90% can provide better collected images for the 3D structured light rotating module, and the quality of the final human face model is remarkably improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
It will be understood by those skilled in the art that in the present disclosure, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like are used in an orientation or positional relationship indicated in the drawings for ease of description and simplicity of description, and do not indicate or imply that the referenced device or element must have a particular orientation, be constructed and operated in a particular orientation, and thus, the above terms should not be construed as limiting the present invention.
For ease of understanding, the principle of 3D structured light is explained first: the basic principle of the 3D structured light technology is that light rays with certain structural characteristics are projected to a shot object through a near-infrared laser, and then collected through a special infrared camera. The light with a certain structure can acquire different image phase information according to different depth areas of a shot object, and then the change of the structure is converted into depth information through an arithmetic unit, so that a three-dimensional structure is obtained. In short, the three-dimensional structure of the object to be photographed is acquired by an optical means, and the acquired information is applied more deeply.
A depth image is also called a distance image, and is an image in which a distance (depth) value from an image pickup to each point in a scene is set as a pixel value.
Point cloud: when a laser beam irradiates the surface of an object, the reflected laser beam carries information such as direction, distance and the like. When the laser beam is scanned along a certain trajectory, the reflected laser spot information is recorded while scanning, and since the scanning is extremely fine, a large number of laser spots can be obtained, and a laser point cloud can be formed. The point cloud data is discrete data obtained by scanning and sampling the surface of a real object.
The depth image can be calculated into point cloud data through coordinate conversion; the point cloud data with regular and necessary information can be inversely calculated as a depth image. The two can be mutually converted under certain conditions.
As shown in fig. 1-3, the device used in the method includes a head resting area 1, a 3D structured light rotation module 2 and a plurality of optical reflectors, wherein a chin rest 3 matched with the chin of the human face and a forehead rest 13 used for abutting against the forehead of the human face are arranged at the head resting area 1, the head can be fixed by a support similar to the chin rest 3 abutting against the top of the head, soft pads such as latex pads can be installed on the chin rest 3 and can be replaced by itself, and the disinfection is facilitated, when the device is used, the chin rest 3 of a user 4 is on the chin rest 3, the 3D structured light rotation module 2 is installed on a rotating shaft 5, and the 3D structured light rotation module 2 at least includes an RGB camera and a structured light camera. The establishment of the human face model is realized through the RGB camera and the structured light camera.
Specifically, 3D structure light rotates module 2 and is located 1 the place ahead in head and shelve the district and just put the position, can rotate as the axle center by oneself through 5 drives of pivot, and pivot 5 is driven through common step motor 6 or servo motor 6, and motor 6 is through common computer equipment control, and 3D structure light rotates module 2 also through computer equipment control, generates the people's face model on computer equipment.
Specifically, the optical reflector is disposed around the 3D structured light rotation module 2 and used for reflecting light emitted from the 3D structured light rotation module 2, and the optical reflector is a commercially available product and is mounted on an external fixing bracket by means of screws, glue, and the like, and the fixing bracket is not shown in the drawing.
Preferably, the reflectivity of each of the optical mirrors is equal to or greater than 90%. The optical reflector with the reflectivity of more than 90% can provide better collected images for the 3D structured light rotating module 2, and the quality of the final human face model is remarkably improved.
In this embodiment, the head support device further comprises a light shield 7 and an illuminating lamp 8 arranged in the light shield 7, the head resting area 1, the 3D structured light rotating module 2 and the plurality of optical reflectors are shielded by the light shield 7, wherein the light shield 7 can be common black cloth and can be directly covered on the device or a cover made of other opaque materials, as shown in fig. 1, the device is made into a semi-closed structure, only an opening for the head of a user to enter is exposed, and a forehead support 13 for supporting the forehead of the user is arranged, and when the 3D structured light rotating module 2 shoots, the illuminating lamp 8 is closed. Mainly in order to avoid the lighting lamp 8 from influencing the shooting. This scheme can remove the influence of external light source from effectively, and the light 8 of inside opening can be opened according to the demand.
Preferably, the number of the optical reflectors is four, the optical reflectors are respectively corresponding to-45 degrees, -15 degrees, 15 degrees and 45 degrees of the face of the head resting area 1, the optical reflectors are divided into a first reflector 9, a second reflector 10, a third reflector 11 and a fourth reflector 12, a connecting line between the 3D structured light rotating module 2 and the head resting area 1 is a 0-degree line, an included angle between the connecting line between the first reflector 9 and the head resting area 1 and the 0-degree line is 90 degrees, an included angle between the connecting line between the second reflector 10 and the head resting area 1 and the 0-degree line is 45 degrees, the third reflector 11 and the second reflector 10 are arranged in a 0-degree line mirror image mode, and the fourth reflector 12 and the first reflector 9 are arranged in a 0-degree line mirror image mode. According to the scheme, the position of each reflector can be quickly positioned, and the installation of each reflector is convenient. According to the figure 3, the mounting angles corresponding to the reflectors are-90 degrees, -45 degrees, 45 degrees and 90 degrees, the angles of the motor 6 required to rotate are-45 degrees, -105 degrees, 105 degrees and 45 degrees in sequence, and when the motor 6 rotates to-45 degrees, the motor corresponds to the first reflector 9 of-90 degrees, and human face data of-45 degrees is obtained;
when the motor 6 rotates to-105 degrees, the second reflector 10 at-45 degrees is corresponded to obtain-15 degrees face data;
when the motor 6 rotates to 105 degrees, the third reflector 11 with 45 degrees is corresponded to, and 15-degree face data is obtained;
when the motor 6 rotates to 45 degrees, the fourth reflector 12 corresponds to 90 degrees, and 45-degree face data is obtained.
Therefore, when the three-dimensional display device is used, the rotating shaft 5 drives the 3D structured light rotating module 2 to sequentially turn to the first reflecting mirror 9, the second reflecting mirror 10, the third reflecting mirror 11 and the fourth reflecting mirror 12, the rotating shaft 5 is started to rotate to a-45-degree position, RGB light, PL and UV light of the 3D structured light rotating module 2 are sequentially turned on to shoot to obtain a group of pictures and corresponding depth data information, then the rotating shaft 5 is turned to-105 degrees, 105 degrees and 45-degree positions to respectively sequentially turn on the RGB light, PL and UV light to shoot to respectively obtain 3 different groups of pictures and corresponding depth data information, and the illuminating lamp 8 is turned off when shooting. This scheme only need rotate pivot 5 in proper order can, 5 clockwise or anticlockwise rotations of pivot promptly, get back to initial position at last, rotate at every turn and all can fix a position through motor 6, also can stop through opening of control motor 6 and stop and shoot the operation, and control is convenient, realizes that the degree of difficulty is low.
As shown in fig. 4, the method for synthesizing a 3D face model by using optical reflection includes the following steps:
s000, placing the face of the user on a head resting area 1 on the device, and starting the device;
s100, driving a 3D structured light rotating module 2 to rotate through a motor 6 to obtain face three-dimensional images and RGB color images which are-15 degrees, -45 degrees and 45 degrees relative to the front face from optical reflectors, wherein the number of the optical reflectors is four, and the optical reflectors correspond to the face three-dimensional image obtaining positions of all angles respectively;
compared with the prior art, need not to rotate whole equipment and come to shoot user's face, consequently, the drive mechanism that has huge structure has been saved, only need simple small and exquisite slewing mechanism rotate 3D structure light rotate module 2 can, cooperation multiaspect light speculum can realize shooing each angle of face under the equipment does not rotate and the non-pivoted condition of face, is showing and is reducing equipment cost, and has simple structure, convenient operation, the shooting time is short, user experience is good advantage.
Compared with the fixed single-lens scheme in the prior art, the method can generate the human face three-dimensional image in the equipment with the same size, and the single-lens scheme can only generate the two-dimensional human face image, so that the human face three-dimensional image and the single-lens scheme have obvious difference.
Compared with the scheme of multiple lenses, the method has the advantages that only one lens is provided, the cost is obviously lower, and the structure is simpler.
S200, generating a 3D point cloud image and a color map corresponding to each angle through the 3D structured light rotation module 2 and internal and external parameter parameters of the RGB color camera, wherein the generated algorithm is the prior art;
s300, synthesizing point cloud images corresponding to the two human face three-dimensional images at the angles of-15 degrees and 15 degrees to obtain a first synthesized image;
15-degree and 15-degree images contain lips, noses and eyes of the human face, the depth information is large in fluctuation and easy to register, and therefore the two images are used as registration starting points
S400, synthesizing point cloud images corresponding to the two human face three-dimensional images at the angle of minus 45 degrees to obtain a first synthesized image and a second synthesized image;
s500, synthesizing the point cloud images corresponding to the two human face three-dimensional images with the angle of 45 degrees with a second synthetic image to complete a human face 3D image;
s600, point cloud data output by the 3D structured light rotating module 2 are obtained, n down-sampling is carried out on the corresponding point cloud data, the number of points in the point cloud data is reduced, filtering operation is equivalent, and the synthesis speed is improved;
s610, performing preset coarse registration of the position and the rotation angle of the 3D structured light rotation module 2 according to the point cloud data, specifically, performing translation and rotation on the selected point cloud data according to the shooting distance and the shooting angle of the 3D structured light rotation module 2 to enable the selected point cloud data to be located at the spatial coordinate (0, 0) position, and completing the coarse registration;
s620, performing fine registration according to the coincident points in the point cloud data, specifically by setting parameters of the existing registration algorithm;
s630, filtering coincident points to complete synthesis and splicing;
s640, performing three-dimensional reconstruction on the spliced point cloud data to produce a triangular mesh;
s650, obtaining a mapping picture obtained by the RGB camera in the 3D structured light rotation module 2, and pasting the mapping picture on a grid of the reconstructed three-dimensional model to generate a 3D face model. The data that the structure light camera of rotating in the module 2 was obtained through 3D structure light, we can accurately know every point in the image and apart from the camera distance, add the (x, y) coordinate of this point in the 2D image of RGB camera like this, just can acquire the three-dimensional space coordinate of every point in the image, it can cover colored two-dimensional photo with people's face 3D model to correspond the net, obtain lifelike 3D face model, can rotate on the computer equipment and observe, very big convenient doctor observes, can clearly know the height of nose, the subsides of eyes, the depth of wrinkle, the size and the outstanding condition of mouth shape.
Referring to fig. 9, 1-4 in the drawings represent the images collected by the first mirror 9, the second mirror 10, the third mirror 11, and the fourth mirror 12, respectively, see fig. 5-8, and the middle of fig. 9 is a merged rendered image, the original image is a color image and has more facial details, and the generated face model can be used for analyzing the face skin, such as wrinkle depth, pox size, and the like.
The advantage that this scheme adopted structured light (speckle) mainly has:
1) the scheme is mature, the camera base line can be made smaller, and the miniaturization is facilitated.
2) The resource consumption is low, the depth map can be calculated by a single frame IR map, and the power consumption is low.
3) Active light source, can also be used at night.
4) The precision is high in a certain range, the resolution is high, the resolution can reach 1280x1024, and the frame rate can reach 60 FPS.
The present invention is not described in detail in the prior art, and therefore, the present invention is not described in detail.
It is understood that the terms "a" and "an" should be interpreted as meaning that a number of one element or element is one in one embodiment, while a number of other elements is one in another embodiment, and the terms "a" and "an" should not be interpreted as limiting the number.
Although the terms head rest 1, 3D structured light turning module 2, chin rest 3, user 4, spindle 5, motor 6, light shield 7, illumination lamp 8, first mirror 9, second mirror 10, third mirror 11, fourth mirror 12, forehead rest 13, etc. are used more herein, the possibility of using other terms is not excluded. These terms are used merely to more conveniently describe and explain the nature of the present invention; they are to be construed as being without limitation to any additional limitations that may be imposed by the spirit of the present invention.
The present invention is not limited to the above-mentioned preferred embodiments, and any other products in various forms can be obtained by anyone in the light of the present invention, but any changes in the shape or structure thereof, which have the same or similar technical solutions as those of the present application, fall within the protection scope of the present invention.