Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a payment system with 3D face recognition and a using method thereof.
The payment system with the 3D face recognition function comprises a 3D face recognition module and a face recognition payment module;
the 3D face recognition module is used for collecting a face image of a target face, and performing face recognition and living body recognition on the face image, wherein the face image comprises any one or more of an RGB face image, an infrared face image, a depth face image and a 3D face image;
and the face recognition payment module is used for controlling a door lock to unlock when the face image is judged to be the living face and the face image is the preset white list face, and otherwise, carrying out error prompt.
Preferably, the 3D face recognition module includes a first computing unit, a laser speckle projector, and an infrared detector; the laser speckle projector and the infrared detector are electrically connected with the first computing unit;
the laser speckle projector is used for projecting speckle-shaped infrared beams to a target face;
the infrared detector is used for collecting light spot patterns formed by infrared beams reflected by the target face;
the first calculating unit is used for acquiring the light spot image and further calculating and generating a depth face image of the target face according to the deformation or displacement of the light spot pattern.
Preferably, the 3D face recognition module includes a second calculation unit, a light projector, and a TOF sensor; the light projector, the RGB camera module and the infrared camera module are electrically connected with the second computing unit;
the light projector is used for projecting infrared floodlight to the target face;
the TOF sensor is used for receiving infrared floodlight reflected by a target face and generating a plurality of infrared face images;
and the second calculating unit is used for calculating and generating the depth image of the surface of the target face according to the phase difference of a plurality of infrared face images in a preset acquisition period.
Preferably, a first proximity sensor is further included; the first proximity sensor is electrically connected with the face recognition payment module;
the first proximity sensor is used for detecting the distance of the target human face;
and the 3D face recognition module is used for acquiring a 3D face image of the target face when the distance is smaller than a preset distance threshold.
Preferably, the 3D face recognition module further comprises an RGB camera module;
the RGB camera module is used for collecting RGB face images of the target face;
the first calculating unit or the second calculating unit is used for identifying whether the RGB face image is a preset white list face.
Preferably, the LED floodlight source is also included;
the LED floodlight source is used for projecting a floodlight beam to the target face;
the infrared detector or the TOF sensor is used for collecting an infrared face image formed by a target face reflecting floodlight beam;
the first calculating unit is used for identifying whether the infrared face image is a preset white list face.
Preferably, the 3D face recognition module and the face recognition payment module transmit RGB face images through a USB on the one hand, and transmit control instructions and recognition results through a serial port on the other hand.
Preferably, the living body face recognition is performed through a preset living body detection model, and the training of the living body detection model comprises the following steps:
step M1: collecting a plurality of face images, and performing key point detection on each face image to determine a plurality of face key points;
step M2: normalizing the face image to a preset size to generate a preprocessed face image, and acquiring the position of each face key point in the preprocessed face image;
step M3: selecting a plurality of face key points in each face image, and taking the selected face key points as centers to intercept the face key points to a plurality of ROI (region of interest), wherein the ROI comprises any area of a left eye area, a right eye area, a nose tip area and a mouth area in the face image;
step M4: and synthesizing the ROI corresponding to each face image into training data, and training according to the training data to generate the living body detection model.
Preferably, the living body detection model comprises a first living body detection model generated based on RGB face image training, a second living body detection model generated based on infrared face image training and a third living body detection model generated based on depth face image training;
when the living body face recognition is carried out, the living body face recognition is carried out through any one model or any multiple models of the first living body detection model, the second living body detection model and the third living body detection model;
when the living body is identified by the plurality of living body detection models, the face image is determined to be a living body face only when all of the plurality of living body detection models are determined to be the living body face.
The invention provides a using method of a payment system with 3D face recognition, which comprises the following steps:
step S1: detecting the distance of the target face, and triggering the step S2 when the distance is smaller than a preset distance threshold;
step S2: collecting a face image of the target face, wherein the face image comprises any one or more of an RGB face image, an infrared face image, a depth face image and a 3D face image;
step S3: and carrying out face recognition and living body recognition on the face image, controlling a door lock to unlock when the face image is judged to be a living body face and the face image is a preset white list face, and otherwise carrying out error prompt.
Compared with the prior art, the invention has the following beneficial effects:
the method comprises the steps of collecting a face image through a 3D face recognition module, carrying out living body recognition and face recognition on the face image, judging whether the collected target face is a living body image or not and whether the collected target face is a preset registered face or not, and executing money deduction operation on a payment account corresponding to the registered face when the living body recognition result is a living body and the face image is the registered face, so that safe payment can be realized through face recognition;
in the invention, the 3D face recognition module is controlled to collect the face image through the trigger signal, so that the problems that the 3D face recognition module collects the face image and repeatedly calculates the depth face image at all times, the calculation resource waste and the equipment power consumption increase are avoided.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that variations and modifications can be made by persons skilled in the art without departing from the spirit of the invention. All falling within the scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
The invention provides a payment system with 3D face recognition, and aims to solve the problems in the prior art.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a payment system with 3D face recognition in an embodiment of the present invention, and as shown in fig. 1, the payment system with 3D face recognition provided in the present invention includes a 3D face recognition module and a face recognition payment module;
the 3D face recognition module is used for collecting a face image of a target face after receiving the trigger signal, carrying out living body recognition on the face image and generating a living body recognition result, wherein the face image comprises any one or more of an RGB face image, an infrared face image and a depth face image;
the face recognition payment module is used for sending the trigger signal, receiving the face image and the living body recognition result, judging whether the face image is a registered face or not when the living body recognition result is a living body, and executing a deduction operation on a payment account corresponding to the registered face when the face image is the registered face.
In the embodiment of the invention, the registered face is registered for a face image which is acquired in advance, and the registered face is associated with a corresponding payment account.
In the embodiment of the invention, the 3D face recognition module is controlled to collect the face image through the trigger signal, so that the problems that the 3D face recognition module collects the face image and repeatedly calculates the depth face image at all times, and the waste of computing resources and the increase of equipment power consumption are caused are avoided.
In the embodiment of the invention, the face image is collected through the 3D face recognition module, living body recognition and face recognition are carried out on the face image to judge whether the collected target face is a living body image and whether the collected target face is a preset registered face, and when the living body recognition result is a living body and the face image is the registered face, a deduction operation is carried out on a payment account corresponding to the registered face, so that safe payment can be realized through the face recognition.
Fig. 2 is a schematic diagram of a 3D face recognition module according to an embodiment of the present invention, and as shown in fig. 2, the 3D face recognition module includes a first computing unit, a laser speckle projector, and an infrared detector; the laser speckle projector and the infrared detector are electrically connected with the first computing unit;
the laser speckle projector is used for projecting speckle-shaped infrared beams to a target face;
the infrared detector is used for collecting light spot patterns formed by infrared beams reflected by the target face;
the first calculating unit is used for acquiring the light spot image and further calculating and generating a depth face image of the target face according to the deformation or displacement of the light spot pattern.
In the embodiment of the invention, the 3D face recognition module acquires the depth face image by adopting a structured light method, and the first computing unit is arranged in front, so that the first computing unit can quickly acquire the light spot pattern, the quick computation of the depth image is realized, and the 3D face recognition module is also convenient for the quick matching connection with other terminal equipment.
In the embodiment of the present invention, a second proximity sensor may be further disposed in the 3D face recognition module, and when the second proximity sensor detects that the face is too close to the 3D face recognition module, for example, the face is less than 15 cm, the laser speckle projector is controlled to be turned off.
In the embodiment or the modification of the invention, the 3D face recognition module further comprises an RGB camera module and an LED floodlight source;
the RGB camera module is used for collecting RGB face images of the target face;
the LED floodlight source is used for projecting a floodlight beam to the target face;
and the infrared detector is used for collecting an infrared face image formed by the floodlight beams reflected by the target face.
The first computing unit is configured to identify whether the infrared face image or the RGB face image is a preset white list face. Specifically, the recognition can be performed by a pre-trained face recognition model. The white list face is a preset permitted face.
In the embodiment of the invention, the quality of the infrared image is improved by projecting the floodlight beam to the target face and then acquiring the infrared image through the infrared detector. The 3D face recognition module can also be with RGB camera module group gathers RGB face preview image and sends to face recognition payment module carries out the try on preview of target face.
Fig. 3 is a schematic diagram of a 3D face recognition module according to a variation of the present invention, and as shown in fig. 3, the 3D face recognition module includes a second calculation unit, a light projector, and a TOF sensor; the light projector, the RGB camera module and the infrared camera module are electrically connected with the second computing unit;
the light projector is used for projecting infrared floodlight to the target face;
the TOF sensor is used for receiving infrared floodlight reflected by a target face and generating a plurality of infrared face images;
and the second calculating unit is used for calculating and generating the depth image of the surface of the target face according to the phase difference of a plurality of infrared face images in a preset acquisition period.
In the modification of the invention, the 3D face recognition module calculates the depth image of the target face surface by using a time-of-flight method so as to be suitable for the acquisition of the depth image at a longer distance.
In an embodiment of the present invention, the first computing unit and the second computing unit employ an i.mx8m mini processor.
Fig. 4 is a schematic view of a working state of a payment system with 3D face recognition in an embodiment of the present invention, and as shown in fig. 4, the payment system with 3D face recognition further includes a first proximity sensor, where the first proximity sensor is electrically connected to the face recognition payment module;
the first proximity sensor is used for detecting the distance of the target human face;
and the face recognition payment module is used for acquiring the distance of the target face and sending the trigger signal when judging that the distance is smaller than a preset distance threshold.
And the 3D face recognition module and the face recognition payment module carry out encrypted transmission of the face image and the living body recognition result through a connecting port.
The 3D face recognition module is also provided with a safety encryption chip;
the safety encryption chip is used for encrypting the face image and the living body identification result;
and the 3D face recognition module and the face recognition payment module carry out encrypted transmission of the face image and the living body recognition result through a connecting port.
In the embodiment of the present invention, the preset distance threshold may be any value between 0.2 meters and 1 meter, and is preferably 0.5 meters in the embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a connection port according to an embodiment of the present invention, and as shown in fig. 5, the connection port includes a USB port;
the USB port is connected with a first computing unit or a second computing unit in the 3D face recognition module on one hand, and is connected with the face recognition payment module on the other hand.
In the modification of the invention, the display of the face image and the recognition result can be directly performed by connecting the 3D face recognition module to the screen; the USB port emulates a UVC device and a serial port device.
Fig. 6 is a flowchart of steps in performing living body face recognition according to an embodiment of the present invention, and as shown in fig. 6, the living body face recognition is performed through a preset living body detection model, and the training of the living body detection model includes the following steps:
step M1: collecting a plurality of face images, and performing key point detection on each face image to determine a plurality of face key points;
step M2: normalizing the face image to a preset size according to the face key points, and acquiring the position of each face key point;
in the embodiment of the invention, during normalization processing, a conversion matrix of the key points of the human face is calculated according to preset standard key point distribution, and the key point positions in the normalized human face image are determined according to the conversion matrix.
Step M3: selecting a plurality of face key points in each face image, and taking the selected face key points as centers to intercept the face key points to a plurality of ROI (region of interest), wherein the ROI comprises any area of a left eye area, a right eye area, a nose tip area and a mouth area in the face image;
step M4: and synthesizing the ROI corresponding to each face image into training data, and training according to the training data to generate the living body detection model.
In the embodiment of the present invention, the ROI includes a left eye region, a right eye region, a nose tip region, and a mouth region in the face image, that is, four ROI regions are synthesized into training data of a four-channel. Each of the ROI regions has a size of 48 × 48 in units of pixels. The number of the face key points is 106. The preset size is 180 × 220, and the unit is a pixel.
In the embodiment of the invention, the living body detection model comprises a first living body detection model generated based on RGB (red, green and blue) face image training, a second living body detection model generated based on infrared face image training and a third living body detection model generated based on depth face image training;
when the living body face recognition is carried out, the living body face recognition is carried out through any one model or any multiple models of the first living body detection model, the second living body detection model and the third living body detection model;
when the living body recognition is performed by the three living body detection models, the face image is determined as the living body face only when all of the three living body detection models are determined as the living body face.
In the embodiment of the invention, the living body face recognition is performed sequentially through the first living body detection model, the second living body detection model and the third living body detection model, and when a face image is determined by each model, the face image is determined to be a living body face. In the modification of the present invention, the living body recognition may be performed by either one of the living body models or both of the living body models.
Fig. 7 is a flowchart illustrating steps of a method for using a payment system with 3D face recognition according to an embodiment of the present invention, and as shown in fig. 7, the method for using a payment system with 3D face recognition according to the present invention includes the following steps:
step S1: detecting the distance of the target face, and triggering the step S2 when the distance is smaller than a preset distance threshold;
step S2: collecting a face image of the target face, wherein the face image comprises any one or more of an RGB face image, an infrared face image, a depth face image and a 3D face image;
step S3: and carrying out face recognition and living body recognition on the face image, controlling a door lock to unlock when the face image is judged to be a living body face and the face image is a preset white list face, and otherwise carrying out error prompt.
Fig. 8 is a specific usage flowchart of the payment system with 3D face recognition in the embodiment of the present invention, as shown in fig. 8, when the payment system with 3D face recognition provided by the present invention is used, a trigger signal may be input, the trigger signal may be output by a cash register system or may be output by a preset trigger button, when the trigger signal is received, the 3D face recognition module controls the RGB camera module and the infrared camera module to capture an RGB face image and an infrared face image of a target face, performs face detection and key point detection on the RGB face image and the infrared face image, determines a face area and key points on the RGB face image and the infrared face image, and generates a depth face image according to the infrared face image or a light spot pattern acquired by an infrared detector, and sequentially carrying out living body treatment on the RGB face image, the depth face image and the infrared face image and then outputting a recognition result. And outputting an identification result verified as a living body during living body identification, and sending the face image and the identification result to the face identification payment module, otherwise, outputting an identification result with an identification error. And the face recognition payment module is used for judging whether the face image is a registered face or not, and executing deduction operation on a payment account corresponding to the registered face when the face image is the registered face. Besides the living body capturing process, the 3D face recognition module continuously collects the RGB face image or the RGB image of any object so as to facilitate previewing.
In the embodiment of the invention, a face image is collected through a 3D face recognition module, living body recognition and face recognition are carried out on the face image to judge whether the collected target face is a living body image or not and whether the collected target face is a preset registered face or not, and when the living body recognition result is a living body and the face image is the registered face, a deduction operation is carried out on a payment account corresponding to the registered face, so that safe payment can be realized through the face recognition; the 3D face recognition module is controlled to collect the face images through the trigger signals, so that the problems that the 3D face recognition module collects the face images and repeatedly calculates depth face images at all times, calculation resources are wasted, and power consumption of equipment is increased are avoided.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes and modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention.