CN113469036A - Living body detection method and apparatus, electronic device, and storage medium - Google Patents

Living body detection method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
CN113469036A
CN113469036A CN202110737711.7A CN202110737711A CN113469036A CN 113469036 A CN113469036 A CN 113469036A CN 202110737711 A CN202110737711 A CN 202110737711A CN 113469036 A CN113469036 A CN 113469036A
Authority
CN
China
Prior art keywords
image
detection
living body
body detection
target object
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.)
Withdrawn
Application number
CN202110737711.7A
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 Sensetime Technology Development Co Ltd
Original Assignee
Beijing Sensetime Technology Development 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 Sensetime Technology Development Co Ltd filed Critical Beijing Sensetime Technology Development Co Ltd
Priority to CN202110737711.7A priority Critical patent/CN113469036A/en
Publication of CN113469036A publication Critical patent/CN113469036A/en
Priority to PCT/CN2021/126438 priority patent/WO2023273050A1/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/64Three-dimensional objects
    • G06V20/647Three-dimensional objects by matching two-dimensional images to three-dimensional objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/40Spoof detection, e.g. liveness detection
    • G06V40/45Detection of the body part being alive

Abstract

The present disclosure relates to a method and apparatus for detecting a living body, an electronic device, and a storage medium. The method comprises the following steps: acquiring a depth map and a two-dimensional image of a target object; determining a target living body detection mode based on the depth image information contained in the depth map; and performing living body detection on the target object by the target living body detection mode based on the two-dimensional image to obtain a living body detection result of the target object.

Description

Living body detection method and apparatus, electronic device, and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method and an apparatus for detecting a living body, an electronic device, and a storage medium.
Background
The liveness detection can play a key role in the related application of face recognition, and can be used for preventing an attacker from using a prosthesis to forge the face. Therefore, how to improve the accuracy of the living body detection becomes a problem to be solved urgently in the field of computer vision.
Disclosure of Invention
The present disclosure provides a living body detection technical scheme.
According to an aspect of the present disclosure, there is provided a method of living body detection, including:
acquiring a depth map and a two-dimensional image of a target object; determining a target living body detection mode based on the depth image information contained in the depth map; and performing living body detection on the target object by the target living body detection mode based on the two-dimensional image to obtain a living body detection result of the target object.
In the embodiment of the disclosure, the two-dimensional image may include an infrared image and/or a color image, the target biopsy mode may include biopsy based on at least two images of a depth image, an infrared image, and a color image, and the depth image information may include size information and/or distance information of the depth image.
In one possible implementation manner, the determining a target living body detection manner based on depth image information included in the depth map includes: acquiring a target size of the target object in the depth map based on depth image information contained in the depth map; when the target size is smaller than a preset size threshold, the target living body detection mode comprises the following steps: a live body detection based on the two-dimensional image; or, when the target size is greater than or equal to a preset size threshold, the target living body detection mode includes: a liveness detection based on the depth map and the two-dimensional image.
In the embodiment of the disclosure, the two-dimensional image-based biopsy may include an infrared image-based biopsy and/or a color image-based biopsy, and the depth map-based biopsy and the two-dimensional image-based biopsy may include a depth map-based biopsy and an infrared image-based biopsy, a depth map-based biopsy and a color image-based biopsy, or a depth map-based biopsy, an infrared image-based biopsy and a color image-based biopsy.
In a possible implementation manner, the obtaining, based on depth image information included in the depth map, a target size of the target object in the depth map includes: performing target object detection on the two-dimensional image to obtain a first detection image of the target object in the two-dimensional image; determining a first image corresponding relation between the depth map and the two-dimensional image based on depth image information contained in the depth map; according to the first image corresponding relation, combining the first detection image to obtain a second detection image of the target object in the depth map; and determining the target size of the target object in the depth map according to the size of the second detection image.
In the embodiment of the disclosure, the first detection image may include an image of a position where the target object is located in the infrared image and/or an image of a position where the target object is located in the color image, the second detection image may include an image of a position where the target object is located in the depth map, and the target size may include a length size and/or a width size of the second detection image.
In a possible implementation manner, after the performing target object detection on the two-dimensional image to obtain a first detected image of the target object in the two-dimensional image, the method further includes: carrying out image quality detection on the first detection image to obtain an image quality detection result; and under the condition that the image quality detection result is larger than a preset quality threshold, determining a first image corresponding relation between the depth map and the two-dimensional image based on depth image information contained in the depth map.
In the embodiment of the disclosure, the image quality detection is used for screening the image quality entering the living body detection process subsequently, so that the image quality of the input image in the living body detection process is improved, and the living body detection precision is improved.
In one possible implementation manner, the determining a target living body detection manner based on depth image information included in the depth map includes: acquiring the living body detection distance of the target object based on the depth image information contained in the depth map; when the living body detection distance is greater than a preset distance threshold, the target living body detection method includes: a live body detection based on the two-dimensional image; when the living body detection distance is smaller than or equal to a preset distance threshold, the target living body detection mode comprises the following steps: a liveness detection based on the depth map and the two-dimensional image.
According to the embodiment of the disclosure, when the target object is far away from the living body detection device, the depth map is omitted and the two-dimensional image which is less affected by the distance is selected for living body detection, so that the accuracy of the living body detection is improved, the influence of the depth map on the living body detection distance is reduced, and the identification distance of the living body detection is improved.
In one possible implementation manner, the two-dimensional image includes an infrared image and/or a color image, and the target living body detection manner includes: liveness detection based on at least two images including at least two of the depth image, the infrared image, and the color image; the method for performing in-vivo detection on the target object by the target in-vivo detection mode based on the two-dimensional image to obtain the in-vivo detection result of the target object comprises the following steps: performing living body detection on the target object by the target living body detection mode based on the at least two images to obtain at least two intermediate living body detection results, wherein the at least two intermediate living body detection results respectively correspond to the at least two images; acquiring weights corresponding to the at least two intermediate living body detection results respectively; and obtaining the living body detection result of the target object based on the weight and the at least two intermediate living body detection results.
In the disclosed embodiment, the at least two image-based biopsy may include a depth map and infrared image-based biopsy, a depth map and color image-based biopsy, an infrared image and color image-based biopsy, and a depth map, infrared image and color image-based biopsy, and the at least two intermediate biopsy results may include at least two of a depth map biopsy result, an infrared image biopsy result, and a color image biopsy result, and according to the disclosed embodiment, the weight of the depth map live detection result can be reduced in a self-adaptive weighting mode under the condition that at least two intermediate live detection results are included, therefore, the influence of the in-vivo detection result corresponding to the depth map can be reduced under the condition of being attacked by the 3D prosthesis, and the accuracy of in-vivo detection is further improved.
In a possible implementation manner, the obtaining weights respectively corresponding to the at least two intermediate in-vivo detection results includes: determining weights corresponding to the at least two intermediate in-vivo detection results respectively based on training results of a weighting network layer in an in-vivo detection network, wherein the in-vivo detection network is used for performing in-vivo detection on the target object in the target in-vivo detection mode; or determining weights respectively corresponding to the at least two intermediate living body detection results according to the depth image information and/or two-dimensional image information contained in the two-dimensional image.
The weights respectively corresponding to the at least two intermediate in-vivo detection results may include the weights corresponding to the two intermediate in-vivo detection results when the two intermediate in-vivo detection results are included, or may include the weights corresponding to the three intermediate in-vivo detection results when the three intermediate in-vivo detection results are included; the weights determined according to the depth image and/or the two-dimensional image information contained in the two-dimensional image can comprise weights determined based on distances in the depth image, weights determined based on brightness or size of the two-dimensional image, and the like, and according to the embodiment of the disclosure, the weights of different intermediate living body detection results can be flexibly determined in two ways, so that the flexibility of a living body detection process is improved, wherein the weights corresponding to the different intermediate living body detection results are adaptively determined in a neural network way, so that end-to-end living body detection is realized, and the efficiency and the precision of the living body detection are improved; and the weights of different intermediate living body detection results are adaptively determined according to the actual situation of the image of the living body detection, so that the obtained living body detection result is more consistent with the real situation, and the precision of the living body detection is further improved.
In one possible implementation, the target in-vivo detection mode includes in-vivo detection based on the depth map and the two-dimensional image; the in-vivo detection of the target object by the target in-vivo detection mode based on the two-dimensional image comprises the following steps: performing living body detection on a first detection image in which the target object is located in the two-dimensional image through at least one first network branch in a living body detection network; and performing living body detection on a second detection image in which the target object is located in the depth map through a second network branch in the living body detection network.
In the disclosed embodiment, the first network branch may include an infrared image biopsy branch and/or a color image biopsy branch, the first detection image may include a face frame intercepted in an infrared image and/or a face frame intercepted in a color image, the second network branch may include a depth map biopsy branch, and the second detection image may include a face frame intercepted in a depth map, by which, in the case that the target biopsy mode simultaneously includes biopsy based on a depth map and a two-dimensional image, an intermediate biopsy result corresponding to the two-dimensional image may be obtained faster by using the first detection image with a smaller size, and an intermediate biopsy result corresponding to the depth map may be obtained by using the second detection image, so that the biopsy result of the target object may be obtained more accurately by using a plurality of intermediate biopsy results, the living body detection precision is ensured, and meanwhile, the living body detection efficiency is improved.
In one possible implementation, the acquiring a depth map and a two-dimensional image of a target object includes: acquiring a depth map and an original two-dimensional image of a target object; and performing registration processing on the original two-dimensional image based on the depth map to obtain the two-dimensional image registered with the depth map, wherein the registration processing comprises cropping processing and/or scaling processing.
According to the embodiment of the disclosure, the two-dimensional image configured with the depth map can be acquired, so that the target size of the target object in the depth map can be determined based on the two-dimensional image, the first detection image and the second detection image can be acquired, and the detection efficiency of the in-vivo detection can be integrally improved.
In one possible implementation, the target in-vivo detection mode includes in-vivo detection based on the two-dimensional image; the in-vivo detection of the target object by the target in-vivo detection mode based on the two-dimensional image comprises the following steps: acquiring a first detection image of the target object in the two-dimensional image; according to a second image corresponding relation between the two-dimensional image and the original two-dimensional image, combining the first detection image to obtain a third detection image of the target object in the original two-dimensional image; performing liveness detection on the third detection image through at least one first network branch in a liveness detection network.
In the embodiment of the disclosure, the third detection image may include a face frame regressing in the original infrared image and/or a face frame regressing in the original color image, and by the embodiment of the disclosure, in the case of performing living body detection based on the two-dimensional image and omitting the depth map, living body detection may be performed through the third detection image with higher resolution captured in the original infrared image and/or the original color image, so that the precision of living body detection is effectively improved, and a more accurate living body detection result may be obtained in the case of omitting the depth map.
In one possible implementation, the method further includes: and under the condition that the target object is determined to be a living body based on the living body detection result, performing identity recognition on the target object according to the two-dimensional image.
By the embodiment of the invention, the target object can be identified under the condition that the target object is determined to be a living body, so that the identification process under the condition that the target object is not a living body is saved, and the identification efficiency and the confidence coefficient are improved.
According to an aspect of the present disclosure, there is provided a living body detection apparatus including:
the image acquisition module is used for acquiring a depth map and a two-dimensional image of a target object; the detection mode determining module is used for determining a target living body detection mode based on the depth image information contained in the depth map; and the living body detection module is used for carrying out living body detection on the target object in the target living body detection mode based on the two-dimensional image to obtain a living body detection result of the target object.
In a possible implementation manner, the detection manner determining module is configured to: acquiring a target size of the target object in the depth map based on depth image information contained in the depth map; when the target size is smaller than a preset size threshold, the target living body detection mode comprises the following steps: a live body detection based on the two-dimensional image; or, when the target size is greater than or equal to a preset size threshold, the target living body detection mode includes: a liveness detection based on the depth map and the two-dimensional image.
In a possible implementation manner, the detection manner determining module is further configured to: performing target object detection on the two-dimensional image to obtain a first detection image of the target object in the two-dimensional image; determining a first image corresponding relation between the depth map and the two-dimensional image based on depth image information contained in the depth map; according to the first image corresponding relation, combining the first detection image to obtain a second detection image of the target object in the depth map; and determining the target size of the target object in the depth map according to the size of the second detection image.
In a possible implementation manner, the detection manner determining module is further configured to: carrying out image quality detection on the first detection image to obtain an image quality detection result; and under the condition that the image quality detection result is larger than a preset quality threshold, determining a first image corresponding relation between the depth map and the two-dimensional image based on depth image information contained in the depth map.
In a possible implementation manner, the detection manner determining module is configured to: acquiring the living body detection distance of the target object based on the depth image information contained in the depth map; when the living body detection distance is greater than a preset distance threshold, the target living body detection method includes: a live body detection based on the two-dimensional image; when the living body detection distance is smaller than or equal to a preset distance threshold, the target living body detection mode comprises the following steps: a liveness detection based on the depth map and the two-dimensional image.
In one possible implementation manner, the two-dimensional image includes an infrared image and/or a color image, and the target living body detection manner includes: liveness detection based on at least two images including at least two of the depth image, the infrared image, and the color image; the in vivo detection module is to: performing living body detection on the target object by the target living body detection mode based on the at least two images to obtain at least two intermediate living body detection results, wherein the at least two intermediate living body detection results respectively correspond to the at least two images; acquiring weights corresponding to the at least two intermediate living body detection results respectively; and obtaining the living body detection result of the target object based on the weight and the at least two intermediate living body detection results.
In one possible implementation, the in-vivo detection module is further configured to: determining weights corresponding to the at least two intermediate in-vivo detection results respectively based on training results of a weighting network layer in an in-vivo detection network, wherein the in-vivo detection network is used for performing in-vivo detection on the target object in the target in-vivo detection mode; or determining weights respectively corresponding to the at least two intermediate living body detection results according to the depth image information and/or two-dimensional image information contained in the two-dimensional image.
In one possible implementation, the target in-vivo detection mode includes in-vivo detection based on the depth map and the two-dimensional image; the in vivo detection module is to: performing living body detection on a first detection image in which the target object is located in the two-dimensional image through at least one first network branch in a living body detection network; and performing living body detection on a second detection image in which the target object is located in the depth map through a second network branch in the living body detection network.
In one possible implementation, the image acquisition module is configured to: acquiring a depth map and an original two-dimensional image of a target object; and performing registration processing on the original two-dimensional image based on the depth map to obtain the two-dimensional image registered with the depth map, wherein the registration processing comprises cropping processing and/or scaling processing.
In one possible implementation, the target in-vivo detection mode includes in-vivo detection based on the two-dimensional image; the in vivo detection module is to: acquiring a first detection image of the target object in the two-dimensional image; according to a second image corresponding relation between the two-dimensional image and the original two-dimensional image, combining the first detection image to obtain a third detection image of the target object in the original two-dimensional image; performing liveness detection on the third detection image through at least one first network branch in a liveness detection network.
In one possible implementation, the apparatus is further configured to: and under the condition that the target object is determined to be a living body based on the living body detection result, performing identity recognition on the target object according to the two-dimensional image.
According to an aspect of the present disclosure, there is provided an electronic device including:
a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the instructions stored by the memory to perform the above-described liveness detection method.
According to an aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described liveness detection method.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flowchart of a liveness detection method according to an embodiment of the present disclosure.
FIG. 2 shows a flow chart of a liveness detection method according to an embodiment of the present disclosure.
FIG. 3 shows a flow chart of a liveness detection method according to an embodiment of the present disclosure.
Fig. 4 shows a network structure diagram of a liveness detection network according to an embodiment of the present disclosure.
FIG. 5 shows a block diagram of a liveness detection device according to an embodiment of the present disclosure.
Fig. 6 shows a schematic diagram of an application example according to the present disclosure.
Fig. 7 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure.
FIG. 8 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
Fig. 1 shows a flowchart of a living body detection method according to an embodiment of the present disclosure, which may be applied to a living body detection apparatus, which may be a terminal device, a server, or other processing device, or the like. The terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like.
In some possible implementations, the liveness detection method may be implemented by way of a processor invoking computer readable instructions stored in a memory.
As shown in fig. 1, the living body detecting method may include:
and S11, acquiring a depth map and a two-dimensional image of the target object.
The target object may be any object to be subjected to living body detection, such as a person or an animal to be subjected to living body detection, and in some possible implementations, the target object may include a human face object and/or a human body object. The number of target objects is not limited in the embodiment of the present disclosure, and may be a single object, or may be multiple objects, and when a target object includes multiple objects, the multiple objects may be simultaneously detected by the biopsy method provided in the embodiment of the present disclosure, or the multiple objects may be respectively detected, and what manner is selected may be flexibly determined according to an actual situation.
The depth map may be an image having as pixel values the depths from the image acquisition device to various points in the acquisition scene, and the depth map of the target object may reflect the geometry of the visible surface of the target object. The method for obtaining the depth map of the target object is not limited in the embodiment of the present disclosure, and may be flexibly determined according to an actual situation, and in some possible implementations, the depth map of the target object may be directly obtained from an image acquisition device, where the image acquisition device may be any device for acquiring an image of the target object, such as a stereo camera or a Time of Flight (TOF) camera.
The two-dimensional image of the target object may be any image obtained by acquiring a two-dimensional image of the target object, and in some possible implementations, the two-dimensional image may be a related image for performing living body detection, and may include an Infrared (IR) image and/or a color image, for example.
The infrared image may be an image formed based on a difference in thermal infrared ray generated between the target object itself and the background, and may be obtained at any time period, with little interference from ambient light. The color image may be an image corresponding to a plurality of channels, such as an RGB image (R denotes Red, Red; G denotes Green, Green; B denotes Blue, Blue), a CMYK image (C denotes Cyan, Cyan; M denotes Magenta, Magenta; Y denotes Yellow; K denotes black), or a YUV image (Y denotes Luminance; U and V denote chroma), and the like.
The number of the acquired depth maps and two-dimensional images is not limited in the embodiment of the present disclosure, and may be flexibly selected according to actual conditions, for acquiring one or more depth maps, one or more two-dimensional images, and the like.
The manner of obtaining the two-dimensional image of the target object is not limited in this disclosure, and may be flexibly determined according to actual situations, and in some possible implementation manners, the two-dimensional image of the target object may be directly obtained from the image acquisition device, and the implementation manner of the image acquisition device may refer to the above-mentioned various disclosed embodiments, and is not described herein again.
In some possible implementations, the depth map and the two-dimensional image of the target object may be acquired simultaneously or may be acquired separately, and in a case where the two-dimensional image includes images in multiple forms, the depth map and various images in the two-dimensional image may be acquired simultaneously or may be acquired separately, and the like.
S12, the target living body detection method is determined based on the depth image information included in the depth map.
The depth image information may include image information of the depth map itself, such as a size or a resolution of the depth map, and may also include related information extracted from the depth map, such as distance information of the target object in the space that may be determined based on the depth map.
The implementation manner of the target living body detection mode can be flexibly selected according to actual situations and is not limited to the following disclosed embodiments. In some possible implementations, the target living body detection mode may include one or more of a living body detection based on an infrared image, a living body detection based on a color image, a living body detection based on an infrared image and a color image, a living body detection based on a depth map and an infrared image, a living body detection based on a depth map and a color image, a living body detection based on a depth map, an infrared image and a color image, and the like.
The determination method of the target living body detection method may also be flexibly changed according to different information contents in the depth image information, for example, one or more target living body detection methods in the above disclosed embodiments may be selected based on the size of the target object in the depth map, or one or more target living body detection methods in the above disclosed embodiments may be selected based on the living body detection distance of the target object, and the details are given in the following disclosed embodiments, and are not first developed.
And S13, performing the biopsy on the target object by a target biopsy mode based on the two-dimensional image to obtain a biopsy result of the target object.
With the target live body detection method determined in S12, live body detection can be performed on the target object based on the two-dimensional image, wherein the process of live body detection can be flexibly determined according to the actual situation of the target live body detection method, such as live body detection can be realized by one or more neural networks or branches of the neural networks that can realize the target live body detection method.
The living body detection based on the two-dimensional image may be a living body detection based on some kind of image in the two-dimensional image, such as a color image or a depth map, or a living body detection based on a plurality of kinds of images in the two-dimensional image, and the like, and may also be flexibly determined according to the actual situation of the target living body detection mode.
In some possible implementations, the living body detection result may include both a case where the target object is determined to be a living body and a case where the target object is determined to be a non-living body; in some possible implementations, the living body detection result may also include various types of confidence that the target object is a living body, a non-living body, and the like.
Through the depth image detection method and device, the actual depth situation of the living body detection can be fully considered based on the depth image information contained in the depth image, a proper target living body detection mode is flexibly selected to achieve the living body detection, and the precision and the flexibility degree of the living body detection are improved.
In one possible implementation, S11 may include:
acquiring a depth map and an original two-dimensional image of a target object;
and performing registration processing on the original two-dimensional image based on the depth map to obtain a two-dimensional image registered with the depth map, wherein the registration processing comprises cropping processing and/or scaling processing.
The original two-dimensional image may be a two-dimensional image obtained after image acquisition of the target object without any processing. The implementation form of the two-dimensional image can refer to the implementation form of the two-dimensional image in the above disclosed embodiments, and details are not repeated here.
In one possible implementation manner, in order to facilitate subsequent live body detection of the target object based on the depth map and the two-dimensional image, the depth map and the original two-dimensional image may be subjected to registration processing, so that the resolutions, spatial positions and the like of the depth map and the two-dimensional image are aligned with each other, thereby reducing the difficulty in subsequent image processing and live body detection.
In some possible implementation manners, the configuration between the two-dimensional image and the depth map may also be implemented by a registration network, where the registration network may be any neural network having an image registration function, and an implementation form of the registration network is not limited in the embodiment of the present disclosure.
In some possible implementations, the original two-dimensional image may include an original infrared image and an original color image, and in some possible implementations, the acquired original infrared image may be registered with the depth map, in which case only the original color image may be subjected to a registration process to obtain a color image configured with the depth map.
Through the embodiment of the disclosure, the two-dimensional image configured with the depth map can be acquired, so that the target size of the target object in the depth map can be determined based on the two-dimensional image, the first detection image, the second detection image and the like can be acquired, and the detection efficiency of the living body detection can be integrally improved.
Fig. 2 shows a flowchart of a living body detection method according to an embodiment of the present disclosure, and as shown in the figure, in one possible implementation, S12 may include:
and S121, acquiring the target size of the target object in the depth map based on the depth image information contained in the depth map.
S122, in the case that the target size is smaller than the preset size threshold, the target living body detection method includes: living body detection based on two-dimensional images. Alternatively, the first and second electrodes may be,
and S123, under the condition that the size of the target is larger than or equal to the preset size threshold, the target living body detection mode comprises the following steps: and detecting the living body based on the depth map and the two-dimensional image.
The target size may be a size of a target object in the depth map, and may include, for example, a length of a long side and/or a length of a short side of the target object in the depth map, or a resolution of the target object in the depth map.
The implementation manner of S121 may be flexibly selected according to actual situations, for example, the target size of the target object may be determined based on size information of the depth map in the depth image information and a ratio of the target object in the depth map, and in some possible implementation manners, the target size may also be determined according to a ratio relationship between the two-dimensional image and the depth map and a size of the target object in the two-dimensional image. The specific implementation manner of S121 can be seen in the following disclosure embodiments, which are not expanded herein.
Based on the acquired target size, the target size may be compared to a preset size threshold to determine a target in vivo detection manner. The size of the preset size threshold may be flexibly set according to an actual situation, and is not limited in the embodiment of the present disclosure.
In the case where the target size is smaller than the preset size threshold, it can be indicated that the size of the target object in the depth map is small, and in this case, the accuracy of the live body detection of the target object based on the depth map is low, and thus the overall accuracy of the live body detection may be affected. Therefore, in a possible implementation manner, in the case that the target size is smaller than the preset size threshold, the target living body detection manner can be determined as the living body detection based on the two-dimensional image, so that the living body detection process based on the depth map is omitted, the living body detection accuracy is improved, meanwhile, the calculation amount of the living body detection is reduced, and the living body detection efficiency is improved.
Since the two-dimensional image may include a plurality of types of images, the two-dimensional image-based living body detection may be a living body detection based on all types of two-dimensional images, a living body detection based on one or more types of images in the two-dimensional image, or the like, and may be flexibly selected according to actual situations. In some possible implementations, the two-dimensional image-based liveness detection may include infrared image-based and/or color image-based liveness detection.
In the case where the target size is greater than or equal to the preset size threshold, it may be indicated that the target object in the depth map is relatively sharp, in which case the target object may be subjected to in-vivo detection based on the depth map. Therefore, in one possible implementation, in a case where the target size is greater than or equal to a preset size threshold, the target living body detection manner may be determined as living body detection based on the depth map and the two-dimensional image to improve the accuracy of the living body detection.
Since the two-dimensional image may include a plurality of types of images, the living body detection based on the depth map and the two-dimensional image may be a living body detection based on the depth map and all types of two-dimensional images, or a living body detection based on one or more of the depth map and the two-dimensional image, and may be flexibly selected according to actual situations. In some possible implementations, the depth map and two-dimensional image based liveness detection may include one or more of a depth map and infrared image based liveness detection, a depth map and color image based liveness detection, and a depth map, infrared image, and color image based liveness detection.
According to the depth map detection method and device, under the condition that the size of the target object in the depth map is small, the depth map is omitted, and the clear two-dimensional image is selected for live body detection, so that on one hand, the influence of the unclear depth map on the live body detection precision is reduced, the live body detection precision is improved, on the other hand, the influence of the depth map on the live body detection distance can also be reduced, and the identification distance of the live body detection is improved.
Fig. 3 shows a flowchart of a living body detection method according to an embodiment of the present disclosure, and as shown in the figure, in one possible implementation, S121 may include:
s1211, performing target object detection on the two-dimensional image to obtain a first detection image of the target object in the two-dimensional image;
s1212, determining a first image corresponding relation between the depth map and the two-dimensional image based on the depth image information contained in the depth map;
s1213, according to the first image corresponding relation, combining the first detection image to obtain a second detection image of the target object in the depth map;
and S1214, determining the target size of the target object in the depth map according to the size of the second detection image.
The first detection image is an image in which the target object extracted from the two-dimensional image is located, and may include, for example, a detection image extracted from an infrared image and/or a detection image extracted from a color image.
In some possible implementations, the first detection image may be an image in which the whole and/or part of the target object extracted from the two-dimensional image is located, for example, the first detection image may be a detection image determined based on a whole detection frame of the target object, a human body detection frame of the target object, a human face detection frame of the target object, or the like.
The method for detecting the target object of the two-dimensional image to obtain the first detection image is not limited in the embodiments of the present disclosure, and may be flexibly selected according to actual situations, and in some possible implementation manners, the two-dimensional image may be passed through a network having the target object detection network to obtain a detection frame output by the network having the target object detection network, and the two-dimensional image is clipped based on the detection frame to obtain the first detection image. The implementation manner of the target object detection network is not limited in the embodiment of the present disclosure, and any neural network having an object detection function may be used as the implementation form of the target object detection network.
In some possible implementations, in addition to obtaining the first detected image through target object detection, the first image correspondence between the depth map and the two-dimensional image may be determined based on depth image information included in the depth map.
The first image correspondence may be an image coordinate transformation relationship between the depth map and the two-dimensional image. The method for determining the corresponding relationship of the first image based on the depth image information can be flexibly determined according to actual conditions, and in some possible implementation manners, the position conversion relationship of pixel points between the depth image and the two-dimensional image can be determined as the corresponding relationship of the first image according to information such as the size and the resolution of the depth image in the depth image information and the position of corner points, and by combining the information such as the size and the resolution of the two-dimensional image and the position of the corner points. In some possible implementation manners, the two-dimensional image may also be directly subjected to image transformation according to information such as the size and resolution of the depth map in the depth image information, and the position of the corner point, so as to obtain the two-dimensional image with the resolution and the spatial position aligned with the depth map as the transformed two-dimensional image, and based on the image correspondence between the transformed two-dimensional image and the two-dimensional image, the first image correspondence between the depth map and the two-dimensional image may be determined.
In some possible implementations, in a case that the two-dimensional image is a registered two-dimensional image obtained by performing registration processing on the original two-dimensional image in the above disclosed embodiment, it may be directly determined that the first image correspondence between the depth map and the two-dimensional image is mutual correspondence.
It should be noted that, in the embodiment of the present disclosure, the implementation order of S1211 and S1212 may be flexibly determined according to the actual situation, may be implemented simultaneously, may also be implemented sequentially according to a certain order, and the like, and is not limited in the embodiment of the present disclosure.
According to the position of the first detection image in the two-dimensional image and the first image corresponding relation between the depth map and the two-dimensional image, the position and the size of the target object in the depth map can be determined, and therefore the second detection image where the target object is located in the depth map is obtained.
The second detection image may also be an image of the whole and/or part of the target object in the depth map, and the implementation manner may refer to the first detection image, which is not described herein again. The specific process of obtaining the second detection image may also be flexibly selected according to the actual situation, and in one example, the position of the first detection image in the two-dimensional image may be transformed into the depth map through the correspondence relationship between the first images, so as to determine the position of the target object in the depth map, and the depth map is cropped based on the position to obtain the second detection image.
Since the second detection image is an image of the depth map where the target object is located, the target size of the target object in the depth map can be determined according to the size of the second detection image. Determining the target size based on which sizes of the second detection image are not limited in the embodiments of the present disclosure, and in some possible implementations, the target size may be a size determined based on a length and/or a width of the second detection image, and in some possible implementations, the target size may also be a size having a maximum value or a minimum value among the length and the width of the second detection image, and the like.
In some possible implementations, since the second detection image may be an image of the whole and/or part of the target object in the depth map, the size of the second detection image may be the whole size and/or part size of the target object, and in the case that the size of the second detection image is the part size of the target object, the whole size of the target object may be inferred from the part size, for example, the part size is converted into the whole size to obtain the target size according to a size ratio between a human face and a human body of most human faces; in some possible implementations, the partial size may also be directly used as the target size, in which case, the preset size threshold may be a threshold set according to the partial size of the target object, for example, the preset size threshold may be a size threshold set based on the size of the face of the target object.
Through the embodiment of the disclosure, the target object can be positioned by utilizing the two-dimensional image, the target size of the target object in the depth map is conveniently determined by utilizing the corresponding relation of the two-dimensional image and the depth map, the determination mode of the target size is more convenient and has higher precision, and therefore the efficiency and precision of the living body detection are improved.
In one possible implementation manner, after S1211, the method provided by the embodiment of the present disclosure may further include:
carrying out image quality detection on the first detection image to obtain an image quality detection result;
and under the condition that the image quality detection result is greater than a preset quality threshold value, determining a first image corresponding relation between the depth map and the two-dimensional image based on the depth image information contained in the depth map.
The image quality detection result may include the image quality of the first detection image under one or more evaluation criteria, and the evaluation criteria may be flexibly set according to the actual situation, and is not limited to the following disclosure embodiments, for example, the image quality detection result may include one or more quality evaluation criteria such as definition, integrity, or darkness.
The mode of detecting the image quality of the first detection image is not limited in the embodiment of the present disclosure, and may be flexibly selected according to actual situations. In some possible implementations, the first detection image may be input into a quality detection network to obtain an image quality detection result output by the quality detection network, where the quality detection network may be any neural network having an image quality detection function, and is not limited in the embodiment of the present disclosure, and the output image quality detection result may be a comprehensive detection result under the above-mentioned multiple evaluation criteria, or may be a respective evaluation result under one or more evaluation criteria, and the like. In some possible implementation manners, image quality detection may also be performed on the first detection image through a related image quality detection algorithm, for example, integrity of the first detection image is determined through edge point detection, sharpness quality of the first detection image is determined through a sharpness identification method, or darkness quality of the first detection image is determined through color values of each pixel point in the first detection image.
Based on the obtained image quality detection result, a comparison with a preset quality threshold value may be performed to determine the subsequent execution step. The value of the preset quality threshold may be flexibly determined according to the actual situation, and is not limited in the embodiment of the present disclosure. In some possible implementation manners, respective corresponding preset quality thresholds may be set for the plurality of evaluation criteria, the image quality detection results under the evaluation criteria are compared with the preset quality thresholds, and the image quality detection results are considered to be greater than the preset quality thresholds when the image quality detection results under the evaluation criteria are greater than the respective corresponding preset quality thresholds. In some possible implementation manners, a comprehensive image quality detection result may also be obtained based on the image quality detection results under the respective evaluation criteria, and the comprehensive image quality detection result is compared with a preset comprehensive quality threshold to obtain a comparison result.
In the case where the image quality detection result is greater than the preset quality threshold, the quality of the first detection image may be considered to meet the requirement of the living body detection, and in this case, the process may proceed to S1212.
In some possible implementations, in the case that the implementation order at S1212 is the same as the implementation order at S1211, or before S1211, it may be directly proceeded to S1213 after determining that the image quality detection result is greater than the preset quality threshold.
In the embodiment of the disclosure, the image quality detection is used for screening the image quality entering the living body detection process subsequently, so that the image quality of the input image in the living body detection process is improved, and the living body detection precision is improved.
In some possible implementations, in a case where the image quality detection result is less than or equal to the preset quality threshold, the quality of the first detection image may be considered to be low, and accordingly, the image quality of the two-dimensional image corresponding to the first detection image may also be low, in which case, the living body detection result obtained by the living body detection based on the two-dimensional image is highly likely to be inaccurate. Therefore, in one possible implementation, in a case where the image quality detection result is less than or equal to the preset quality threshold, the live body detection based on the acquired two-dimensional image may be stopped.
After the in-vivo detection based on the acquired two-dimensional image is stopped, in a possible implementation manner, a new depth map and a two-dimensional image can be acquired again, and the in-vivo detection and the like are realized based on the newly acquired depth map and the two-dimensional image by the in-vivo detection method provided by the embodiment of the disclosure; in some possible implementations, the biopsy procedure may also be exited directly, or the like.
By stopping the in-vivo detection based on the acquired two-dimensional image under the condition that the image quality detection result is less than or equal to the preset quality threshold, the subsequent process can be stopped in time under the condition that the image quality of the first detection image is low through the process, so that invalid calculation is reduced, and the accuracy and the efficiency of the in-vivo detection are improved.
In one possible implementation, S12 may include:
acquiring the living body detection distance of the target object based on the depth image information contained in the depth map;
when the living body detection distance is greater than the preset distance threshold, the target living body detection mode comprises the following steps: detecting a living body based on the two-dimensional image;
when the living body detection distance is less than or equal to the preset distance threshold, the target living body detection mode comprises the following steps: and detecting the living body based on the depth map and the two-dimensional image.
The live body detection distance may be a distance between the target object and the live body detection device, how to obtain the live body detection distance based on the depth image information included in the depth map, and an implementation manner of the live body detection distance may be flexibly determined according to an actual situation, and is not limited to the following disclosed embodiments. In a possible implementation manner, the distance between the target object and the image acquisition device can be determined according to the depth distance embodied by each pixel point in the depth map, and the in-vivo detection distance between the target object and the in-vivo detection device can be determined according to the position corresponding relationship between the image acquisition device and the in-vivo detection device; in a possible implementation manner, in the case that the living body detection device itself includes the image acquisition device, the living body detection distance between the target object and the living body detection device may be directly determined according to the depth distance reflected by each pixel point in the depth map.
Based on the acquired live body detection distance, the live body detection distance may be compared with a preset distance threshold to determine a target live body detection manner. The distance of the preset distance threshold may also be flexibly set according to actual conditions, and is not limited in the embodiment of the present disclosure.
In the case where the living body detection distance is greater than the preset distance threshold, the target object in the depth map may be less sharp, and in this case, the accuracy of the living body detection of the target object based on the depth map is lower, so that the overall accuracy of the living body detection may be affected. Therefore, in a possible implementation manner, when the living body detection distance is greater than the preset distance threshold, the target living body detection manner can be determined as the living body detection based on the two-dimensional image, so that the living body detection process based on the depth map is omitted, the living body detection accuracy is improved, meanwhile, the calculation amount of the living body detection is reduced, and the living body detection efficiency is improved.
For the implementation form of the living body detection based on the two-dimensional image, reference may be made to the above-mentioned embodiments, which are not described herein again.
In the case where the live body detection distance is less than or equal to the preset distance threshold, the target object may be clearer in the depth map, in which case the target object may be live body detected based on the depth map. Therefore, in one possible implementation, in a case where the living body detection distance is less than or equal to a preset distance threshold, the target living body detection manner may be determined as the living body detection based on the depth map and the two-dimensional image to improve the accuracy of the living body detection.
In the embodiments, the depth map and the two-dimensional image may also be referred to in the embodiments disclosed above, and details are not repeated here.
By the aid of the method and the device, under the condition that the target object is far away from the living body detection device, the depth map is omitted, and the two-dimensional image which is less affected by the distance is selected to perform living body detection, so that the living body detection precision is improved, meanwhile, the influence of the depth map on the living body detection distance is reduced, and the identification distance of the living body detection is improved.
As described in the foregoing embodiments, the two-dimensional image may include an infrared image and/or a color image, and the target living body detection method may include a detection method based on the two-dimensional image, or a detection method based on a depth map and the two-dimensional image, and therefore, in some possible implementations, the target living body detection method may include: the living body detection method based on at least two images can be used for detecting living bodies, wherein the at least two images can be a depth map and an infrared image, a depth map and a color image, an infrared image and a color image, or a depth map, an infrared image and a color image.
Thus, in one possible implementation, S13 may include:
performing living body detection on the target object in a target living body detection mode based on the at least two images to obtain at least two intermediate living body detection results;
acquiring weights corresponding to at least two intermediate living body detection results respectively;
and obtaining the living body detection result of the target object based on the weight and at least two intermediate living body detection results.
Wherein the intermediate in-vivo detection result may be a detection result obtained by performing in-vivo detection based on one of the images, and since the target in-vivo detection manner may include in-vivo detection based on at least two kinds of images, accordingly, at least two kinds of intermediate in-vivo detection results respectively corresponding to the at least two kinds of images may be obtained. For example, in one example, the live body detection may be performed based on a depth map, an infrared image, and a color image, in which case an intermediate live body detection result corresponding to the depth map, an intermediate live body detection result corresponding to the infrared image, and an intermediate live body detection result corresponding to the color image may be obtained, respectively. In one example, the live body detection may be performed based on the infrared image and the color image, in which case an intermediate live body detection result corresponding to the infrared image and an intermediate live body detection result corresponding to the color image may be obtained separately.
Based on the obtained at least two intermediate in-vivo detection results, weights corresponding to different intermediate in-vivo detection results can be further obtained, and weighted summation is performed according to the weights and the at least two intermediate in-vivo detection results to obtain in-vivo detection results of the target object.
In a possible implementation manner, the respective weights may be preset for different intermediate in-vivo detection results and the preset weights may be directly read. In some possible implementations, adaptive weights adapted to the actual conditions of the at least two images may be obtained in other ways as well. The method for obtaining the adaptive weight can be flexibly determined according to the actual situations of at least two images, and is described in the following disclosure embodiments, which are not expanded first.
In some possible implementations, the weights of the intermediate live detection results corresponding to the same kind of image may be different according to different target live detection modes. For example, in a possible implementation manner, in the case that the target living body detection manner is a living body detection based on a depth map, an infrared image, and a color image, the weight of the intermediate living body detection result corresponding to the infrared image may be a, and in the case that the target living body detection manner is a living body detection based on an infrared image and a color image, the weight of the intermediate living body detection result corresponding to the infrared image may be B, and values of a and B may be different or the same, and may be determined flexibly according to actual situations, which is not limited in the embodiment of the present disclosure.
The process of obtaining the living body detection result of the target object based on the weight and the at least two intermediate living body detection results is not limited in the embodiment of the present disclosure, and in a possible implementation manner, the living body detection result of the target object may be obtained by summing up the various intermediate living body detection results after being multiplied by the corresponding weights.
By the aid of the depth map live detection method and the depth map live detection system, under the condition that at least two intermediate live detection results are included, the weight of the depth map live detection result can be reduced in a self-adaptive weighting mode, so that the influence of the live detection result corresponding to the depth map can be reduced under the condition of 3D prosthesis attack, and the live detection precision is further improved.
In one possible implementation manner, obtaining weights corresponding to at least two intermediate in-vivo detection results respectively may include:
and determining weights corresponding to at least two intermediate in-vivo detection results respectively based on training results of a weighting network layer in an in-vivo detection network, wherein the in-vivo detection network is used for performing in-vivo detection on the target object in a target in-vivo detection mode. Alternatively, the first and second electrodes may be,
and determining weights corresponding to at least two intermediate living body detection results respectively according to the depth image information and/or two-dimensional image information contained in the two-dimensional image.
The living body detection network may be a network for performing living body detection on a target object, and an implementation form of the living body detection network is not limited in the embodiments of the present disclosure, and is not limited to the following disclosed embodiments. In one possible implementation, the liveness detection network may include at least one first network branch and a second network branch, where the first network branch may be used to implement the liveness detection based on the two-dimensional image, and the second network branch may be used to implement the liveness detection based on the depth map. As described in the above-mentioned embodiments, the two-dimensional image may include an infrared image and/or a color image, and thus, in one possible implementation, the number of the first network branches may be two, and the first network branches are respectively used for realizing the infrared image-based biopsy and the color image-based biopsy.
The training method of the living body detection network is not limited, and any neural network training method can be used for training the living body detection network.
According to different target living body detection modes, each branch in the living body detection network can be flexibly used in the living body detection process, for example, in one possible implementation mode, in the case that the target living body detection mode comprises living body detection based on a depth map and an infrared image, the infrared image can be input into a first network branch corresponding to the infrared image, and the depth map can be input into a second network branch, so that the living body detection in the target living body detection mode can be realized; in one possible implementation, in the case that the target liveness detection mode includes liveness detection based on a depth map, an infrared image and a color image, the infrared image may be input to the first network branch corresponding to the infrared image, the color image may be input to the first network branch corresponding to the color image, and the depth map may be input to the second network branch to implement the liveness detection in the target liveness detection mode.
Fig. 4 is a schematic diagram of a network structure of a living body detection network according to an embodiment of the disclosure, and as shown in the figure, in one possible implementation manner, the living body detection network may further include a weighting network layer, and the weighting network layer may be respectively connected to the output ends of the second network branch and each first network branch, so as to perform weighted summation on intermediate living body detection results output by the second network branch and each first network branch to obtain a living body detection result of the target object.
In the case where the living body detection network includes the weighting network layer, the training of the weighting network layer can be similarly performed in the course of training the living body detection network, and in this case, the weights corresponding to at least two intermediate living body detection results can be determined based on the training results obtained by the weighting network layer after training.
In a possible implementation, the weights may also be determined according to depth image information and/or two-dimensional image information contained in the two-dimensional image. For example, in some possible implementations, in the case that the live body detection distance is large, the precision of the intermediate live body detection result corresponding to the depth map may be low, so that a smaller weight may be assigned to the intermediate live body detection result, and a specific correspondence between the weight and the live body detection distance may be flexibly set according to an actual situation, which is not limited in the embodiment of the present disclosure.
The two-dimensional image information may be related information included in the two-dimensional image, such as various types of information, such as size and brightness of the two-dimensional image, which is not limited in the embodiment of the present disclosure. In some possible implementation manners, under the condition that the brightness is high, the intermediate live body detection obtained by the live body detection based on the color image is relatively more accurate, so that the brightness of the color image in the two-dimensional image can be compared with a preset brightness threshold, and a higher weight is allocated to the intermediate live body detection result corresponding to the color image under the condition that the brightness of the color image exceeds the preset brightness threshold, wherein the numerical value of the preset brightness threshold and the numerical value of the allocated weight are not limited in the embodiment of the disclosure, and can be flexibly selected according to the actual situation. In some possible implementations, in the case of a larger size, the intermediate live body detection obtained by live body detection based on the infrared image is relatively more accurate, and therefore, similarly, a higher weight or the like may be assigned to the infrared image in the case of a larger size of the infrared image.
According to the embodiment of the disclosure, the weights of different intermediate living body detection results can be flexibly determined in two ways, so that the flexibility of the living body detection process is improved, wherein the weights corresponding to the different intermediate living body detection results are adaptively determined in a neural network way, so that end-to-end living body detection is realized, and the efficiency and the precision of the living body detection are improved; and the weights of different intermediate living body detection results are adaptively determined according to the actual situation of the image of the living body detection, so that the obtained living body detection result is more consistent with the real situation, and the precision of the living body detection is further improved.
In one possible implementation, the target living body detection mode may include living body detection based on a depth map and a two-dimensional image, and S13 may include:
and performing living body detection on the first detection image in which the target object is located in the two-dimensional image through at least one first network branch in the living body detection network. And the number of the first and second groups,
and performing living body detection on a second detection image where the target object is located in the depth map through a second network branch in the living body detection network.
The implementation forms of the living body detection network, the first network branch, the second network branch, the first detection image, and the second detection image may refer to the above-mentioned embodiments, and are not described herein again.
Because the first detection image can be an image of a target object extracted from the two-dimensional image, the first detection image is input to the first network branch for living body detection, so that the calculation amount in the living body detection process can be effectively reduced, and the living body detection efficiency is improved.
As described in the above-mentioned embodiments, the first network branch may include a first network branch corresponding to the infrared image and a first network branch corresponding to the color image, and in order to realize the living body detection of the first detection image in which the target object is located in the two-dimensional image, in one possible implementation manner, only the first detection image extracted from the infrared image may be input to the first network branch corresponding to the infrared image, only the first detection image extracted from the color image may be input to the first network branch corresponding to the color image, or the first detection images extracted from the infrared image and the color image may be input to the respective corresponding first network branches, etc.
Similarly, since the second detection image may be an image of the target object extracted from the depth map, inputting the second detection image to the second network branch for live body detection may also improve the live body detection efficiency.
According to the embodiment of the disclosure, when the target living body detection mode simultaneously comprises living body detection based on the depth map and the two-dimensional image, the first detection image with a smaller size is utilized to obtain the intermediate living body detection result corresponding to the two-dimensional image faster, and the second detection image is utilized to obtain the intermediate living body detection result corresponding to the depth map, so that the living body detection result of the target object can be obtained more accurately through a plurality of intermediate living body detection results, the living body detection precision is ensured, and the living body detection efficiency is improved.
In one possible implementation, the target living body detection means may include a living body detection based on a two-dimensional image, and S13 may include:
and performing living body detection on the first detection image in which the target object is located in the two-dimensional image through at least one first network branch in the living body detection network.
For the implementation form of the embodiment of the present disclosure, reference may be made to the above-mentioned embodiment, which is not described herein again. Through the embodiment of the disclosure, under the condition that the depth map is unclear or the distance is far, the depth map is omitted, the living body detection is realized through the two-dimensional image, and the overall precision of the living body detection is improved.
In one possible implementation, the target living body detection means may include a living body detection based on a two-dimensional image, and S13 may include:
acquiring a first detection image where a target object is located in a two-dimensional image;
according to the second image corresponding relation between the two-dimensional image and the original two-dimensional image, combining the first detection image to obtain a third detection image of the target object in the original two-dimensional image;
the third detection image is live-tested by at least one first network branch in the live-testing network.
The second image correspondence relationship may be an image coordinate transformation relationship between the two-dimensional image and the original image. As described in the foregoing embodiments, in a possible implementation manner, the two-dimensional image may be an image obtained by performing registration processing on an original two-dimensional image, and therefore, in the registration process, the correspondence relationship of the second image may be automatically determined.
As described in the foregoing embodiments, the first detection image is an image in which the target object extracted from the two-dimensional image is located, and based on the correspondence relationship between the second images, a third detection image in which the target object is located may be extracted from the original two-dimensional image. In a possible implementation manner, the coordinate position of the first detection image in the two-dimensional image may be transformed through the second image correspondence relationship to obtain the coordinate position of the target object in the original two-dimensional image, and the original two-dimensional image is cropped based on the coordinate position to obtain the third detection image.
Since the first detection image may include the first detection image extracted from the infrared image and/or the first detection image extracted from the color image, accordingly, the third detection image may also include the third detection image extracted from the original infrared image and/or the third detection image extracted from the original color image.
The method for performing the live body detection on the third detection image through at least one first network branch in the live body detection network may refer to the method for performing the live body detection on the first detection image in the foregoing disclosed embodiment, and is not described herein again.
In the process of registering the original two-dimensional image and the depth map, registration processing such as cropping and/or scaling may be performed on the original two-dimensional image, so that the resolution or definition of the two-dimensional image is lower than that of the original two-dimensional image, and therefore, a third detection image obtained from the original two-dimensional image may have higher image quality and higher accuracy of live body detection based on the third detection image than a first detection image extracted from the two-dimensional image.
Therefore, according to the embodiments of the present disclosure, in the case of performing the living body detection based on the two-dimensional image and omitting the depth map, the living body detection may be performed through the third detection image with higher resolution cut out from the original infrared image and/or the original color image, so as to effectively improve the accuracy of the living body detection, and a more accurate living body detection result may be obtained even in the case of omitting the depth map.
In a possible implementation manner, the living body detection method provided by the embodiment of the present disclosure may further include:
in the case where the target object is determined to be a living body based on the living body detection result, the target object is subjected to identification from the two-dimensional image.
The identification of the target object according to the two-dimensional image may include identification of the target object based on a color image, identification of the target object based on an infrared image, or identification of the target object based on a color image and an infrared image. In some possible implementation manners, three-dimensional identity recognition and the like can be achieved on the target object according to the two-dimensional image and in combination with the depth map.
The specific way of identity recognition is not limited in the embodiment of the present disclosure, and any process that can realize identity recognition based on an image can be used as a way of realizing identity recognition. In a possible implementation manner, the identification of the target object can be realized through any neural network with an identification function.
In one possible implementation, in the case where the target object is determined to be a non-living body based on the living body detection result, the procedure may be ended without performing identification on the target object. By the embodiment of the invention, the target object can be identified under the condition that the target object is determined to be a living body, so that the identification process under the condition that the target object is not a living body is saved, and the identification efficiency and the confidence coefficient are improved.
Fig. 5 shows a block diagram of a living body detecting apparatus 20 according to an embodiment of the present disclosure, which includes, as shown in fig. 5:
and an image obtaining module 21, configured to obtain a depth map and a two-dimensional image of the target object.
And a detection mode determining module 22, configured to determine a target living body detection mode based on the depth image information included in the depth map.
And the living body detection module 23 is configured to perform living body detection on the target object in a target living body detection manner based on the two-dimensional image to obtain a living body detection result of the target object.
In one possible implementation manner, the detection manner determining module is configured to: acquiring the target size of a target object in the depth map based on the depth image information contained in the depth map; when the target size is smaller than the preset size threshold, the target living body detection mode comprises the following steps: detecting a living body based on the two-dimensional image; or, when the size of the target is larger than or equal to the preset size threshold, the target living body detection mode comprises the following steps: and detecting the living body based on the depth map and the two-dimensional image.
In a possible implementation manner, the detection manner determining module is further configured to: performing target object detection on the two-dimensional image to obtain a first detection image of a target object in the two-dimensional image; determining a first image corresponding relation between the depth map and the two-dimensional image based on depth image information contained in the depth map; according to the first image corresponding relation, a second detection image of the target object in the depth map is obtained by combining the first detection image; and determining the target size of the target object in the depth map according to the size of the second detection image.
In a possible implementation manner, the detection manner determining module is further configured to: carrying out image quality detection on the first detection image to obtain an image quality detection result; and under the condition that the image quality detection result is greater than a preset quality threshold value, determining a first image corresponding relation between the depth map and the two-dimensional image based on the depth image information contained in the depth map.
In one possible implementation manner, the detection manner determining module is configured to: acquiring the living body detection distance of the target object based on the depth image information contained in the depth map; when the living body detection distance is greater than the preset distance threshold, the target living body detection mode comprises the following steps: detecting a living body based on the two-dimensional image; when the living body detection distance is less than or equal to the preset distance threshold, the target living body detection mode comprises the following steps: and detecting the living body based on the depth map and the two-dimensional image.
In one possible implementation manner, the two-dimensional image includes an infrared image and/or a color image, and the target living body detection manner includes: detecting a living body based on at least two images, wherein the at least two images comprise at least two of a depth image, an infrared image and a color image; the in vivo detection module is used for: performing living body detection on the target object in a target living body detection mode based on the at least two images to obtain at least two intermediate living body detection results, wherein the at least two intermediate living body detection results respectively correspond to the at least two images; acquiring weights corresponding to at least two intermediate living body detection results respectively; and obtaining the living body detection result of the target object based on the weight and at least two intermediate living body detection results.
In one possible implementation, the in-vivo detection module is further configured to: determining weights corresponding to at least two intermediate in-vivo detection results respectively based on training results of a weighting network layer in an in-vivo detection network, wherein the in-vivo detection network is used for performing in-vivo detection on a target object in a target in-vivo detection mode; or determining the weights respectively corresponding to the at least two intermediate living body detection results according to the depth image information and/or the two-dimensional image information contained in the two-dimensional image.
In one possible implementation, the target living body detection mode comprises living body detection based on a depth map and a two-dimensional image; the in vivo detection module is used for: performing living body detection on a first detection image in which a target object in the two-dimensional image is located through at least one first network branch in the living body detection network; and performing living body detection on a second detection image in which the target object is located in the depth map through a second network branch in the living body detection network.
In one possible implementation, the image acquisition module is configured to: acquiring a depth map and an original two-dimensional image of a target object; and performing registration processing on the original two-dimensional image based on the depth map to obtain a two-dimensional image registered with the depth map, wherein the registration processing comprises cropping processing and/or scaling processing.
In one possible implementation, the target in-vivo detection mode comprises in-vivo detection based on a two-dimensional image; the in vivo detection module is used for: acquiring a first detection image where a target object is located in a two-dimensional image; according to the second image corresponding relation between the two-dimensional image and the original two-dimensional image, combining the first detection image to obtain a third detection image of the target object in the original two-dimensional image; the third detection image is live-tested by at least one first network branch in the live-testing network.
In one possible implementation, the apparatus is further configured to: in the case where the target object is determined to be a living body based on the living body detection result, the target object is subjected to identification from the two-dimensional image.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
Application scenario example
Fig. 6 is a schematic diagram illustrating an application example according to the present disclosure, and as shown in the diagram, the present disclosure proposes a living body detection method, and the living body detection process may include the following processes:
s31, acquiring an image of a human object to be detected by a camera, and acquiring an original depth map D, an original infrared image I and an original RGB image V of the human object from the camera.
And S32, cutting and scaling the original infrared image I and the original RGB image V to align the resolution and the spatial position of the original infrared image I and the original RGB image V with the original depth map D, so as to obtain the aligned infrared image I and RGB image V.
And S33, performing face detection on the infrared image i to obtain a face frame bbox as a first detection image extracted from the infrared image.
And S34, performing face quality detection on the bbox to obtain an image quality detection result, and stopping the current process and returning to S31 to obtain the image again under the condition that the image quality detection result is lower than a preset quality threshold.
And S35, cutting out a corresponding face frame box _ v from the RGB image v according to the bbox, and cutting out a corresponding face frame box _ d from the original depth map as a second detection image, and taking the length and/or width of the box _ d as a target size.
And S36, under the condition that the target size is smaller than the preset size threshold, respectively corresponding the bbox and the box _ V back to the original infrared image I and the original RGB image V to obtain a face frame box _ I intercepted from the original infrared image and a face frame box _ V intercepted from the original RGB image, and taking the face frame box _ I and the face frame box _ V as the face frame to be detected.
And S37, taking box _ d, bbox and box _ v as the face frames to be detected under the condition that the size of the target is larger than or equal to the preset size threshold.
And S38, inputting the face frame to be detected into the living body detection network, and obtaining intermediate living body detection results respectively corresponding to each face frame output by the living body detection network, and adaptive weights respectively corresponding to each intermediate living body detection result, wherein the adaptive weights can be obtained by the living body detection network, or can be obtained according to the original depth map D, the original infrared image I and the image information in the original RGB image V, wherein the image information can include living body detection distance, image brightness or image size, and the like.
And S39, weighting each intermediate living body detection result according to the self-adaptive weight to obtain a final living body detection result.
The living body detection method provided by the application example of the disclosure can support a longer identification distance and is easier to apply; the defense force and the detection precision are high, and the real person passing rate is high; in addition, the in-vivo detection network provided in the application example of the present disclosure can be obtained by deforming a relevant in-vivo detection network model, and is easy to implement, and meanwhile, the second network branch for performing in-vivo detection based on the depth map in the in-vivo detection network can be trained independently, so that the training mode is more flexible and easy to train.
The living body detection method provided by the application example can be used for scenes such as face entrance guard and face payment, is convenient for longer-distance face brushing passing and payment, and is more convenient. Meanwhile, the higher defense force can also improve the safety of entrance guard and property.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-mentioned method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
The embodiments of the present disclosure also provide a computer program product, which includes computer readable code, when the computer readable code runs on a device, a processor in the device executes instructions for implementing the living body detection method provided in any one of the above embodiments.
The disclosed embodiments also provide another computer program product for storing computer readable instructions, which when executed, cause a computer to perform the operations of the living body detection method provided by any of the above embodiments.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 7 illustrates a block diagram of an electronic device 800 in accordance with an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 7, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 8 illustrates a block diagram of an electronic device 1900 in accordance with an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 8, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
Electronic device 1900 may also include oneA power component 1926 is configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 is configured to connect the electronic device 1900 to a network, and an input-output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system, such as Windows Server, stored in memory 1932TM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTMOr the like.
In some possible implementations, each module included in the living body detecting apparatus 20 corresponds to each hardware module included in an electronic device provided as a terminal, a server, or another device, and the corresponding mode can be flexibly determined according to the device form of the electronic device, and is not limited to the following disclosed embodiments. For example, in one example, each module included in the living body detecting apparatus 20 may correspond to the processing component 802 in the electronic device in the terminal form; in one example, each module included in the living body detecting apparatus 20 may correspond to the processing component 1922 in the electronic device in the form of a server.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (14)

1. A method of in vivo detection, comprising:
acquiring a depth map and a two-dimensional image of a target object;
determining a target living body detection mode based on the depth image information contained in the depth map;
and performing living body detection on the target object by the target living body detection mode based on the two-dimensional image to obtain a living body detection result of the target object.
2. The method according to claim 1, wherein the determining a target in vivo detection mode based on the depth image information included in the depth map comprises:
acquiring a target size of the target object in the depth map based on depth image information contained in the depth map;
when the target size is smaller than a preset size threshold, the target living body detection mode comprises the following steps: a live body detection based on the two-dimensional image; or the like, or, alternatively,
when the target size is larger than or equal to a preset size threshold, the target living body detection mode comprises the following steps: a liveness detection based on the depth map and the two-dimensional image.
3. The method of claim 2, wherein the obtaining the target size of the target object in the depth map based on the depth image information included in the depth map comprises:
performing target object detection on the two-dimensional image to obtain a first detection image of the target object in the two-dimensional image;
determining a first image corresponding relation between the depth map and the two-dimensional image based on depth image information contained in the depth map;
according to the first image corresponding relation, combining the first detection image to obtain a second detection image of the target object in the depth map;
and determining the target size of the target object in the depth map according to the size of the second detection image.
4. The method of claim 3, wherein after the performing target object detection on the two-dimensional image to obtain a first detected image of the target object in the two-dimensional image, the method further comprises:
carrying out image quality detection on the first detection image to obtain an image quality detection result;
and under the condition that the image quality detection result is larger than a preset quality threshold, determining a first image corresponding relation between the depth map and the two-dimensional image based on depth image information contained in the depth map.
5. The method according to any one of claims 1 to 4, wherein the determining a target in vivo detection mode based on the depth image information included in the depth map includes:
acquiring the living body detection distance of the target object based on the depth image information contained in the depth map;
when the living body detection distance is greater than a preset distance threshold, the target living body detection method includes: a live body detection based on the two-dimensional image;
when the living body detection distance is smaller than or equal to a preset distance threshold, the target living body detection mode comprises the following steps: a liveness detection based on the depth map and the two-dimensional image.
6. The method according to any one of claims 1 to 5, wherein the two-dimensional image comprises an infrared image and/or a color image, and the target living body detection mode comprises: liveness detection based on at least two images including at least two of the depth image, the infrared image, and the color image;
the method for performing in-vivo detection on the target object by the target in-vivo detection mode based on the two-dimensional image to obtain the in-vivo detection result of the target object comprises the following steps:
performing living body detection on the target object by the target living body detection mode based on the at least two images to obtain at least two intermediate living body detection results, wherein the at least two intermediate living body detection results respectively correspond to the at least two images;
acquiring weights corresponding to the at least two intermediate living body detection results respectively;
and obtaining the living body detection result of the target object based on the weight and the at least two intermediate living body detection results.
7. The method according to claim 6, wherein the obtaining weights respectively corresponding to the at least two intermediate in-vivo detection results comprises:
determining weights corresponding to the at least two intermediate in-vivo detection results respectively based on training results of a weighting network layer in an in-vivo detection network, wherein the in-vivo detection network is used for performing in-vivo detection on the target object in the target in-vivo detection mode; alternatively, the first and second electrodes may be,
and determining weights respectively corresponding to the at least two intermediate living body detection results according to the depth image information and/or two-dimensional image information contained in the two-dimensional image.
8. The method according to any one of claims 1 to 7, wherein the target in-vivo detection manner includes in-vivo detection based on the depth map and the two-dimensional image;
the in-vivo detection of the target object by the target in-vivo detection mode based on the two-dimensional image comprises the following steps:
performing living body detection on a first detection image in which the target object is located in the two-dimensional image through at least one first network branch in a living body detection network; and the number of the first and second groups,
and performing living body detection on a second detection image where the target object is located in the depth map through a second network branch in the living body detection network.
9. The method of any one of claims 1 to 8, wherein the obtaining the depth map and the two-dimensional image of the target object comprises:
acquiring a depth map and an original two-dimensional image of a target object;
and performing registration processing on the original two-dimensional image based on the depth map to obtain the two-dimensional image registered with the depth map, wherein the registration processing comprises cropping processing and/or scaling processing.
10. The method according to claim 9, wherein the target liveness detection mode includes a liveness detection based on the two-dimensional image;
the in-vivo detection of the target object by the target in-vivo detection mode based on the two-dimensional image comprises the following steps:
acquiring a first detection image of the target object in the two-dimensional image;
according to a second image corresponding relation between the two-dimensional image and the original two-dimensional image, combining the first detection image to obtain a third detection image of the target object in the original two-dimensional image;
performing liveness detection on the third detection image through at least one first network branch in a liveness detection network.
11. The method according to any one of claims 1 to 10, further comprising:
and under the condition that the target object is determined to be a living body based on the living body detection result, performing identity recognition on the target object according to the two-dimensional image.
12. A living body detection device, comprising:
the image acquisition module is used for acquiring a depth map and a two-dimensional image of a target object;
the detection mode determining module is used for determining a target living body detection mode based on the depth image information contained in the depth map;
and the living body detection module is used for carrying out living body detection on the target object in the target living body detection mode based on the two-dimensional image to obtain a living body detection result of the target object.
13. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any of claims 1 to 11.
14. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 11.
CN202110737711.7A 2021-06-30 2021-06-30 Living body detection method and apparatus, electronic device, and storage medium Withdrawn CN113469036A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110737711.7A CN113469036A (en) 2021-06-30 2021-06-30 Living body detection method and apparatus, electronic device, and storage medium
PCT/CN2021/126438 WO2023273050A1 (en) 2021-06-30 2021-10-26 Living body detection method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110737711.7A CN113469036A (en) 2021-06-30 2021-06-30 Living body detection method and apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN113469036A true CN113469036A (en) 2021-10-01

Family

ID=77876653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110737711.7A Withdrawn CN113469036A (en) 2021-06-30 2021-06-30 Living body detection method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN113469036A (en)
WO (1) WO2023273050A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023273050A1 (en) * 2021-06-30 2023-01-05 北京市商汤科技开发有限公司 Living body detection method and apparatus, electronic device, and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805024A (en) * 2018-04-28 2018-11-13 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN109711243A (en) * 2018-11-01 2019-05-03 长沙小钴科技有限公司 A kind of static three-dimensional human face in-vivo detection method based on deep learning
CN109871773A (en) * 2019-01-21 2019-06-11 深圳市云眸科技有限公司 Biopsy method, device and door access machine
CN111079576A (en) * 2019-11-30 2020-04-28 腾讯科技(深圳)有限公司 Living body detection method, living body detection device, living body detection equipment and storage medium
CN111582155A (en) * 2020-05-07 2020-08-25 腾讯科技(深圳)有限公司 Living body detection method, living body detection device, computer equipment and storage medium
CN112232323A (en) * 2020-12-15 2021-01-15 杭州宇泛智能科技有限公司 Face verification method and device, computer equipment and storage medium
CN113011385A (en) * 2021-04-13 2021-06-22 深圳市赛为智能股份有限公司 Face silence living body detection method and device, computer equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107590430A (en) * 2017-07-26 2018-01-16 百度在线网络技术(北京)有限公司 Biopsy method, device, equipment and storage medium
CN107832677A (en) * 2017-10-19 2018-03-23 深圳奥比中光科技有限公司 Face identification method and system based on In vivo detection
US10930010B2 (en) * 2018-05-10 2021-02-23 Beijing Sensetime Technology Development Co., Ltd Method and apparatus for detecting living body, system, electronic device, and storage medium
CN110852134A (en) * 2018-07-27 2020-02-28 北京市商汤科技开发有限公司 Living body detection method, living body detection device, living body detection system, electronic device, and storage medium
CN111382639A (en) * 2018-12-30 2020-07-07 深圳市光鉴科技有限公司 Living body face detection method and device
CN111666901A (en) * 2020-06-09 2020-09-15 创新奇智(北京)科技有限公司 Living body face detection method and device, electronic equipment and storage medium
CN113469036A (en) * 2021-06-30 2021-10-01 北京市商汤科技开发有限公司 Living body detection method and apparatus, electronic device, and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805024A (en) * 2018-04-28 2018-11-13 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN109711243A (en) * 2018-11-01 2019-05-03 长沙小钴科技有限公司 A kind of static three-dimensional human face in-vivo detection method based on deep learning
CN109871773A (en) * 2019-01-21 2019-06-11 深圳市云眸科技有限公司 Biopsy method, device and door access machine
CN111079576A (en) * 2019-11-30 2020-04-28 腾讯科技(深圳)有限公司 Living body detection method, living body detection device, living body detection equipment and storage medium
CN111582155A (en) * 2020-05-07 2020-08-25 腾讯科技(深圳)有限公司 Living body detection method, living body detection device, computer equipment and storage medium
CN112232323A (en) * 2020-12-15 2021-01-15 杭州宇泛智能科技有限公司 Face verification method and device, computer equipment and storage medium
CN113011385A (en) * 2021-04-13 2021-06-22 深圳市赛为智能股份有限公司 Face silence living body detection method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
W. GAO等: "Bimodal Face Recognition Based on Liveness Detection", 2019 IEEE 9TH ANNUAL INTERNATIONAL CONFERENCE ON CYBER TECHNOLOGY IN AUTOMATION, CONTROL, AND INTELLIGENT SYSTEMS (CYBER), pages 1197 - 1202 *
邓雄等: "人脸识别活体检测研究方法综述", 计算机应用研究, vol. 37, no. 9, pages 2579 - 2585 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023273050A1 (en) * 2021-06-30 2023-01-05 北京市商汤科技开发有限公司 Living body detection method and apparatus, electronic device, and storage medium

Also Published As

Publication number Publication date
WO2023273050A1 (en) 2023-01-05

Similar Documents

Publication Publication Date Title
EP3511864A1 (en) Method and apparatus for synthesizing virtual and real objects
US20210097715A1 (en) Image generation method and device, electronic device and storage medium
CN109889724B (en) Image blurring method and device, electronic equipment and readable storage medium
CN109584362B (en) Three-dimensional model construction method and device, electronic equipment and storage medium
CN112001321A (en) Network training method, pedestrian re-identification method, network training device, pedestrian re-identification device, electronic equipment and storage medium
CN108154466B (en) Image processing method and device
CN110944230B (en) Video special effect adding method and device, electronic equipment and storage medium
CN112991553B (en) Information display method and device, electronic equipment and storage medium
CN110569822A (en) image processing method and device, electronic equipment and storage medium
CN112184787A (en) Image registration method and device, electronic equipment and storage medium
CN114019473A (en) Object detection method and device, electronic equipment and storage medium
CN112991381B (en) Image processing method and device, electronic equipment and storage medium
CN111860373B (en) Target detection method and device, electronic equipment and storage medium
CN114088062A (en) Target positioning method and device, electronic equipment and storage medium
CN113261011A (en) Image processing method and device, electronic equipment and storage medium
WO2023273050A1 (en) Living body detection method and apparatus, electronic device, and storage medium
CN113345000A (en) Depth detection method and device, electronic equipment and storage medium
CN112860061A (en) Scene image display method and device, electronic equipment and storage medium
CN113052900A (en) Position determination method and device, electronic equipment and storage medium
CN111507131A (en) Living body detection method and apparatus, electronic device, and storage medium
CN111325786B (en) Image processing method and device, electronic equipment and storage medium
CN112330721B (en) Three-dimensional coordinate recovery method and device, electronic equipment and storage medium
CN114549983A (en) Computer vision model training method and device, electronic equipment and storage medium
CN114519794A (en) Feature point matching method and device, electronic equipment and storage medium
CN110544335B (en) Object recognition system and method, electronic device, 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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40051884

Country of ref document: HK

WW01 Invention patent application withdrawn after publication

Application publication date: 20211001

WW01 Invention patent application withdrawn after publication