CN114387674A - Living body detection method, living body detection system, living body detection apparatus, storage medium, and program product - Google Patents

Living body detection method, living body detection system, living body detection apparatus, storage medium, and program product Download PDF

Info

Publication number
CN114387674A
CN114387674A CN202111679763.XA CN202111679763A CN114387674A CN 114387674 A CN114387674 A CN 114387674A CN 202111679763 A CN202111679763 A CN 202111679763A CN 114387674 A CN114387674 A CN 114387674A
Authority
CN
China
Prior art keywords
white balance
video
target
balance sequence
sequence information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111679763.XA
Other languages
Chinese (zh)
Inventor
张文军
牛逢泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kuangshi Technology Co Ltd
Beijing Megvii Technology Co Ltd
Original Assignee
Beijing Kuangshi Technology Co Ltd
Beijing Megvii Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kuangshi Technology Co Ltd, Beijing Megvii Technology Co Ltd filed Critical Beijing Kuangshi Technology Co Ltd
Priority to CN202111679763.XA priority Critical patent/CN114387674A/en
Publication of CN114387674A publication Critical patent/CN114387674A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Color Television Image Signal Generators (AREA)

Abstract

A method, system, device, storage medium, and program product for living body detection are provided. The method comprises the following steps: acquiring a video of a target object; analyzing the video to obtain the actually used recording white balance sequence information in the recording process of the video; matching the recorded white balance sequence information with target white balance sequence information, wherein the target white balance sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process; and checking whether the target object is a living body according to the matching result of the recorded white balance sequence information and the target white balance sequence information. The living body detection method can detect whether the video sent by the terminal equipment is the attack video shot by the camera device after being hijacked, and has the advantages of wide application range (for example, covering various use scenes of the user and various equipment of the user), high detection efficiency (the user does not need to spend a long time), and the like.

Description

Living body detection method, living body detection system, living body detection apparatus, storage medium, and program product
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, a system, a device, a storage medium, and a program product for detecting a living body.
Background
The living body detection technology is a defense means for detecting whether a human face is a real person or not, prevents other people from using screen reproduction, printing paper reproduction, masks and other forged figures, and has important application in the fields of consumer finance, entertainment games and the like. In recent years, the deception means of the black products is more and more obvious, and videos or pictures which are shot in advance can be directly uploaded by means of hijacking a camera and the like, so that the living body detection model is deceived. The attack means cannot be defended by simply adopting a living body detection model. At present, action living bodies, lip language living bodies and colorful living bodies can well defend against the attack, but the action living bodies, the lip language living bodies and the colorful living bodies still have a plurality of problems, for example, the action living bodies and the lip language living bodies take a long time to interact with users, and the detection efficiency is low. The dazzling living body has high requirements on the light brightness of the environment, the screen brightness of a mobile phone, the screen brightness of the mobile phone and the like, and the application range is narrow.
Disclosure of Invention
Provided are a living body detection method, system, device, storage medium, and program product, which can realize living body detection of a target object. The specific technical scheme is as follows:
in a first aspect of embodiments of the present application, there is provided, first, a method for in vivo detection, the method including:
acquiring a video of a target object;
analyzing the video to obtain the actually used recording white balance sequence information in the recording process of the video;
matching the recorded white balance sequence information with target white balance sequence information, wherein the target white balance sequence information is used for indicating that the white balance parameters of a camera device are adjusted in the video recording process;
and checking whether the target object is a living body according to the matching result of the recorded white balance sequence information and the target white balance sequence information.
In a second aspect of the embodiments of the present application, there is provided a method for detecting a living body, applied to a terminal device, the method including:
acquiring target white balance sequence information from a server in response to a liveness detection request for liveness detection of a target object; the target white balance parameter sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process;
controlling the camera device to record the video of the target object according to the indication of the target white balance sequence information;
and sending the recorded video of the target object to the server, analyzing the video by the server to obtain recorded white balance sequence information actually used in the recording process of the video, matching the recorded white balance sequence information with the target white balance sequence information, and determining whether the target object is a living body according to a matching result.
In a third aspect of the embodiments of the present application, there is further provided a living body detection system, where the system includes a terminal device and a server;
the terminal equipment is used for responding to a living body detection request for carrying out living body detection on a target object, acquiring target white balance sequence information from a server, controlling a camera device to record a video of the target object according to the indication of the target white balance sequence information, and sending the recorded video of the target object to the server; the target white balance parameter sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process;
the server is used for receiving the video of the target object, analyzing the video to obtain recording white balance sequence information actually used in the recording process of the video, matching the recording white balance sequence information with the target white balance sequence information, and checking whether the target object is a living body according to the matching result of the recording white balance sequence information and the target white balance sequence information.
In a fourth aspect of embodiments of the present application, there is also provided a living body detection apparatus, the apparatus including:
the first acquisition module is used for acquiring a video of a target object;
the analysis module is used for analyzing the video to obtain the recording white balance sequence information actually used in the recording process of the video;
the matching module is used for matching the recorded white balance sequence information with target white balance sequence information, and the target white balance sequence information is used for indicating that the white balance parameters of a camera device are adjusted in the video recording process;
and the checking module is used for checking whether the target object is a living body according to the matching result of the recorded white balance sequence information and the target white balance sequence information.
In a fifth aspect of the embodiments of the present application, there is provided another living body detecting apparatus applied to a terminal device, the apparatus including:
a third acquisition module, configured to acquire target white balance sequence information from the server in response to a live body detection request for live body detection of the target object; the target white balance parameter sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process;
the first control module is used for controlling the camera device to record a video of a target object according to the indication of the target white balance sequence information;
and the second sending module is used for sending the recorded video of the target object to the server, analyzing the video by the server to obtain recording white balance sequence information actually used in the recording process of the video, matching the recording white balance sequence information with the target white balance sequence information, and determining whether the target object is a living body according to a matching result.
In a sixth aspect of the embodiments of the present application, there is further provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor, configured to implement the steps of the living body detecting method according to the first aspect or the second aspect of the embodiments of the present application when executing the program stored in the memory.
In a seventh aspect of embodiments of the present application, there is further provided a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the steps in the liveness detection method of the first aspect or the second aspect of embodiments of the present application.
In an eighth aspect of embodiments of the present application, there is further provided a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps in the liveness detection method of the first or second aspect of embodiments of the present application.
By adopting the in-vivo detection method, the video of the target object is firstly acquired, and then the video is analyzed, so that the recording white balance sequence information actually used in the recording process of the video is obtained. And then, matching the recorded white balance sequence information with target white balance sequence information, wherein the target white balance sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process. And finally, checking whether the target object is a living body according to the matching result of the recorded white balance sequence information and the target white balance sequence information. The biological detection method of the present application has a plurality of effects as follows:
firstly, whether the video of the target object is an attack video shot by the camera device after being hijacked can be detected.
The living body detection method has a wider application range, on one hand, the method does not have requirements on the intensity of light (white balance is irrelevant to the intensity of light), can still take effect in an environment with stronger light, and can cover various use scenes of users; on the other hand, the device can cover various devices of users without requiring the light transmittance of a protective film (for example, a mobile phone film) of the device (the white balance is not related to the light transmittance of the film); on the other hand, the screen of the equipment is not required to be lightened (the white balance is irrelevant to the screen brightness), so that the dazzling of the user can be avoided, and the user experience is optimized.
The in-vivo detection method has high detection efficiency, the user does not need to spend long time for interaction, the use difficulty of the user is reduced, the situation that the individual user cannot complete detection due to too high difficulty is avoided, and the overall detection rate is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a schematic diagram of an implementation environment shown in an embodiment of the present application;
FIG. 2 is a flow chart illustrating a method of in vivo detection according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating another in vivo detection method in accordance with an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a complete flow chart of a method for detecting a living organism according to an embodiment of the present application;
FIG. 5 is a block diagram of an example of a living body detecting apparatus according to the present application;
FIG. 6 is a block diagram illustrating another biopsy device according to an exemplary embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In recent years, technical research based on artificial intelligence, such as computer vision, deep learning, machine learning, image processing, and image recognition, has been actively developed. Artificial Intelligence (AI) is an emerging scientific technology for studying and developing theories, methods, techniques and application systems for simulating and extending human Intelligence. The artificial intelligence subject is a comprehensive subject and relates to various technical categories such as chips, big data, cloud computing, internet of things, distributed storage, deep learning, machine learning and neural networks. Computer vision is used as an important branch of artificial intelligence, particularly a machine is used for identifying the world, and the computer vision technology generally comprises the technologies of face identification, living body detection, fingerprint identification and anti-counterfeiting verification, biological feature identification, face detection, pedestrian detection, target detection, pedestrian identification, image processing, image identification, image semantic understanding, image retrieval, character identification, video processing, video content identification, behavior identification, three-dimensional reconstruction, virtual reality, augmented reality, synchronous positioning and map construction (SLAM), computational photography, robot navigation and positioning and the like. With the research and progress of artificial intelligence technology, the technology is applied to various fields, such as security, city management, traffic management, building management, park management, face passage, face attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile phone images, cloud services, smart homes, wearable equipment, unmanned driving, automatic driving, smart medical treatment, face payment, face unlocking, fingerprint unlocking, testimony verification, smart screens, smart televisions, cameras, mobile internet, live webcasts, beauty treatment, medical beauty treatment, intelligent temperature measurement and the like.
In the related art, the action live test and lip language live test require a user to make some action according to a prompt or speak a random number on a screen, which is often impossible to realize by a photo. However, such detection interaction is too long, and the completion difficulty is too large for some users, so that the overall detection rate is low.
In the dazzling living body detection, a screen of a user terminal can emit light of various colors according to a random sequence issued by a server, and the server can compare whether a light sequence in a recorded video is consistent with a light sequence issued by a server when a living body is verified, so that whether the video is shot really instead of being injected by hijacking is judged. However, the dazzle color biopsy has many defects, such as: (1) the requirement of screen polishing on the environment is very high, and the screen polishing agent is effective only in a dark environment; (2) the requirements on the mobile phone screen film are high, and the effect on the mobile phone film with poor light transmission is poor; (3) in order to polish the mobile phone screen as much as possible, the mobile phone screen needs to be brightened, the distance between the face and the mobile phone screen is shortened, and dazzling is caused.
In order to solve the above problems, the present application provides a white balance biopsy method, which will be described in detail below.
Fig. 1 is a schematic diagram of an implementation environment according to an embodiment of the present application. In fig. 1, the terminal device is internally installed with an SDK (Software Development Kit), and the terminal device can interact with the server through the SDK. The terminal device may be a smart phone, a tablet, a computer, or other portable smart devices, the server may be one server or a cluster of multiple servers, and the present embodiment does not specifically limit the types of the terminal device and the server.
The present application first provides a method for detecting a living body, which can be applied to the server in fig. 1 and also can be applied to the terminal device in fig. 1. Fig. 2 is a flow chart illustrating a method of in vivo detection according to an embodiment of the present application. Referring to fig. 2, the in-vivo detection method of the present application may specifically include the steps of:
step S21: a video of a target object is acquired.
In the present embodiment, the target object may be a human object or may be another living object (e.g., an animal object) other than a human object.
The video may be a video containing a specified region of the target object (a region for performing living body detection). Taking the target object as a human object as an example, the video may be a video including a face region, a video including an upper body region, or a video including a hand region, and the region is not particularly limited in this embodiment.
When the living body detection method is applied to the server, the server may acquire a video of the target object through another external imaging device connected to the server, or may receive a video of the target object acquired by the terminal device. When the living body detection method is applied to the terminal device, the terminal device can acquire the video of the target object through the built-in camera device of the terminal device, and can also acquire the video of the target object through other external camera devices connected with the terminal device.
Step S22: and analyzing the video to obtain the actually used recording white balance sequence information in the recording process of the video.
In this embodiment, the camera device generally uses a white balance sequence when recording a video. A white balance sequence includes a plurality of white balance parameters, each of which is usable to set the white balance of the image pickup apparatus.
In step S22, the video is parsed to obtain the sequence information of the white balance sequence actually used in the recording process of the video.
Step S23: and matching the recorded white balance sequence information with target white balance sequence information, wherein the target white balance sequence information is used for indicating that the white balance parameters of a camera device are adjusted in the video recording process.
In the present embodiment, the target white balance sequence information is sequence information of a white balance sequence for forgery prevention authentication specified in advance. The role of the target white balance sequence is: and when the camera device records the video, the camera device is instructed to adjust the white balance parameters.
After the sequence information of the white balance sequence actually used in the video recording process is obtained, the sequence information of the white balance sequence actually used (recorded white balance sequence information) is matched with the sequence information of the white balance sequence which is specified in advance and used for anti-counterfeiting authentication (target white balance sequence information), and a matching result is obtained.
Step S4: and checking whether the target object is a living body according to the matching result of the recorded white balance sequence information and the target white balance sequence information.
In this embodiment, according to the matching result, if the matching degree between the recorded white balance sequence information and the target white balance sequence information is greater than the preset threshold, it may be determined that the target object is a living body, or it may be determined that the target object is a living body and the video is legal, and is not shot after the imaging apparatus is hijacked illegally. If the matching degree of the recorded white balance sequence information and the target white balance sequence information is not larger than the preset threshold value, the failure of the living body detection of the target object can be determined, and at the moment, the user can be prompted to shoot the video again.
In one embodiment, the execution device executing the liveness detection method may install application software (hereinafter referred to as application a) for anti-counterfeiting verification, and the application software may perform legal verification on live videos of a plurality of application software (hereinafter referred to as application B) that need to be subjected to security protection. When a user needs to log in an application B, the application B obtains target white balance sequence information from the application A, white balance setting is carried out on a camera device according to the target white balance sequence information, then a video of the user is collected, the collected video is sent to the application A, the application A analyzes the video to obtain recording white balance sequence information used actually in the recording process of the video, the recording white balance sequence information is matched with the target white balance sequence information sent to the application B in advance, and if the matching degree of the recording white balance sequence information and the target white balance sequence information is larger than a preset threshold value, the fact that the video contains a living body and the video is legal can be determined. If the camera device is hijacked illegally, the target white balance sequence which is not sent in advance by the application A is used when the video is actually recorded, and the matching degree of the finally obtained recorded white balance sequence information and the target white balance sequence information is not more than a preset threshold value.
In one embodiment, the target white balance sequence may be only one white balance sequence for anti-counterfeit authentication, which is pre-specified by a user. When a user uses certain application software, if the application software needs to perform living body verification on the user, the application software can randomly generate a white balance sequence and then send the white balance sequence to the camera device, and the camera device performs white balance setting according to the received white balance sequence information. The camera device sends the collected video to the application software, the application software analyzes the video to obtain the actually used recording white balance sequence information in the recording process of the video, and if the actually used recording white balance sequence information is different from a pre-specified only one white balance sequence used for anti-counterfeiting authentication, the video can be determined to be illegal. In other words, even if the actually used recording white balance sequence information coincides with the white balance sequence information received by the image pickup device, it can be determined that it is illegal if the recording white balance sequence information does not coincide with the target white balance sequence information. For example, when using some application software, a parent may specify a white balance sequence for anti-counterfeit authentication in advance, so that the child does not know the white balance sequence for anti-counterfeit authentication, and even if the image pickup apparatus is not hijacked illegally, the child cannot use the application software through normal operations, for example, the child cannot log in the application software or pay.
According to the living body detection method, the video of the target object is firstly obtained, then the video is analyzed, and the recording white balance sequence information actually used in the recording process of the video is obtained. And then, matching the recorded white balance sequence information with target white balance sequence information, wherein the target white balance sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process. And finally, checking whether the target object is a living body according to the matching result of the recorded white balance sequence information and the target white balance sequence information. The biological detection method of the present application has a plurality of effects as follows:
firstly, whether the video of the target object is an attack video shot by the camera device after being hijacked can be detected.
The living body detection method has a wider application range, on one hand, the method does not have requirements on the intensity of light (white balance is irrelevant to the intensity of light), can still take effect in an environment with stronger light, and can cover various use scenes of users; on the other hand, the device can cover various devices of users without requiring the light transmittance of a protective film (for example, a mobile phone film) of the device (the white balance is not related to the light transmittance of the film); on the other hand, the screen of the equipment is not required to be lightened (the white balance is irrelevant to the screen brightness), so that the dazzling of the user can be avoided, and the user experience is optimized.
The in-vivo detection method has high detection efficiency, the user does not need to spend long time for interaction, the use difficulty of the user is reduced, the situation that the individual user cannot complete detection due to too high difficulty is avoided, and the overall detection rate is improved.
In combination with the above embodiments, in one implementation manner, the living body detection method of the present application may further include the following steps:
acquiring white balance parameter information supported by a camera device; the white balance parameter information comprises color temperature information corresponding to the white balance parameters; generating at least one white balance sequence to be selected for the camera device according to the color temperature information of the white balance parameter supported by the camera device; and adjusting white balance parameters when the to-be-selected white balance sequence is used for the camera device to record the video of the target object.
In the present embodiment, the execution apparatus may acquire a system (arbitrary type of system) version of the apparatus to which the image pickup device belongs, and acquire white balance parameter information supported by the image pickup device according to the system version.
For example, taking the system of the device to which the image capturing apparatus belongs as an example of an android system, if the system version is less than 5.0 (the user does not support the specific value of the white balance parameter to be actively specified), the white balance parameter information supported by the image capturing apparatus is: a white balance list (including a plurality of white balance parameters) supported by the imaging device, and color temperature information corresponding to each white balance parameter in the white balance list. If the system version is not less than 5.0 (the user is supported to actively specify the specific numerical value of the white balance parameter), the white balance parameter information supported by the camera device is as follows: a white balance parameter range supported by the camera device and a color temperature range corresponding to the white balance parameter range. Wherein each white balance parameter corresponds to a unique color temperature value.
Of course, in practical implementation, the white balance parameter information supported by the image capturing apparatus may also be obtained by other manners, which is not limited in this embodiment.
The execution equipment generates at least one white balance sequence to be selected for the camera after obtaining the white balance parameter information supported by the camera. The white balance sequence to be selected has the following functions: and when the camera device records the video of the target object, instructing the camera device to adjust the white balance parameters.
When the white balance sequence to be selected is generated, for each white balance sequence to be selected, the difference value between the color temperatures corresponding to the two adjacent white balance parameters can be larger than the target threshold value, so that the situation that whether the white balance parameters are used in the video cannot be identified when the color temperature difference is small is avoided, and the accuracy of the identification result can be improved.
In this embodiment, the white balance parameter information supported by the camera device can be obtained through the system version of the device to which the camera device belongs, so as to obtain a white balance sequence to be selected for guiding the camera device to perform white balance parameter adjustment when recording a video, thereby ensuring smooth implementation of the in-vivo detection method.
With reference to the above embodiments, in one implementation, when the living body detection method of the present application is applied to a server, before acquiring a video of a target object, the method may further include:
and sending the at least one white balance sequence to be selected to terminal equipment, and adjusting white balance parameters according to the at least one white balance sequence to be selected by a camera of the terminal equipment when the video is recorded.
Accordingly, obtaining a video of a target object comprises:
and receiving the video of the target object sent by the terminal equipment.
In this embodiment, after generating at least one white balance sequence to be selected, the server may send the at least one white balance sequence to be selected to the terminal device. And the terminal equipment determines a white balance sequence to be selected from the received at least one white balance sequence to be selected, and adjusts white balance parameters of the camera device by using the determined white balance sequence to be selected in the process of recording the video of the target object by the camera device of the terminal equipment.
In this embodiment, after parsing the video of the target object sent by the terminal device, if it is found that the video does not use any white balance sequence, it indicates that the terminal device does not use the white balance sequence given by the server to capture the video of the target object according to the requirements in advance of the server. At this time, the server may directly send a notification message to the terminal device to remind the terminal device to reacquire the video of the target object using the white balance sequence given by the server.
In practical implementation, even if the terminal device uses the white balance sequence when recording the video, it does not necessarily mean that the terminal device uses the white balance sequence predetermined by the server when recording the video, and thus the recorded video may not be legal. Therefore, after receiving the video of the target object sent by the terminal device, the server needs to detect whether the recorded white balance sequence actually used by the terminal device is the white balance sequence in the at least one to-be-selected white balance sequence sent to the server in advance, and only when the recorded white balance sequence actually used is the white balance sequence in the at least one to-be-selected white balance sequence sent to the server in advance, it can be determined that the recorded video is legal or that the target object is a living body.
In this embodiment, the server and the terminal device may interact with each other through a pre-negotiated key, so as to ensure communication security.
In this embodiment, if the server sends a white balance sequence to be selected to the terminal device, the terminal device determines the white balance sequence to be selected as the white balance sequence to be used, and then performs white balance adjustment on the image capturing device by using each white balance parameter in the white balance sequence to be selected in the process of recording the video of the target object by the image capturing device. And when the server carries out subsequent comparison, matching the information of the recorded white balance sequence actually used in the received video with the information of the white balance sequence to be selected (target white balance sequence) which is sent in advance.
In this embodiment, if the server sends the plurality of white balance sequences to be selected to the terminal device, the terminal device determines any one of the plurality of white balance sequences to be selected as a white balance sequence to be used, and then performs white balance adjustment on the image capturing device by using the determined white balance sequence to be used in the process of recording the video of the target object by the image capturing device. And when the server carries out subsequent comparison, the information of the recorded white balance sequences actually used in the received video is sequentially matched with the information of a plurality of white balance sequences to be selected and sent in advance, and if one matching is successful, the video contains living bodies and is legal.
Illustratively, when the user A transfers money from a bank card through a network, a background server of the bank prompts the user to carry out face video authentication. The user terminal obtains a plurality of white balance sequences to be selected and sent by the background server, determines a white balance sequence to be used from the plurality of white balance sequences to be selected and sent, and performs white balance adjustment on the camera device according to each white balance parameter in the determined white balance sequence to be used when the camera device is used for collecting the face video of the user A, so as to obtain the recorded face video. Then, the user terminal sends the face video to the server. The server analyzes the face video after receiving the face video, obtains the information of the recorded white balance sequence actually used by the face video, sequentially matches the information of the recorded white balance sequence with the information of a plurality of white balance sequences to be selected and sent in advance, if one matching is successful, the video is legal or not an attack video, and the user is allowed to continue subsequent operations.
In this embodiment, if the system of the terminal device is an android system, when the system version is less than 5.0 (the user does not actively specify a specific value of the white balance parameter), the terminal device sends information of the system API camera1, a white balance list (including a plurality of white balance parameters) supported by the current device, and color temperature values corresponding to each white balance parameter in the white balance list as white balance parameter information supported by the image capturing apparatus to the server.
When the system version is not less than 5.0 (supporting the user to actively specify a specific value of the white balance parameter), the terminal device transmits information of the system API camera2, a white balance parameter range currently supported by the device, and a color temperature range corresponding to the white balance parameter range to the server as white balance parameter information supported by the image pickup apparatus.
After receiving the white balance parameter information supported by the camera device, the server generates at least one white balance sequence to be selected according to the information, which may specifically refer to the foregoing description. In the embodiment, the terminal device can initiate the living body detection request to the server, and the server processes the living body detection request, so that the living body detection method can be applied to any scene where the server and the terminal device interact, and the application range of the living body detection method is expanded.
With reference to the foregoing embodiment, in an implementation manner, if the number of the white balance sequences to be selected, which are sent by the server to the terminal device, is multiple, before matching the recorded white balance sequence information with the target white balance sequence information, the living body detection method of the present application may further include:
and receiving a white balance sequence to be selected, which is sent by the terminal equipment and used when the terminal equipment records the video of the target object, and taking the white balance sequence as the target white balance sequence.
In this embodiment, the server sends the multiple white balance sequences to be selected to the terminal device, and the terminal device may select any one of the multiple white balance sequences to be selected as a white balance sequence that is actually required to be used. When the server performs subsequent comparison, if the information of the recorded white balance sequence actually used in the received video is sequentially matched with the information of the multiple white balance sequences to be selected and sent in advance, a large amount of time is spent, and the living body detection efficiency is low.
In fact, the white balance sequence actually needed to be used, which is determined by the terminal device, is the target white balance sequence. Therefore, if the determined white balance sequence which is actually needed to be used is sent to the server after the terminal device records the video, the server can directly take the received white balance sequence as a target white balance sequence, and then match the information of the target white balance sequence with the information of the recorded white balance sequence used in the video, so that the matching time is greatly shortened, and the living body detection efficiency is improved.
In this embodiment, the server may directly use the white balance sequence to be selected, which is sent by the terminal device when the terminal device records the video of the target object, as the target white balance sequence, so that the living body detection efficiency can be significantly improved.
With reference to the foregoing embodiment, in an implementation manner, analyzing the video to obtain recording white balance sequence information actually used in the recording process of the video may specifically include:
extracting a plurality of video frames from the video;
obtaining color temperature change information corresponding to the recorded white balance sequence according to the color value of the target pixel point on each video frame; the target pixel points are all pixel points of the video frame or the target pixel points are pixel points in a target area of the video frame; the target region is a region for performing a living body examination.
In this embodiment, the execution device first decomposes the video into a single frame. For each video frame, a color value (e.g., RGB value) of a target pixel is extracted, and then a corresponding color temperature value is calculated according to the color value. Therefore, a plurality of color temperature values can be obtained by calculating a plurality of video frames, and the plurality of color temperature values can be drawn into a color temperature change curve of the video according to the sequence (namely, the color temperature change information corresponding to the recorded white balance sequence).
On this basis, matching the color temperature change information corresponding to the recorded white balance sequence with the color temperature change information corresponding to the target white balance sequence may include:
and matching the color temperature change information corresponding to the recorded white balance sequence with the color temperature change information corresponding to the target white balance sequence. In this embodiment, one white balance parameter uniquely corresponds to one color temperature value, and therefore, a color temperature change curve corresponding to the target white balance sequence can be drawn according to each white balance parameter in the target white balance sequence.
And then, comparing the similarity of the color temperature change curve corresponding to the recorded white balance sequence with the color temperature change curve corresponding to the target white balance sequence, if the similarity is greater than a preset threshold, indicating that the recorded white balance sequence is matched with the target white balance sequence, and further indicating that the recorded white balance sequence information is matched with the target white balance sequence information.
The target pixel points may be all pixel points of the video frame, or pixel points in a target area of the video frame. The target region refers to a region for performing living body detection. In actual implementation, the target pixel point may be defined according to actual requirements, which is not specifically limited in this embodiment. In this embodiment, whether a video recorded by the terminal device is legal or not is detected according to the similarity between the color temperature change information corresponding to the recorded white balance sequence and the color temperature change information corresponding to the target white balance sequence, so that whether the video is actually shot or not can be quickly and accurately detected, and the video is not hijacked and injected. In combination with the above embodiments, in one implementation, the target region may be a face region or a palm region of the target object. On this basis, according to the color value of the target pixel point on each video frame, color temperature change information corresponding to the recorded white balance sequence is obtained, which specifically includes:
obtaining color temperature change information corresponding to the recorded white balance sequence according to color values of pixel points in the face area of the target object on each video frame; or
And obtaining color temperature change information corresponding to the recorded white balance sequence according to the color values of the pixel points in the palm region of the target object on each video frame.
In some application scenarios, when a user logs in some account, when the user needs to perform live detection on the user, the user (the user to which the account belongs) must be subjected to live detection, but not other people. For example, when making a payment, the user who performs the liveness check must be the user to whom the payment account belongs, and cannot be any other user. In such a scenario, it is necessary to detect whether the recorded white balance sequence information matches the target white balance sequence information, and whether the human object in the video is the user himself or herself. This requires that the video of the target object must contain identifying features of the target object, such as facial features, eye features, palm print features, etc.
Therefore, to realize the live body detection in this scene, the target region may be set as a face region or a palm region. Therefore, when the color temperature change information corresponding to the recorded white balance sequence is obtained according to the color value of the target pixel point on each video frame, the color temperature change information corresponding to the recorded white balance sequence can be obtained according to the color value of the pixel point in the face area of the target object on each video frame, and the color temperature change information corresponding to the recorded white balance sequence can also be obtained according to the color value of the pixel point in the palm area of the target object on each video frame.
Through the embodiment, the living body detection of the user can be realized in the living body detection scene with strict requirements on the identity of the user, and the application range of the living body detection method is expanded.
With the above embodiment, in an implementation manner, when the target pixel is a pixel in the target region of the video frame, the color value of the target pixel on each video frame may be obtained in the following manner:
performing keypoint detection on each of the plurality of video frames;
selecting a target area from each video frame in the plurality of video frames according to the detection result of the key point;
and extracting the color value of each pixel in the selected target area on each video frame in the plurality of video frames.
In this embodiment, the key points may be facial features, and the target region may be a facial region.
In specific implementation, only the color values of the pixels in the face region in the video frame may be extracted, and the color temperature values corresponding to the face region are calculated, so as to avoid the influence caused by the change of the background (for example, the change of the color temperature in the background is not caused by the white balance setting, or the change of the color temperature in the background cannot be recognized, and the detection accuracy is finally influenced).
In a specific implementation, any key point detection means and target area identification means may be adopted, which is not specifically limited in this embodiment.
In this embodiment, when extracting the color values of a plurality of pixels on every video frame, can only extract the color values of a plurality of pixel points in the target area (for example, the face area), thereby avoid the influence that causes when the background changes, promote the precision of testing result.
With reference to the above embodiments, in one implementation, before acquiring the video of the target object, the living body detection method of the present application may further include:
determining a white balance sequence to be selected from the at least one white balance sequence to be selected whenever a liveness detection request is received;
and taking the determined white balance sequence to be selected as a target white balance sequence used by the camera device for recording the video, wherein two determined white balance sequences to be selected in two adjacent times are different.
In this embodiment, the server may generate at least one white balance sequence to be selected in advance, and determine, each time a liveness detection request is received, one white balance sequence to be selected from among the at least one white balance sequence to be selected, the determined one white balance sequence to be selected being a white balance sequence to be used in response to the next liveness detection request.
In practical implementation, the determination of one white balance sequence to be selected from at least one white balance sequence to be selected is not determined arbitrarily, and it is required to satisfy that two white balance sequences to be selected determined twice are different, so as to prevent illegal molecules from forging the white balance sequences.
The execution device determines one white balance sequence to be selected from the at least one white balance sequence to be selected, namely the target white balance sequence.
Taking the example that the server processes the live body detection request sent by the terminal device, when receiving the live body detection request sent by the terminal device, the server may send the first white balance sequence to be selected to the terminal device, so that when the terminal device records a video by using the image pickup apparatus, the image pickup apparatus is set to perform white balance on the image pickup apparatus by using the white balance parameters in the first white balance sequence to be selected. When receiving a new living body detection request sent by the terminal equipment, the server can send a second white balance sequence to be selected for use of the camera device to the terminal equipment, so that when the terminal equipment records a video by using the camera device, the server uses white balance parameters in the second white balance sequence to be selected for use to perform white balance setting on the camera device. The first white balance sequence to be selected and the second white balance sequence to be selected are both white balance sequences to be selected generated in advance by the server. And the first to-be-selected white balance sequence is different from the second to-be-selected white balance sequence.
In this embodiment, the image capturing apparatus can only use one white balance sequence when recording a live video once, and if recording a live video fails, the recorded video and the used white balance sequence (the first white balance sequence to be selected) are discarded, and a new white balance sequence (the second white balance sequence to be selected) is used again, so as to prevent an attacker from hijacking the image capturing apparatus and recording a video using the historically transmitted white balance sequence. By the method, the server sends a new white balance sequence to be selected to the terminal equipment every time the server receives the living body detection request sent by the terminal equipment, the white balance sequence to be selected sent historically is subjected to invalidation treatment, and an attacker can be prevented from hijacking the camera device and recording videos by using the white balance sequence to be selected sent historically.
When the terminal equipment sends a living body detection request to the server, the server sends the determined target white balance sequence to the terminal equipment, so that the terminal equipment uses each white balance parameter in the target white balance sequence to set white balance parameters of the camera device in the process of recording the video of the target object. And when the subsequent server analyzes the video sent by the terminal equipment, the information of the recorded white balance sequence actually used in the video can be directly matched with the information of the target white balance sequence. By the method, the server does not need to compare the information of the recorded white balance sequence actually used in the video with the information of each pre-generated white balance sequence to be selected, so that the living body detection efficiency is improved, and the target white balance sequence is determined according to the white balance sequence sent by the terminal equipment, so that the terminal equipment can be prevented from sending a forged target white balance sequence, and the smooth implementation of the living body detection is guaranteed. In this embodiment, each time the execution device receives a live body detection request, it determines a white balance sequence to be selected from at least one pre-generated white balance sequence to be selected, where the white balance sequence to be selected is different from the white balance sequence to be selected determined in response to the live body detection request last time, so as to prevent an attacker from hijacking the camera device and recording a video using the white balance sequence to be selected sent in history, thereby ensuring effective implementation of the live body detection method.
Aiming at the scene that the server processes the living body detection request initiated by the terminal equipment, the application also provides a living body detection method which is applied to the terminal equipment in the figure 1, in particular to the SDK in the terminal equipment. FIG. 3 is a flow chart illustrating another in vivo detection method according to an embodiment of the present application. Referring to fig. 3, the living body detecting method of the present application may include the steps of:
step S31: acquiring target white balance sequence information from a server in response to a liveness detection request for liveness detection of a target object; the target white balance parameter sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process.
Step S32: and controlling the camera device to record the video of the target object according to the indication of the target white balance sequence information.
Step S33: and sending the recorded video of the target object to the server, analyzing the video by the server to obtain recorded white balance sequence information actually used in the recording process of the video, matching the recorded white balance sequence information with the target white balance sequence information, and determining whether the target object is a living body according to a matching result.
In the present embodiment, the living body detection request may be triggered by the user through the terminal device, or may be sent by the server to the terminal device.
After the living body detection request is triggered, the server sends target white balance sequence information to the terminal equipment, so that the terminal equipment performs white balance setting on the camera device according to each white balance parameter in the target white balance sequence in the process of recording the video of the target object.
In the case of the camera device, for example, when a user logs in a certain application program, the user needs to perform face verification, and the background server of the application actively sends a living body detection instruction to the terminal device where the user is located, and simultaneously sends a target white balance sequence to the terminal device. And in the process of recording the face video of the user, the terminal equipment performs white balance setting on the camera device by using each white balance parameter in the target white balance sequence.
After finishing recording the face video, the terminal equipment sends the recorded face video to the server, so that the server verifies whether the video is legal or not. The process of the server verifying the video can be specifically referred to as described above.
According to the living body detection method, the terminal equipment responds to a living body detection request for carrying out living body detection on the target object, and the target white balance sequence information is obtained from the server; the target white balance parameter sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process. Then, the terminal equipment controls the camera device to record the video of the target object according to the indication of the target white balance sequence information; and then sending the recorded video of the target object to a server. The server analyzes the video to obtain the recording white balance sequence information actually used in the recording process of the video, matches the recording white balance sequence information with the target white balance sequence information, and determines whether the target object is a living body according to the matching result.
Firstly, whether the video of the target object is an attack video shot by the camera device after being hijacked can be detected.
The living body detection method has a wider application range, on one hand, the method does not have requirements on the intensity of light (white balance is irrelevant to the intensity of light), can still take effect in an environment with stronger light, and can cover various use scenes of users; on the other hand, the device can cover various devices of users without requiring the light transmittance of a protective film (for example, a mobile phone film) of the device (the white balance is not related to the light transmittance of the film); on the other hand, the screen of the equipment is not required to be lightened (the white balance is irrelevant to the screen brightness), so that the dazzling of the user can be avoided, and the user experience is optimized.
The in-vivo detection method has high detection efficiency, the user does not need to spend long time for interaction, the use difficulty of the user is reduced, the situation that the individual user cannot complete detection due to too high difficulty is avoided, and the overall detection rate is improved.
With reference to the foregoing embodiment, in an implementation manner, the controlling the image capturing apparatus to perform video recording on the target object according to the indication of the target white balance sequence information may include:
in response to the living body detection request, sequentially extracting a white balance parameter from a target white balance sequence every target duration; and controlling the camera device to record a single-frame video or continuous multi-frame video according to the extracted white balance parameter.
In this embodiment, one white balance sequence includes a plurality of white balance parameters, and since the image pickup apparatus only supports setting one white balance parameter at the same time, in this embodiment, every target time length, the next unused white balance parameter is sequentially extracted from the target white balance sequence, and the white balance of the image pickup apparatus is set accordingly, and then recording of continuous multi-frame video is performed according to the newly set white balance parameter within the target time length.
Illustratively, the target white balance sequence sent by the server in advance is: s1, S2, S3, … …, and Sn, where the target duration is 2 seconds, the user terminal first sets the white balance of the camera device at time t0 according to S1, then collects the recorded video between t0- (t0+2S), then the terminal device sets the white balance of the camera device at time (t0+2S) according to S2, then collects the recorded video between time (t0+2S) - (t0+4S), and so on until the video of the preset duration is collected. In this embodiment, it is also possible to sequentially extract the next unused white balance parameter from the target white balance sequence every target time length, set the white balance of the image capturing apparatus accordingly, and record a single frame video according to the newly set white balance parameter.
Illustratively, the target white balance sequence sent by the server in advance is: s1, S2, S3, … … and Sn, wherein the target duration is 2 seconds, the user terminal firstly sets the white balance of the camera device at the time t0 according to S1, then collects a video frame at the time t0, and after the video frame is collected, the white balance of the camera device is restored to the state before the setting. Next, the user terminal sets the white balance of the image pickup device at time (t0+2S) in accordance with S2, then captures a video frame at time (t0+2S), and after the video frame is captured, restores the white balance of the image pickup device to the state before the setting. And repeating the steps until the video with the preset duration is collected.
In this embodiment, it is also possible to sequentially extract the next unused white balance parameter from the target white balance sequence every N video frames, set the image capturing device accordingly, and then record consecutive multi-frame videos according to the newly set white balance parameter.
Illustratively, the target white balance sequence sent by the server in advance is: s1, S2, S3, … … and Sn, the terminal equipment firstly sets the white balance of the camera device according to S1, then collects the 1 st to 5 th video frames, then after the 5 th frame video is collected, the terminal equipment sets the white balance of the camera device according to S2, then collects the 6 th to 10 th video frames, and so on until the video with the preset duration is collected.
In this embodiment, every time a white balance sequence is used, all the white balance parameters in the white balance sequence are not necessarily used up, and only a video with a preset duration is recorded. If all the white balance parameters in the white balance sequence are used up before the video is recorded for the preset time period, the white balance parameters in another new white balance sequence can be used, the white balance parameters can be not used any more, or the white balance parameters in the white balance sequence can be used again.
In this embodiment, a white balance parameter is sequentially extracted from the target white balance sequence every target duration, and the camera device is controlled to record a single-frame video or a continuous multi-frame video according to the extracted white balance parameter, so that the server can better identify the white balance parameter used in the recorded video (for example, a white balance parameter may not be accurately identified by the server only in a short time), thereby improving the accuracy of the living body detection of the server.
With reference to the above embodiment, in an implementation, during controlling the image capturing apparatus to perform video recording on the target object according to the indication of the target white balance sequence information, the living body detection method of the present application may further include the steps of:
detecting whether the quality parameter of each video frame recorded by the camera device meets a target quality parameter or not; when detecting that the quality parameter of one video frame recorded by the camera device does not accord with the target quality parameter, controlling the camera device to stop video recording and discarding the recorded video; and acquiring new target white balance sequence information from the server.
On the basis, the method for controlling the camera device to record a single-frame video or a continuous multi-frame video according to the extracted white balance parameter comprises the following steps:
and controlling the camera device to re-record the video of the target object according to the indication of the new target white balance sequence information.
In this embodiment, the terminal device may detect in real time whether the quality parameter of each frame of video recorded by the camera device meets the target quality parameter, and if so, the frame of video data may be retained, and as long as it is detected that the quality parameter of one video frame recorded by the camera device does not meet the target quality parameter, the terminal device may stop recording the video, discard the recorded video, and record the video again according to another target white balance sequence sent by the server.
The quality parameter may be measured by using a plurality of factors, such as the sharpness, the alignment between the face and the face frame, the brightness, and the like, and the selection and the evaluation of the quality parameter are not particularly limited in this embodiment.
In this embodiment, if a live video recording fails (for example, the quality parameter of a video frame is not qualified), the video recorded this time and the target white balance sequence used this time are discarded, and a new target white balance sequence is used again to perform white balance setting on the image capturing device, so that an attacker can be effectively prevented from hijacking the image capturing device and recording the video by using the historically sent white balance sequence.
With reference to the above embodiment, in an implementation manner, when the target white balance sequence information acquired from the server is multiple, the living body detection method of the present application may further include:
and sending the selected target white balance sequence to the server.
In this embodiment, if the server sends a plurality of target white balance sequences to the terminal device, it takes a long time for the server to compare the information of the recorded white balance sequences with the information of each white balance sequence sent in advance, and the detection efficiency is reduced. In order to improve the detection efficiency, the terminal device may select a certain white balance sequence from the plurality of white balance sequences sent by the server to record a video, and then may send the used white balance sequence to the server. In this way, after receiving the video sent by the terminal device and the selected one of the white balance sequences, the server may compare information of the recorded white balance sequence used in the video with information of one of the white balance sequences sent by the terminal device (the selected target white balance sequence), and if the information of the recorded white balance sequence matches the information of the selected target white balance sequence, determine that the video is legal.
The in-vivo detection method of the present application will be described in detail with reference to fig. 1 and 4 as a complete example. In this embodiment, the living body detection request of the terminal device is processed by the server. Fig. 4 is a schematic view of a complete flow chart of a method for detecting a living body according to an embodiment of the present application.
Step 1: after detecting the operation of face verification triggered by the user, the SDK of the terminal device obtains a plurality of white balance parameters or white balance parameter ranges supported by the camera device of the terminal device. And then sends a face verification request carrying these white balance parameters or white balance parameter ranges to the server.
If the system of the terminal device is an android system and the version is less than 5.0, the SDK selects API camera1, acquires a plurality of white balance parameters supported by the camera, and then sends a face verification request carrying information of API camera1, the plurality of white balance parameters, and color temperature values corresponding to the respective white balance parameters to the server (the face verification request may also be determined by the server itself without carrying the color temperature values corresponding to the respective white balance parameters).
If the system of the terminal device is an android system and the version is not less than 5.0, the SDK selects API camera2, and acquires a white balance parameter range supported by the camera, and then sends a face verification request carrying information of API camera2, the white balance parameter range, and a color temperature range corresponding to the white balance parameter range to the server (which may be determined by the server itself without carrying the color temperature range corresponding to the white balance parameter range).
The SDK may be sent after being encrypted when sending the face authentication request, and the secret key may be determined by negotiation between the SDK and the server in advance.
Step 2: and the server decrypts the received face verification request to obtain the current white balance information of the terminal equipment, different white balance parameters correspond to different color temperature values, and the server further selects the white balance parameters with larger color temperature value difference to generate at least one white balance sequence according to the color temperature difference. In each white balance sequence, the difference value between the color temperature values corresponding to the two adjacent white balance parameters is larger than the target threshold value.
Then, the server encrypts at least one white balance sequence and then issues the white balance sequence to the SDK.
And step 3: the SDK decrypts the received white balance sequence, then starts a face detection page, calls a front-facing camera device of the terminal equipment to detect the face quality (the face does not need to do action), and reminds a user to adjust the face if the detection fails, such as adjusting the direction, or places the face in a face frame.
And 4, step 4: and after the quality of the human face meets the standard, the SDK selects a white balance sequence to be used from at least one white balance sequence obtained by decryption, and uses one white balance parameter to carry out white balance setting on the camera device every N frames according to the sequence of each white balance parameter in the selected white balance sequence. For example, frames 1 to 5 are captured by the camera with white balance parameter 1, and frames 6 to 10 are captured by the camera with white balance parameter 2.
And 5: in step 4, the SDK continuously performs face quality detection on each video frame acquired by the camera device, and presses the video frame into the video after the detection is passed. And if the human face quality of a certain video frame is detected to be not in accordance with the standard, discarding the currently acquired video, selecting an unused white balance sequence from at least one decrypted white balance sequence again, and repeatedly executing the step 3 to the step 4 to finish video recording.
Step 6: after the white balance video recording is finished, the SDK encrypts and packages the recorded video and the selected white balance sequence, and uploads the video and the selected white balance sequence to the server.
And 7: and the server decrypts the data packet after receiving the data packet to obtain the recorded video and a white balance sequence selected when the video is recorded. The server then resolves the video into single frames, extracts the RGB values of the face region in each frame of image (when face quality detection is performed, a face frame is displayed on the screen to ensure that the image of the face region is extracted). And then, drawing a color temperature change curve according to the acquisition sequence for all the color temperature values. And finally, carrying out similarity comparison on the color temperature change curve corresponding to the video and the color temperature change curve corresponding to the white balance sequence (target white balance sequence) sent by the terminal equipment, wherein if the similarity is greater than a threshold value, the verification is successful, namely the video is legal and not an attack video.
And 8: and the server sends the verification result to the terminal equipment.
The biological detection method of the present application has a plurality of effects as follows:
firstly, whether the video of the target object is an attack video shot by the camera device after being hijacked can be detected.
The living body detection method has a wider application range, on one hand, the method does not have requirements on the intensity of light (white balance is irrelevant to the intensity of light), can still take effect in an environment with stronger light, and can cover various use scenes of users; on the other hand, the device can cover various devices of users without requiring the light transmittance of a protective film (for example, a mobile phone film) of the device (the white balance is not related to the light transmittance of the film); on the other hand, the screen of the equipment is not required to be lightened (the white balance is irrelevant to the screen brightness), so that the dazzling of the user can be avoided, and the user experience is optimized.
The in-vivo detection method has high detection efficiency, the user does not need to spend long time for interaction, the use difficulty of the user is reduced, the situation that the individual user cannot complete detection due to too high difficulty is avoided, and the overall detection rate is improved. It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
Based on the same inventive concept, an embodiment of the application provides a living body detection system, which comprises terminal equipment and a server;
the terminal equipment is used for responding to a living body detection request for carrying out living body detection on a target object, acquiring target white balance sequence information from a server, controlling a camera device to record a video of the target object according to the indication of the target white balance sequence, and sending the recorded video of the target object to the server; the target white balance parameter sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process;
the server is used for receiving the video of the target object, analyzing the video to obtain recording white balance sequence information actually used in the recording process of the video, matching the recording white balance sequence information with the target white balance sequence information, and checking whether the target object is a living body according to the matching result of the recording white balance sequence information and the target white balance sequence information.
Based on the same inventive concept, an embodiment of the present application provides a living body detection apparatus 500. Referring to fig. 5, fig. 5 is a block diagram illustrating a structure of a living body detecting apparatus according to an embodiment of the present application. As shown in fig. 5, the living body detecting apparatus 500 may include:
a first obtaining module 501, configured to obtain a video of a target object;
an analyzing module 502, configured to analyze the video to obtain recording white balance sequence information actually used in the recording process of the video;
a matching module 503, configured to match the recorded white balance sequence information with target white balance sequence information, where the target white balance sequence information is used to instruct to adjust a white balance parameter of a camera during the recording process of the video;
a checking module 504, configured to check whether the target object is a living body according to a matching result between the recorded white balance sequence information and the target white balance sequence information.
Optionally, the apparatus 500 further comprises:
the second acquisition module is used for acquiring white balance parameter information supported by the camera device; the white balance parameter information comprises color temperature information corresponding to the white balance parameters;
the generation module is used for generating at least one white balance sequence to be selected for the camera device according to the color temperature information of the white balance parameter supported by the camera device; and adjusting white balance parameters when the to-be-selected white balance sequence is used for the camera device to record the video of the target object.
Optionally, the apparatus is applied to a server; the apparatus 500 further comprises:
the first sending module is used for sending the at least one white balance sequence to be selected to the terminal equipment, and the camera device of the terminal equipment adjusts white balance parameters according to the at least one white balance sequence to be selected when recording the video;
the first obtaining module 501 includes:
and the receiving submodule is used for receiving the video of the target object sent by the terminal equipment.
Optionally, the number of the white balance sequences to be selected, which are sent to the terminal device by the server, is multiple; the apparatus 500 further comprises:
and the receiving module is used for receiving the white balance sequence to be selected, which is sent by the terminal equipment and used when the terminal equipment records the video of the target object, and taking the white balance sequence as the target white balance sequence.
Optionally, the apparatus 500 further comprises:
a first determining module, configured to determine, each time a liveness detection request is received, one white balance sequence to be selected from the at least one white balance sequence to be selected;
and the second determining module is used for taking the determined white balance sequences to be selected as target white balance sequences used by the camera device for recording the video, wherein two adjacent white balance sequences to be selected determined twice are different.
Optionally, the parsing module 502 includes:
the extraction sub-module is used for extracting a plurality of video frames from the video;
the first obtaining submodule is used for obtaining color temperature change information corresponding to the recorded white balance sequence according to the color value of a target pixel point on each video frame; the target pixel points are all pixel points of the video frame or the target pixel points are pixel points in a target area of the video frame; the target area is an area for performing living body detection;
the matching module 503 includes:
and the matching submodule is used for matching the color temperature change information corresponding to the recorded white balance sequence with the color temperature change information corresponding to the target white balance sequence.
Optionally, the first obtaining sub-module includes:
the second obtaining submodule is used for obtaining color temperature change information corresponding to the recorded white balance sequence according to color values of pixel points in the face area of the target object on each video frame; or
And the third obtaining submodule is used for obtaining color temperature change information corresponding to the recorded white balance sequence according to the color values of the pixel points in the palm region of the target object on each video frame.
Based on the same inventive concept, another living body detecting apparatus 600 is provided in an embodiment of the present application, and is applied to a terminal device. Referring to fig. 6, fig. 6 is a block diagram illustrating a structure of another biopsy device according to an embodiment of the present application. As shown in fig. 6, the living body detecting apparatus 600 may include:
a third obtaining module 601, configured to obtain target white balance sequence information from the server in response to a living body detection request for living body detection on the target object; the target white balance parameter sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process;
a first control module 602, configured to control the camera to perform video recording on a target object according to the indication of the target white balance sequence information;
a second sending module 603, configured to send the recorded video of the target object to the server, where the server analyzes the video to obtain recorded white balance sequence information actually used in the recording process of the video, matches the recorded white balance sequence information with the target white balance sequence information, and determines whether the target object is a living body according to a matching result.
Optionally, the first control module 602 includes:
the extraction submodule is used for responding to the living body detection request and sequentially extracting a white balance parameter from the target white balance sequence every target time length;
and the first control submodule is used for controlling the camera device to record a single-frame video or a continuous multi-frame video according to the extracted white balance parameter.
Optionally, the apparatus 600 further comprises:
the detection module is used for detecting whether the quality parameter of each video frame recorded by the camera device meets a target quality parameter;
the second control module is used for controlling the camera device to stop video recording and abandon recorded videos when detecting that the quality parameter of one video frame recorded by the camera device does not accord with the target quality parameter; and obtaining new target white balance sequence information from the server;
the first control sub-module includes:
and the second control submodule is used for controlling the camera device to re-record the video of the target object according to the indication of the new target white balance sequence information.
Optionally, when there are a plurality of pieces of target white balance sequence information acquired from the server, the apparatus 600 further includes:
and the third sending module is used for sending the selected target white balance sequence to the server.
An embodiment of the present application further provides an electronic device, as shown in fig. 7. Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 7, the electronic device includes a processor 71, a communication interface 72, a memory 73 and a communication bus 74, wherein the processor 71, the communication interface 72 and the memory 73 communicate with each other through the communication bus 74;
a memory 73 for storing a computer program;
the processor 71, when executing the program stored in the memory 73, implements the following steps:
acquiring a video of a target object;
analyzing the video to obtain the actually used recording white balance sequence information in the recording process of the video;
matching the recorded white balance sequence information with target white balance sequence information, wherein the target white balance sequence information is used for indicating that the white balance parameters of a camera device are adjusted in the video recording process;
and checking whether the target object is a living body according to the matching result of the recorded white balance sequence information and the target white balance sequence information.
Or the processor 71 may perform all of the steps of the other method embodiments described above when executing the program stored in the memory 73.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment provided by the present application, there is also provided a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to perform the liveness detection method as described in any of the above embodiments.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the liveness detection method of any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (15)

1. A method of in vivo detection, the method comprising:
acquiring a video of a target object;
analyzing the video to obtain the actually used recording white balance sequence information in the recording process of the video;
matching the recorded white balance sequence information with target white balance sequence information, wherein the target white balance sequence information is used for indicating that the white balance parameters of a camera device are adjusted in the video recording process;
and checking whether the target object is a living body according to the matching result of the recorded white balance sequence information and the target white balance sequence information.
2. The method of claim 1, further comprising:
acquiring white balance parameter information supported by a camera device; the white balance parameter information comprises color temperature information corresponding to the white balance parameters;
generating at least one white balance sequence to be selected for the camera device according to the color temperature information of the white balance parameter supported by the camera device; and adjusting white balance parameters when the to-be-selected white balance sequence is used for the camera device to record the video of the target object.
3. The method of claim 2, wherein the method is applied to a server; prior to the obtaining the video of the target object, the method further comprises:
sending the at least one white balance sequence to be selected to terminal equipment, and adjusting white balance parameters according to the at least one white balance sequence to be selected when a camera of the terminal equipment records the video;
acquiring a video of a target object, comprising:
and receiving the video of the target object sent by the terminal equipment.
4. The method according to claim 3, characterized in that the number of the white balance sequences to be selected sent by the server to the terminal device is multiple; before the matching the recorded white balance sequence information with the target white balance sequence information, the method further includes:
and receiving a white balance sequence to be selected, which is sent by the terminal equipment and used when the terminal equipment records the video of the target object, and taking the white balance sequence as the target white balance sequence.
5. The method of any of claims 2-4, wherein prior to said obtaining the video of the target object, the method further comprises:
determining a white balance sequence to be selected from the at least one white balance sequence to be selected whenever a liveness detection request is received;
and taking the determined white balance sequence to be selected as a target white balance sequence used by the camera device for recording the video, wherein two determined white balance sequences to be selected in two adjacent times are different.
6. The method according to any one of claims 1 to 5, wherein parsing the video to obtain recording white balance sequence information actually used in the recording process of the video comprises:
extracting a plurality of video frames from the video;
obtaining color temperature change information corresponding to the recorded white balance sequence according to the color value of the target pixel point on each video frame; the target pixel points are all pixel points of the video frame or the target pixel points are pixel points in a target area of the video frame; the target area is an area for performing living body detection;
matching the recorded white balance sequence information with target white balance sequence information, comprising:
and matching the color temperature change information corresponding to the recorded white balance sequence with the color temperature change information corresponding to the target white balance sequence.
7. The method of claim 6, wherein obtaining color temperature change information corresponding to the recorded white balance sequence according to the color value of the target pixel point on each video frame comprises:
obtaining color temperature change information corresponding to the recorded white balance sequence according to color values of pixel points in the face area of the target object on each video frame; or
And obtaining color temperature change information corresponding to the recorded white balance sequence according to the color values of the pixel points in the palm region of the target object on each video frame.
8. A method for detecting a living body is applied to a terminal device, and comprises the following steps:
acquiring target white balance sequence information from a server in response to a liveness detection request for liveness detection of a target object; the target white balance parameter sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process;
controlling the camera device to record the video of the target object according to the indication of the target white balance sequence information;
and sending the recorded video of the target object to the server, analyzing the video by the server to obtain recorded white balance sequence information actually used in the recording process of the video, matching the recorded white balance sequence information with the target white balance sequence information, and determining whether the target object is a living body according to a matching result.
9. The method according to claim 8, wherein the controlling the camera to record video of the target object according to the indication of the target white balance sequence information comprises:
in response to the living body detection request, sequentially extracting a white balance parameter from a target white balance sequence every target duration;
and controlling the camera device to record a single-frame video or continuous multi-frame video according to the extracted white balance parameter.
10. The method according to claim 8 or 9, wherein during controlling the image pickup apparatus to perform video recording of the target object in accordance with the instruction of the target white balance sequence information, the method further comprises:
detecting whether the quality parameter of each video frame recorded by the camera device meets a target quality parameter or not;
when detecting that the quality parameter of one video frame recorded by the camera device does not accord with the target quality parameter, controlling the camera device to stop video recording and discarding the recorded video; and obtaining new target white balance sequence information from the server;
controlling the camera device to record a single-frame video or a continuous multi-frame video according to the extracted white balance parameter, comprising:
and controlling the camera device to re-record the video of the target object according to the indication of the new target white balance sequence information.
11. The method according to any one of claims 8 to 10, wherein when there are a plurality of pieces of target white balance sequence information acquired from the server, the method further comprises:
and sending the selected target white balance sequence to the server.
12. A living body detection system is characterized by comprising terminal equipment and a server;
the terminal equipment is used for responding to a living body detection request for carrying out living body detection on a target object, acquiring target white balance sequence information from a server, controlling a camera device to record a video of the target object according to the indication of the target white balance sequence information, and sending the recorded video of the target object to the server; the target white balance parameter sequence information is used for indicating that the white balance parameters of the camera device are adjusted in the video recording process;
the server is used for receiving the video of the target object, analyzing the video to obtain recording white balance sequence information actually used in the recording process of the video, matching the recording white balance sequence information with the target white balance sequence information, and checking whether the target object is a living body according to the matching result of the recording white balance sequence information and the target white balance sequence information.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to implement the steps in the liveness detection method of any one of claims 1-7 or wherein the processor executes the computer program to implement the steps in the liveness detection method of any one of claims 8-11.
14. A computer readable storage medium having stored thereon a computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the steps in the liveness detection method of any one of claims 1-7, or the computer program/instructions, when executed by a processor, implement the steps in the liveness detection method of any one of claims 8-11.
15. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the steps in the liveness detection method of any one of claims 1 to 7, or the computer programs/instructions, when executed by a processor, implement the steps in the liveness detection method of any one of claims 8 to 11.
CN202111679763.XA 2021-12-31 2021-12-31 Living body detection method, living body detection system, living body detection apparatus, storage medium, and program product Pending CN114387674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111679763.XA CN114387674A (en) 2021-12-31 2021-12-31 Living body detection method, living body detection system, living body detection apparatus, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111679763.XA CN114387674A (en) 2021-12-31 2021-12-31 Living body detection method, living body detection system, living body detection apparatus, storage medium, and program product

Publications (1)

Publication Number Publication Date
CN114387674A true CN114387674A (en) 2022-04-22

Family

ID=81199918

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111679763.XA Pending CN114387674A (en) 2021-12-31 2021-12-31 Living body detection method, living body detection system, living body detection apparatus, storage medium, and program product

Country Status (1)

Country Link
CN (1) CN114387674A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174138A (en) * 2022-05-25 2022-10-11 北京旷视科技有限公司 Camera attack detection method, system, device, storage medium and program product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174138A (en) * 2022-05-25 2022-10-11 北京旷视科技有限公司 Camera attack detection method, system, device, storage medium and program product
CN115174138B (en) * 2022-05-25 2024-06-07 北京旷视科技有限公司 Camera attack detection method, system, device, storage medium and program product

Similar Documents

Publication Publication Date Title
US11288504B2 (en) Iris liveness detection for mobile devices
CN108197586B (en) Face recognition method and device
Chan et al. Face liveness detection using a flash against 2D spoofing attack
Galdi et al. Multimodal authentication on smartphones: Combining iris and sensor recognition for a double check of user identity
KR20190038594A (en) Face recognition-based authentication
KR101724971B1 (en) System for recognizing face using wide angle camera and method for recognizing face thereof
CN113642639B (en) Living body detection method, living body detection device, living body detection equipment and storage medium
CN112784741A (en) Pet identity recognition method and device and nonvolatile storage medium
CN114387548A (en) Video and liveness detection method, system, device, storage medium and program product
CN111079687A (en) Certificate camouflage identification method, device, equipment and storage medium
CN109636399A (en) A kind of super face identifying system and recognition methods
WO2020065954A1 (en) Authentication device, authentication method, and storage medium
CN108647650B (en) Human face in-vivo detection method and system based on corneal reflection and optical coding
CN114387674A (en) Living body detection method, living body detection system, living body detection apparatus, storage medium, and program product
CN112600886B (en) Privacy protection method, device and equipment with combination of end cloud and device
CN113850211A (en) Method and device for detecting injected video attack
Ma et al. Multi-perspective dynamic features for cross-database face presentation attack detection
JP2021131737A (en) Data registration device, biometric authentication device, and data registration program
WO2022222957A1 (en) Method and system for identifying target
Galdi et al. Combining hardwaremetry and biometry for human authentication via smartphones
CN113850214A (en) Injection attack identification method and device for living body detection
KR102151851B1 (en) Face recognition method based on infrared image and learning method for the same
CN111291586B (en) Living body detection method, living body detection device, electronic equipment and computer readable storage medium
CN102075329B (en) Method for identifying user images
CN110909704A (en) Living body detection method and device, electronic equipment and storage medium

Legal Events

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