Living body detection method, living body detection device, and computer-readable storage medium

文档序号:8405 发布日期:2021-09-17 浏览:31次 中文

1. A method of in vivo detection comprising:

controlling a display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors;

controlling a camera to acquire a plurality of images of a target object in a color display process;

sequencing the collected images according to a time sequence to obtain a color change sequence of the face of the target object changing along with time;

determining whether the target object meets a living condition; the in vivo conditions include at least: the color display sequence is matched with the color change sequence;

if the living body condition is met, determining that the target object is a living body;

and if the living body condition is not met, determining that the target object is a non-living body.

2. The method of claim 1, the in vivo conditions comprising at least: the color display sequence is matched with the color change sequence, and the face of the target object conforms to the three-dimensional stereo reflection characteristic.

3. The method of claim 1, controlling the display screen to display in a predetermined color display sequence, comprising:

determining whether a distance between the target object and the display screen is less than a first threshold;

and when the distance between the target object and the display screen is smaller than the first threshold value, controlling the display screen to display according to a preset color display sequence.

4. The method of claim 1, controlling the display screen to display in a predetermined color display sequence, comprising:

and controlling the display screen to sequentially display the single colors according to a preset color display sequence.

5. The method of claim 4, wherein two colors adjacent in front and back in the color display sequence have a distance in three-dimensional color space greater than a second threshold.

6. The method of claim 4, controlling the display screen to sequentially display a single color in a predetermined color display sequence, comprising:

acquiring a preset color display sequence and the brightness corresponding to each color in the sequence;

and controlling the display screen to display in sequence according to the color display sequence and the brightness corresponding to each color in the sequence.

7. The method of claim 6, wherein the absolute value of the difference in the brightness between two adjacent colors in the color display sequence is greater than a third threshold.

8. The method of claim 6, obtaining a predetermined color display sequence, comprising:

receiving a preset color display sequence sent by a server;

alternatively, a predetermined sequence of color displays is randomly generated.

9. A living body detection device comprises a control module, an acquisition module and a determination module; wherein:

the control module is used for controlling the display screen to display according to a preset color display sequence, and the color display sequence comprises at least two different colors;

the acquisition module is used for controlling the camera to acquire a plurality of images of the target object in the color display process;

the acquisition module is used for sequencing the acquired images according to a time sequence and acquiring a color change sequence of the face of the target object changing along with time;

the determining module is used for determining whether the target object meets living body conditions; the in vivo conditions were: the color display sequence is matched with the color change sequence; if the living body condition is met, determining that the target object is a living body; and if the living body condition is not met, determining that the target object is a non-living body.

10. An electronic device, comprising:

a processor; and

a memory arranged to store computer executable instructions that when executed use the processor to perform the following:

controlling a display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors;

controlling a camera to acquire a plurality of images of a target object in a color display process;

sequencing the collected images according to a time sequence to obtain a color change sequence of the face of the target object changing along with time;

determining whether the target object meets a living condition; the in vivo conditions were: the color display sequence is matched with the color change sequence;

if the living body condition is met, determining that the target object is a living body;

and if the living body condition is not met, determining that the target object is a non-living body.

11. A computer readable storage medium having one or more programs stored thereon which, when executed, perform operations comprising:

controlling a display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors;

controlling a camera to acquire a plurality of images of a target object in a color display process;

sequencing the collected images according to a time sequence to obtain a color change sequence of the face of the target object changing along with time;

determining whether the target object meets a living condition; the in vivo conditions were: the color display sequence is matched with the color change sequence;

if the living body condition is met, determining that the target object is a living body;

and if the living body condition is not met, determining that the target object is a non-living body.

Background

Currently, more and more users prefer to use a terminal such as a mobile phone to complete electronic payment. A terminal such as a mobile phone generally verifies the identity of a user before electronic payment is performed.

One common authentication method is face recognition. In the process of face recognition, there are often some lawbreakers attempting to impersonate a user to perform identity verification by using a prosthesis (for example, a picture or a video of the user), and at this time, how to determine that a detected object is a living body is a technical problem to be solved.

Disclosure of Invention

The embodiment of the specification provides a living body detection method, a living body detection device and a computer readable storage medium, so as to determine whether a detected object is a living body.

In a first aspect, there is provided a method of in vivo detection, comprising:

controlling a display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors;

controlling a camera to acquire an image of a target object in a color display process;

sequencing the collected images according to a time sequence to obtain a color change sequence of the face of the target object changing along with time;

determining whether the target object meets a living condition; the in vivo conditions include at least: the color display sequence is matched with the color change sequence;

if the living body condition is met, determining that the target object is a living body;

and if the living body condition is not met, determining that the target object is a non-living body.

In a second aspect, a living body detection apparatus is provided, which includes a control module, an acquisition module, and a determination module; wherein:

the control module is used for controlling the display screen to display according to a preset color display sequence, and the color display sequence comprises at least two different colors;

the acquisition module is used for controlling the camera to acquire a plurality of images of the target object in the color display process;

the acquisition module acquires a color change sequence of the face of the target object in the image along with time change;

the determining module is used for determining whether the target object meets living body conditions; the in vivo conditions were: the color display sequence is matched with the color change sequence; if the living body condition is met, determining that the target object is a living body; and if the living body condition is not met, determining that the target object is a non-living body.

In a third aspect, an electronic device is provided, including:

a processor; and

a memory arranged to store computer executable instructions that when executed use the processor to perform the following:

controlling a display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors;

controlling a camera to acquire a plurality of images of a target object in a color display process;

sequencing the collected images according to a time sequence to obtain a color change sequence of the face of the target object changing along with time;

determining whether the target object meets a living condition; the in vivo conditions were: the color display sequence is matched with the color change sequence;

if the living body condition is met, determining that the target object is a living body;

and if the living body condition is not met, determining that the target object is a non-living body.

In a fourth aspect, a computer-readable storage medium is provided, on which is stored one or more programs that, when executed, perform operations comprising:

controlling a display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors;

controlling a camera to acquire a plurality of images of a target object in a color display process;

sequencing the collected images according to a time sequence to obtain a color change sequence of the face of the target object changing along with time;

determining whether the target object meets a living condition; the in vivo conditions were: the color display sequence is matched with the color change sequence;

if the living body condition is met, determining that the target object is a living body;

and if the living body condition is not met, determining that the target object is a non-living body.

The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:

the method comprises the steps of displaying a display screen according to a color display sequence, acquiring a color change sequence of the face of a target object in an acquired image, and determining whether the target object is a living body or not based on the matching relation between the color display sequence and the color change sequence. If the target object is a non-living body, since the face of the target object in the image acquired for the non-living body may not exhibit a color change, in the case of the non-living body, the color display sequence and the color change sequence may not match (e.g., may not be consistent), and thus, the living body detection method provided by the embodiment of the present specification may be used to determine whether the detected object is a living body. In addition, in the living body detection process, the living body verification can be performed by the user and the detected object in a natural way without the active cooperation of the user (for example, the user makes a nod, a blink and the like to cooperate with the living body detection), so that the living body detection mode not only can reliably detect the living body, but also greatly reduces the operation burden of the user. Meanwhile, the living body detection mode does not depend on a specific terminal, and even if the image acquisition equipment is tampered, the living body detection can still be carried out, so that the reliability of the living body detection can be improved.

Drawings

FIG. 1 is a flow chart of a method for detecting a living organism provided by an embodiment of the present disclosure;

FIG. 2 is a flow chart of another method for in vivo detection provided by embodiments of the present disclosure;

fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification;

fig. 4 is a block diagram of a living body detection apparatus provided in an embodiment of the present disclosure.

Detailed Description

The embodiment of the application provides a living body detection method, a living body detection device and a computer-readable storage medium.

In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

By using the living body detection method provided by the embodiment of the specification, whether the target object is a living body or not can be detected, and the operation load of a user is greatly reduced. The in-vivo detection method provided by the embodiment of the specification can be widely applied to in-vivo detection in various identity verification scenes, such as a borrowing scene, a medical scene (for example, paying money after seeing a doctor), a riding scene (for example, riding without deposit), and the like.

The method for detecting a living body provided by the embodiment of the present disclosure may be performed by a single electronic device, which may have a camera and a display screen, for example, a mobile phone, a tablet computer, a palm computer, a desktop computer, and the like.

The technical solutions provided by the embodiments of the present invention are described in detail below with reference to the accompanying drawings.

Fig. 1 is a flowchart of a living body detection method provided in an embodiment of the present specification. Referring to fig. 1, a living body detection method provided by an embodiment of the present specification may include:

and step 110, controlling the display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors.

In the embodiments of the present specification, the colors included in the color display sequence may be various colors, for example, the colors included in the color display sequence may be red, white, blue, and black, and for example, the colors included in the color display sequence may be black, yellow, red, and white.

In this embodiment, the controlling the display screen to display according to the predetermined color display sequence in step 110 may include: and controlling the display screen to sequentially display the single colors according to a preset color display sequence. The single color display can simplify color display control and facilitate subsequent image analysis and color recognition, so that the display screen can be controlled to sequentially display the single colors in the embodiment of the specification. Of course, in the embodiments of the present specification, the display screen may also be controlled to display two or more colors at the same time. If the colors included in the color display sequence are red, white, blue and black, for example, two colors are displayed simultaneously, the display screen can be controlled to display according to the sequence of red-white, white-blue and blue-black.

In the following description, it is to be understood that references to a single color display are by way of illustration only and not intended to be limiting.

In this specification embodiment, the display screen may sequentially display a single color in the order of colors indicated by the color display sequence. For example, if the colors included in the color display sequence are red, white, blue and black, the display screen sequentially displays the four colors of red, white, blue and black.

In this embodiment, step 110 may be performed under certain trigger conditions. This trigger condition may be, for example, that the target object is located within the viewing interface of the camera and that the distance between the target object and the display screen is small. For example, this distance is less than a threshold, hereinafter referred to as a first threshold. The first threshold may be set as desired, for example, the first threshold is 30 cm, 40 cm, or the like.

In the embodiments of the present specification, the target object is an object to be subjected to living body detection, such as a person, a photograph of the person, a video of the person, or the like. After the living body detection starts, the camera of the terminal can be started to collect the image of the target object. If the image of the target object is not acquired, a prompt, for example, "please go to the front of the terminal for image acquisition", may be displayed on the display screen, and a sound may be played through the speaker. If an image of the target object is captured, it may be further determined whether a distance between the target object and the display screen is less than a first threshold (e.g., 30 cm), and if the distance between the target object and the display screen is not less than the first threshold, a prompt may be displayed on the display screen, e.g., "please approach the terminal for detection", and a sound may be played through the speaker. If the distance between the target object and the display screen is less than the first threshold, step 110 may be executed to control the display screen to display according to a predetermined color display sequence, so that the light emitted through the display screen is irradiated on the face of the target object. In the embodiment of the specification, before controlling the display screen to display the color, it is determined whether the distance between the target object and the display screen is smaller than a first threshold, so that, under the condition that the distance between the target object and the display screen is large, since the light emitted by the display screen is likely to be unable to irradiate on the face of the target object, at this time, the display screen may be controlled not to display the color temporarily, so as to avoid invalid display of the display screen. Under the condition that the distance between the target object and the display screen is small, the display screen is controlled to display according to the preset color display sequence, and light rays emitted by the display screen can be ensured to irradiate the face of the target object, so that the follow-up acquisition of images of the target object is facilitated, and the color display of the display screen can be ensured to be more targeted and effective.

In one embodiment of the present description, controlling the display screen to sequentially display the single colors according to the predetermined color display sequence may specifically include: acquiring a preset color display sequence; acquiring the brightness corresponding to each color in the color display sequence; and controlling the display screen to sequentially display a single color according to the color sequence indicated by the color display sequence and the brightness corresponding to each color in the color display sequence. It is known to the person skilled in the art that the above described steps may also be performed for each of a plurality of colors in case the display screen displays the plurality of colors simultaneously in a color display sequence.

In the embodiments of the present specification, the electronic device may have a communication function of communicating with a remote server. In this case, the electronic device may specifically acquire the predetermined color display sequence by receiving the predetermined color display sequence from the server by the terminal. Specifically, the electronic device may send a color display sequence acquisition request to the server, and after receiving the color display sequence acquisition request, the server may generate a color display sequence and send the color display sequence to the electronic device through a message. In this way, the electronic device can acquire the predetermined color display sequence by receiving a message from the server. The color sequence acquisition mode can enable the color displayed on the display screen of the electronic equipment to be controlled by the server.

Optionally, in this embodiment of the present specification, the electronic device may also have no communication function for communicating with a remote server. At this time, the electronic device may obtain the predetermined color display sequence, specifically, the electronic device randomly generates the predetermined color display sequence. That is, in such a case, the electronic device may actively generate the predetermined color display sequence without interacting with the server to obtain the color display sequence. The color sequence acquisition mode can enable the electronic equipment not to have a communication function, thereby reducing the cost of the terminal.

Alternatively, in this specification embodiment, the two colors adjacent to each other in the color display sequence may be colors whose distance between the two colors in the three-dimensional color space is greater than the second threshold value. The three-dimensional color space may be a red, green, and blue (RGB) space, and each color may be represented by an RGB value in the three-dimensional color space, and the RGB value may correspond to a point in the three-dimensional color space. Thus, each color will find a point in the three-dimensional color space corresponding to it. For two colors adjacent to each other in the color display sequence, the distance between the two colors can be calculated by determining the corresponding point of each of the two colors in the three-dimensional color space, and the distance can be compared with the second threshold. Here, the second threshold value may be set as needed.

After acquiring a predetermined color display sequence, the display screen may be controlled to display in the color order indicated by the color display sequence, for example, to display a single color in turn, so that the light emitted through the display screen is irradiated on the face of the target object. Of course, in this embodiment of the present specification, the brightness corresponding to each color in the color display sequence may also be obtained, and the display screen is controlled to display the brightness corresponding to each color in the color display sequence according to the color sequence indicated by the color display sequence, for example, sequentially display a single color.

In order to ensure that the color superimposed on the face can be determined quickly subsequently according to the acquired image of the target object, in an embodiment of the present specification, the obtaining the brightness corresponding to each color in the color display sequence may specifically include: determining the darkness of the ith color in the color display sequence, wherein i is a positive integer; determining the lightness of the (i + 1) th color in the color display sequence based on the lightness of the (i) th color such that a difference between the lightness of the (i) th color and the lightness of the (i + 1) th color is greater than a third threshold. Therefore, the brightness of two adjacent colors is closely related, so that the acquired image effect of the target object can be better ensured, and the color superposed on the face can be quickly determined.

Step 120, collecting an image of the target object in the color display process.

In the embodiments of the present description, during the display of the display screen of the electronic device in the order indicated by the color display sequence (e.g., displaying a single color in sequence), the camera of the electronic device may be controlled to capture an image of the target object. In the embodiment of the present specification, the captured image of the target object may be a video frame image, or may be a plurality of images (i.e., discontinuous images) captured at different time instants (time points). That is, one image of the target object may be taken at one time. In this specification embodiment, when the captured image of the target object is a video frame image, the time when the display screen of the electronic device displays in a color display sequence (for example, displays a single color in sequence) may be the same as the time when the video frame image is captured. Once the display screen stops displaying, accordingly, the acquisition of the video frame image of the target object may also be stopped. Of course, the time for capturing the video frame images may also be less than the time for displaying the display screen according to the color display sequence. When the acquired image of the target object is a plurality of images shot at different moments for the target object, the target object can be shot to acquire an image at a certain moment in the process of displaying the target object on a display screen of the electronic device according to the color display sequence. Once the display screen stops displaying, accordingly, photographing of the target object may also be stopped.

In this specification, the video frame image may indicate that the captured image is a continuous multi-frame image.

Since the light emitted through the display screen may be irradiated on the face of the target object, if the target object is a living body, the face of the target object in the acquired image may exhibit a certain color of light. Whereas if the target object is not a living body, the face of the target object in the captured image may not exhibit a certain color of light.

Step 130, acquiring a color change sequence of the face of the target object in the image along with the change of time.

The step 130 of obtaining the color change sequence of the face of the target object in the image along with the time change may specifically be: analyzing a face image of the target object in the image (e.g., a video frame image or a photograph taken at each different point in time) to obtain a color superimposed on the face; and sequencing the acquired colors according to a time sequence to obtain a color change sequence of the face of the target object in the image along with time. The embodiment of the specification can obtain the color change sequence of the face of the target object along with time by analyzing the face image of the target object in the image. The color change sequence is obtained simply, conveniently and quickly, and the accuracy is relatively high. Taking a video frame image as an example, for one frame image, if the color superimposed on the face obtained by analyzing the face image of the target object in the frame image is red, and the colors superimposed on the face obtained by analyzing the subsequent frame image are blue and green, the color change sequence of the face of the target object in the video frame image with time change can be obtained as red, blue and green.

And step 140, determining whether the target object is a living body or not based on the matching relation between the color display sequence and the color change sequence.

The matching relationship mentioned in the embodiments of the present specification may include matching and mismatching, in which the criterion of matching may be determined as necessary. For example, if the color display sequence is identical to the color change sequence, the two can be determined to match, otherwise, the two are not matched. As another example, the criteria for matching may be determined based on a threshold. For example, if the color display sequence and the color change sequence have more than a preset percentage (e.g., 80% or 90%) of the same portion of the color, the two may be determined to match, and otherwise, the two are not matched.

In the present specification embodiment, if the color display sequence matches (e.g., coincides with) the color change sequence, it may be determined that the target object is a living body; if the color display sequence does not match (e.g., does not coincide with) the color change sequence, the target object may be determined to be non-living. For example, if the color display sequence is red, white, blue, and black and the color change sequence is red, white, blue, and black, it can be known that the color display sequence coincides with the color change sequence, and the target object is determined to be a living body. For example, if the color display sequence is red, white, blue, and black and the color change sequence is red, blue, black, and white, it is known that the color display sequence does not coincide with the color change sequence, and the target object is determined to be a non-living body. Examples of non-living objects may be pictures, videos, and the like.

In the embodiments of the present specification, it is possible to determine whether the target object is a living body by comparing whether the color display sequence matches the color change sequence. In some embodiments, it may also be possible to further perform image analysis to further determine whether the target object is a living body, rather than directly determining that the target object is a living body in the case where the color display sequence matches the color change sequence. In one embodiment of the present specification, if the color display sequence matches the color change sequence, it may be further determined whether a facial image of the target object in the image (e.g., a video frame image or a photograph taken at various different points in time) conforms to a three-dimensional stereoscopic reflection characteristic; if the face image of the target object in the image accords with the three-dimensional stereo reflection characteristic, determining that the target object is a living body; if the face of the target object in the image does not conform to the three-dimensional stereoscopic reflection characteristics, for example, the face of the target object in the image is a partially specular reflected image, the target object may be determined to be a non-living body. In the embodiments of the present specification, due to the shape and skin characteristics of the face, the reflection characteristics of the light on the face may include: the diffuse reflection characteristic of the facial skin to light rays enables the reflected color light rays to be uniformly distributed in most areas of the face; secondly, because the face is three-dimensional, shadow (such as around the nose bridge) appears in partial area of the face due to occlusion. Thus, in determining whether the face image of the target object in the image (e.g., a video frame image or a photograph taken at various different time points) conforms to the three-dimensional stereoscopic reflection characteristic, if the colors of the image of a large area of the face are uniformly distributed while a certain portion (e.g., a nose bridge portion) is shaded around, it may be determined that the face image of the target object in the image conforms to the three-dimensional stereoscopic reflection characteristic; on the contrary, if the colors of the image of the majority of the face are not uniformly distributed or there is no shadow around a specific portion (e.g., a nose bridge portion), it may be determined that the face image of the target object in the image does not conform to the three-dimensional stereoscopic reflection characteristic.

In the living body detection method provided in the embodiment of the present specification, a display screen performs color display according to a sequence of a color display sequence, obtains a color change sequence of a face of a target object in an acquired image, and determines whether the target object is a living body based on a matching relationship between the color display sequence and the color change sequence. If the target object is a non-living body, the face of the target object in the image acquired for the non-living body may not show a color change, and therefore, in the case of the non-living body, the color display sequence and the color change sequence may not be consistent, and therefore, whether the detected object is a living body can be determined by using the living body detection method provided by the embodiment of the present specification. In addition, in the living body detection process, the living body verification can be performed by the user and the detected object in a natural way without the active cooperation of the user (for example, the user makes a nod, a blink and the like to cooperate with the living body detection), so that the living body detection mode not only can reliably detect the living body, but also greatly reduces the operation burden of the user.

Meanwhile, the living body detection mode provided by the embodiment of the specification does not depend on a specific image acquisition device, and the living body detection can be still carried out even if the image acquisition device is tampered, so that the reliability of the living body detection can be improved.

Fig. 2 is a flowchart of a living body detection method provided in an embodiment of the present specification. It should be understood that fig. 2 is only illustrative of the case where the display screen sequentially displays a single color in a predetermined color display sequence. Meanwhile, it should be understood that the relevant contents of the steps described in fig. 2 can refer to the foregoing description. Referring to fig. 2, a living body detection method provided by an embodiment of the present specification may include:

and step 210, starting the camera and starting the living body detection.

This step may be performed in the event of a triggered operation. For example, the terminal displays the screen to indicate whether to start authentication, and the user clicks the "yes" option to execute the authentication. The embodiments of this specification do not limit the operation of triggering the execution step 210. The trigger operation may be a click operation, a double click operation, or an operation of drawing a specified graphic, etc.

After the camera is started, the image of the target object can be acquired. If the image of the target object is not acquired, a prompt, for example, "please go to the front of the terminal for image acquisition", may be displayed on the display screen, and a sound may be played through the speaker. If an image of the target object is acquired, the distance between the target object and the display screen may be further determined.

Step 220, determining whether the distance between the target object and the display screen is less than a first threshold.

The first threshold may be selected as needed, for example, the first threshold is 30 cm or 40 cm.

And 230, when the distance between the target object and the display screen is smaller than the first threshold value, controlling the display screen to sequentially display a single color according to a preset color display sequence, so that the light emitted by the display screen is irradiated on the face of the target object.

Wherein controlling the display screen to sequentially display a single color according to a predetermined color display sequence may include: acquiring a preset color display sequence; acquiring the brightness corresponding to each color in the color display sequence; and controlling the display screen to sequentially display a single color according to the color sequence indicated by the color display sequence and the brightness corresponding to each color in the color display sequence.

Wherein obtaining the predetermined color display sequence may include: receiving the predetermined color display sequence from a server; alternatively, the predetermined color display sequence is randomly generated. Here, the two colors adjacent to each other in the color display sequence may be colors whose distance between the two colors in the three-dimensional color space is larger than a second threshold value.

Wherein, obtaining the brightness corresponding to each color in the color display sequence may include: determining the darkness of the ith color in the color display sequence, wherein i is a positive integer; determining the lightness of the (i + 1) th color in the color display sequence based on the lightness of the (i) th color such that a difference between the lightness of the (i) th color and the lightness of the (i + 1) th color is greater than a third threshold.

Step 240, in the color display process, an image of the target object is acquired.

In this embodiment, the image collected for the target object may be a video frame image or a photograph taken at different time points.

Step 250, acquiring a color change sequence of the face of the target object in the image along with the change of time.

In step 250, the acquiring a color change sequence of the face of the target object over time in the image may specifically include: analyzing a face image of the target object in the image to obtain a color superimposed on the face; and sequencing the acquired colors according to a time sequence to obtain a color change sequence of the face of the target object in the image along with time.

Step 260, determining whether the color display sequence is consistent with the color change sequence. If yes, go to step 270; if not, step 290 is performed.

Step 270, if the color display sequence is consistent with the color change sequence, determining whether the facial image of the target object in the image conforms to the three-dimensional stereo reflection characteristic.

If the facial image of the target object in the image conforms to the three-dimensional stereo reflection characteristic, executing step 280; if the face of the target object in the image does not conform to the three-dimensional stereo reflection characteristics, step 290 is performed.

Step 280, determining the target object to be a living body.

Step 290, determining the target object as a non-living body.

According to the living body detection method provided by the embodiment of the invention, the display screen displays colors according to the sequence of the color display sequence, the color change sequence of the face of the target object in the acquired image is acquired, and when the color display sequence is consistent with the color change sequence, the target object can be determined to be a living body. In the process, the user and the detected object can perform living body verification in a natural mode without the need of actively making actions such as nodding and blinking in coordination with living body detection, so that the living body detection mode not only can reliably detect the living body, but also greatly reduces the operation burden of actively coordinating the user.

Meanwhile, the living body detection mode does not depend on a specific terminal, and even if the image acquisition equipment is tampered, the living body detection can still be carried out, so that the reliability of the living body detection can be improved.

It will be appreciated by those skilled in the art that the two colors adjacent to each other in the color display sequence may be colors having a distance between them in the three-dimensional color space greater than a second threshold value. In an alternative implementation, the color display sequence may only include black and white, where the black and white in the color display sequence may be alternately set, so that the light emitted through the display screen may be irradiated on the face of the target object. Subsequently, in determining whether the target object is a living body, the order of color display on the display screen may also be compared with the order of color change of the face of the target object in an image (e.g., a video frame image or a photograph taken at various different points in time), and if the two coincide, it may be determined that the target object is a living body. Of course, in a possible implementation, it may also be determined whether the face image of the target object in the image conforms to the three-dimensional stereoscopic reflection characteristic, instead of directly determining that the target object is a living body in a case where the order of color display on the display screen matches the order of color change of the face of the target object in the image, and if the face image of the target object in the image conforms to the three-dimensional stereoscopic reflection characteristic, determining that the target object is a living body; and determining the target object as a non-living body if the face image of the target object in the image does not conform to the three-dimensional stereo reflection characteristic.

Fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. Referring to fig. 3, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.

The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 3, but this does not indicate only one bus or one type of bus.

And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.

The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs. A processor executing the program stored in the memory and executing any of the above-described biopsy methods, for example the processor may be specifically configured to: controlling a display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors; acquiring an image of a target object in a color display process; acquiring a color change sequence of the face of the target object in the image along with time change; and determining whether the target object is a living body or not based on the matching relation of the color display sequence and the color change sequence.

The method performed by the electronic device according to the embodiment shown in fig. 3 of the present application may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.

The electronic device may also perform the functions of the embodiment shown in fig. 2, which is not described herein again.

Of course, besides the software implementation, the electronic device of the present application does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.

Embodiments of the present application also provide a computer-readable storage medium storing one or more programs, where the one or more programs include instructions, which when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to perform the method of the embodiment shown in fig. 1, and are specifically configured to: controlling a display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors; acquiring an image of a target object in a color display process; acquiring a color change sequence of the face of the target object in the image along with time change; and determining whether the target object is a living body or not based on the matching relation of the color display sequence and the color change sequence.

The computer-readable storage medium provided by the embodiments of the present specification may be a non-transitory computer-readable storage medium. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.

The electronic device and the computer-readable storage medium provided in the embodiments of the present specification enable a display screen to perform color display in an order of a color display sequence, acquire a color change sequence of a face of a target object in a captured image, and determine whether the target object is a living body based on a matching relationship between the color display sequence and the color change sequence. If the target object is a non-living body, the face of the target object in the image acquired for the non-living body may not show a color change, and therefore, in the case of the non-living body, the color display sequence and the color change sequence may not be consistent, and therefore, whether the detected object is a living body can be determined by using the living body detection method provided by the embodiment of the present specification. In addition, in the living body detection process, the living body verification can be performed by the user and the detected object in a natural way without the active cooperation of the user (for example, the user makes a nod, a blink and the like to cooperate with the living body detection), so that the living body detection mode not only can reliably detect the living body, but also greatly reduces the operation burden of the user.

Meanwhile, the living body detection mode does not depend on a specific terminal, and even if the image acquisition equipment is tampered, the living body detection can still be carried out, so that the reliability of the living body detection can be improved.

Fig. 4 is a block diagram of a living body detecting apparatus provided in an embodiment of the present specification. Referring to fig. 4, a living body detecting device 400 provided by the embodiments of the present specification may include: a control module 410, an acquisition module 420, an acquisition module 430, and a determination module 440. Wherein:

the control module 410 is used for controlling the display screen to display according to a preset color display sequence, wherein the color display sequence comprises at least two different colors;

the acquisition module 420 is used for acquiring an image of the target object in the color display process;

an obtaining module 430, configured to obtain a color change sequence of the face of the target object in the image collected by the collecting module 320 over time;

a determining module 440, configured to determine whether the target object is a living body based on a matching relationship between the color display sequence and the color change sequence acquired by the acquiring module 430.

According to the living body detection method provided by the embodiment of the invention, the display screen displays colors according to the sequence of the color display sequence, the color change sequence of the face of the target object in the collected image is obtained, and whether the target object is a living body is determined based on the matching relation between the color display sequence and the color change sequence. If the target object is a non-living body, the face of the target object in the image acquired for the non-living body may not show a color change, and therefore, in the case of the non-living body, the color display sequence and the color change sequence may not be consistent, and therefore, whether the detected object is a living body can be determined by using the living body detection method provided by the embodiment of the present specification. In addition, in the living body detection process, the living body verification can be carried out on the user and the detected object in a natural mode without active cooperation of the user (for example, the user makes a head nod, a blink and other actions to cooperate with the living body detection), so that the living body detection mode not only can detect the living body, but also greatly reduces the operation burden of the user.

Meanwhile, the living body detection mode does not depend on a specific terminal, and even if the image acquisition equipment is tampered, the living body detection can still be carried out, so that the reliability of the living body detection can be improved.

Optionally, in an embodiment of the present specification, the determining module 440 is specifically configured to: determining that the target object is a living body if the color display sequence matches the color change sequence; determining that the target object is not a living object if the color display sequence does not match the color change sequence.

Alternatively, in an embodiment of the present specification, if the color display sequence matches the color change sequence, the determining module 440 may further determine whether a facial image of the target object in the image conforms to a three-dimensional stereo reflection characteristic, rather than directly determining that the target object is a living body; if so, the target object is determined to be a living body.

Optionally, in an embodiment of the present specification, the control module 410 may be specifically configured to: and controlling the display screen to sequentially display the single colors according to a preset color display sequence.

Optionally, in an embodiment of the present specification, before the control module 410 controls the display screen to sequentially display a single color according to a predetermined color display sequence, the determination module 440 may be specifically configured to: determining whether a distance between the target object and the display screen is less than a first threshold.

Accordingly, the control module 410 may be specifically configured to: and when the distance between the target object and the display screen is smaller than the first threshold value, controlling the display screen to sequentially display a single color according to a preset color display sequence, so that the light emitted by the display screen is irradiated on the face of the target object.

Optionally, in an embodiment of the present specification, the control module 410 may be specifically configured to:

acquiring a preset color display sequence;

acquiring the brightness corresponding to each color in the color display sequence;

and controlling the display screen to sequentially display a single color according to the color sequence indicated by the color display sequence and the brightness corresponding to each color in the color display sequence.

Optionally, in an embodiment of the present specification, when obtaining the brightness corresponding to each color in the color display sequence, the control module 410 may be specifically configured to:

determining the darkness of the ith color in the color display sequence, wherein i is a positive integer;

determining the lightness of the (i + 1) th color in the color display sequence based on the lightness of the (i) th color such that a difference between the lightness of the (i) th color and the lightness of the (i + 1) th color is greater than a third threshold.

In the embodiment of the present specification, the two colors adjacent to each other in the color display sequence may be colors whose distance between the two colors in the three-dimensional color space is greater than the second threshold value.

In the embodiments of the present specification, the colors included in the color display sequence may be black and white.

Optionally, in an embodiment of the present specification, in acquiring a color change sequence of the face of the target object changing with time in the image, the acquiring module 430 may be specifically configured to: analyzing a face image of the target object in the image to obtain a color superimposed on the face; and sequencing the acquired colors according to a time sequence to obtain a color change sequence of the face of the target object in the image along with time.

Optionally, in an embodiment of the present specification, when obtaining the predetermined color display sequence, the control module 410 may be specifically configured to: receiving the predetermined color display sequence from a server; alternatively, the predetermined color display sequence is randomly generated.

In short, the above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

The apparatuses, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or implemented by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.

It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种人脸和二维码自动混合识别的方法、装置及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!