Face recognition method and device

By combining RGB images and depth images to determine the distance difference between the interfering face and the target face, the accuracy problem of face recognition in multiple face scenes is solved, and safe and accurate face recognition in multi-person scenes is achieved. .

CN111832535BActive Publication Date: 2024-09-06ADVANCED NEW TECHNOLOGIES CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202010729662.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-08-24
Publication Date
2024-09-06
Estimated Expiration
2038-08-24

AI Technical Summary

Technical Problem

In multiple face scenarios, existing face recognition technology is difficult to accurately identify target faces, resulting in recognition failures or errors, affecting user safety and property.

Method used

By combining RGB images and depth images, it is determined whether the distance difference between the interfering face and the target face to the image acquisition device is less than the preset threshold, and whether there is an interfering face, thereby avoiding missed detection and accurately identifying the target face.

Benefits of technology

It effectively avoids the missed detection of faces in RGB images, ensuring the accuracy and safety of face recognition, especially in multi-person scenarios such as face-swiping payments, reducing the risk of false deductions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111832535B
    Figure CN111832535B
Patent Text Reader

Abstract

The embodiments of this specification provide a face recognition method and device, the method comprising: obtaining an RGB image and a corresponding depth image for face recognition; selecting a target face from the RGB image; judging whether there is an interfering face in the RGB image based on the target face and the depth image; if not, performing face recognition based on the target face. In the embodiments of this specification, when performing face recognition on an RGB image containing multiple faces, the face used for face recognition in the RGB image can be determined in combination with the corresponding depth image. Since the depth image contains relatively rich information, and the depth image can reflect the distance from each face in the depth image to the image acquisition device, and the distance from the face to the image acquisition device can reflect the user's face recognition intention to a certain extent, the embodiments of this specification can avoid missing faces in the RGB image and accurately determine the faces used for face recognition in the RGB image.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This invention patent application is a divisional application of the Chinese invention patent application with application date of August 24, 2018, application number 201810972167.2 and name “Face Recognition Method and Device”. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a face recognition method and device. Background Art

[0003] In recent years, with the development of face recognition technology, more and more scenarios can be applied to face scanning, such as face scanning payment, face scanning clocking in, face scanning door unlocking, face scanning authentication, etc., which has the characteristics of convenient and fast operation. However, when there are multiple faces in the RGB image used for face scanning, it is difficult to determine which face in the RGB image to recognize, which leads to recognition failure or recognition error, causing losses to users. Therefore, a face recognition method needs to be proposed. Summary of the invention

[0004] The purpose of the embodiments of this specification is to provide a face recognition method and device, and the embodiments of this specification are implemented as follows:

[0005] In a first aspect, a face recognition method is provided, the method comprising:

[0006] Acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face;

[0007] Select a target face from the RGB image;

[0008] According to the target face and the depth image, determine whether there is an interfering face in the RGB image, and the difference between the distance from the interfering face to the face image acquisition device and the distance from the target face to the face image acquisition device is less than a preset threshold;

[0009] If the interfering face does not exist in the RGB image, face recognition is performed based on the target face.

[0010] In a second aspect, a face recognition device is provided, the device comprising:

[0011] An acquisition module, used to acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face;

[0012] A selection module, used for selecting a target face from the RGB image;

[0013] A judgment module, used to judge whether there is an interfering face in the RGB image according to the target face and the depth image, and the difference between the distance from the interfering face to the face image acquisition device and the distance from the target face to the face image acquisition device is less than a preset threshold;

[0014] A recognition module is used to perform face recognition based on the target face when the interfering face does not exist in the RGB image.

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

[0016] Processor; and

[0017] a memory arranged to store computer executable instructions which, when executed, cause the processor to:

[0018] Acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face;

[0019] Select a target face from the RGB image;

[0020] According to the target face and the depth image, determine whether there is an interfering face in the RGB image, and the difference between the distance from the interfering face to the face image acquisition device and the distance from the target face to the face image acquisition device is less than a preset threshold;

[0021] If the interfering face does not exist in the RGB image, face recognition is performed based on the target face.

[0022] In a fourth aspect, a computer storage medium is provided, wherein the computer readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including a plurality of application programs, the electronic device performs the following operations:

[0023] Acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face;

[0024] Select a target face from the RGB image;

[0025] According to the target face and the depth image, determine whether there is an interfering face in the RGB image, and the difference between the distance from the interfering face to the face image acquisition device and the distance from the target face to the face image acquisition device is less than a preset threshold;

[0026] If the interfering face does not exist in the RGB image, face recognition is performed based on the target face.

[0027] It can be seen from the technical solutions provided in the above embodiments of this specification that in the embodiments of this specification, when performing face recognition on an RGB image containing multiple faces, the depth image corresponding to the RGB image can be combined to determine the face used for face recognition in the RGB image. Compared with face recognition based only on RGB images, in the embodiments of this specification, since the information contained in the depth image is relatively rich, and the depth image can reflect the distance from each face in the depth image to the image acquisition device, and the distance from the face to the image acquisition device can reflect the user's face recognition intention to a certain extent, the embodiments of this specification can avoid missing faces in the RGB image, and can more accurately determine the faces used for face recognition in the RGB image. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0029] Figure 1 is a flow chart of a face recognition method according to an embodiment of the present specification;

[0030] Figure 2 is a flow chart of a face recognition method according to another embodiment of the present specification;

[0031] Figure 3 is a structural schematic diagram of a face recognition device according to an embodiment of the present specification;

[0032] Figure 4 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present specification. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0034] The embodiments of this specification provide a face recognition method and device.

[0035] The following first introduces a face recognition method provided by an embodiment of this specification.

[0036] It should be noted that the face recognition method provided in the embodiments of this specification is applicable to electronic devices. In actual applications, the electronic device may be a server, or the electronic device may be a terminal device such as a mobile phone, a tablet computer, a personal digital assistant, or a computer device such as a laptop computer, a desktop computer, etc. The embodiments of this specification do not limit this.

[0037] Figure 1 is a flow chart of a face recognition method according to an embodiment of the present specification. Figure 1 As shown, the method may include the following steps: step 102, step 104, step 106 and step 108, wherein:

[0038] In step 102, an RGB image and a corresponding depth image for face recognition are obtained, wherein the RGB image contains at least one face.

[0039] In the embodiments of this specification, the RGB image (color image) and the corresponding depth image used for face recognition are images taken for the same scene. The grayscale value of each pixel in the depth image can be used to characterize the distance from a certain point in the shooting scene to the depth image acquisition device. The device used to acquire the depth image is called the depth image acquisition device, and the device used to acquire the RGB color image is called the RGB image acquisition device.

[0040] In step 104, a target face is selected from the RGB image.

[0041] In the embodiment of this specification, the target face image is the face in the RGB image that is most likely to be used for face recognition.

[0042] In the embodiment of the present specification, face detection can be performed on the RGB image to detect the faces contained therein and select a face from the RGB image as the target face. Specifically, a face in a preset area of ​​the RGB image can be selected as the target face.

[0043] Considering that users with the intention of face recognition usually face the focus of the image acquisition device or are in the middle of the crowd, based on this situation, in the embodiments of this specification, the preset area may include: the central area of ​​the RGB image, or the focus area when the RGB image is taken. Accordingly, the face in the central area of ​​the RGB image can be selected as the target face; or the face in the focus area when the RGB image is taken can be selected as the target face.

[0044] In step 106, based on the target face and the depth image, determine whether there is an interfering face in the RGB image; if not, execute step 108; wherein the difference between the distance from the interfering face to the face image acquisition device and the distance from the target face to the face image acquisition device is less than a preset threshold.

[0045] In the embodiments of this specification, the face image acquisition device refers to a depth image acquisition device. The distances from the interference face and the target face to the depth image acquisition device are equal or similar.

[0046] Taking into account that users with face recognition intentions are usually closer to the image acquisition device, and in a multi-person scenario, there is usually only one user with face recognition intentions, based on this situation, in an embodiment of the present specification, by judging whether there are interfering faces in the RGB image, it is determined whether the target face is the face with the greatest face recognition intention in the multi-person scenario; specifically, if there are interfering faces in the RGB image, it indicates that the target face is not the face with the greatest face recognition intention in the multi-person scenario; if there are no interfering faces in the RGB image, it indicates that the target face is the face with the greatest face recognition intention in the multi-person scenario.

[0047] Taking into account that face detection on RGB images may sometimes result in missed faces, for example, a face in the corner of an RGB image or half a face in an RGB image cannot be detected. Based on this situation, in an embodiment of the present specification, an RGB image and a depth image corresponding to the RGB image are used to avoid the above-mentioned missed detection problem.

[0048] In step 108, face recognition is performed based on the target face.

[0049] In the embodiment of the present specification, if there is no interfering face in the RGB image, face recognition is performed based on the target face in the RGB image; if there is an interfering face in the RGB image, a prompt message is output, and the prompt message is used to prompt that there is an interfering face in the RGB image.

[0050] For ease of understanding, the technical solution of the embodiments of this specification is illustrated by taking the "face payment" scenario as an example.

[0051] "Face-swiping payment" is a payment method based on facial recognition. It has become one of the main means of payment in offline consumption scenarios, with the characteristics of convenient operation and good experience. With the development of facial recognition technology, "face-swiping payment" no longer requires users to enter other identity information (such as mobile phone number, account number) to complete payment behavior, that is, users only need to swipe their faces to complete the payment behavior directly. For the above face-swiping process, it has a risk problem: when there are multiple faces in the screen used for face-swiping, it is difficult to confirm which user in the screen is willing to make a payment. At this time, money may be deducted by mistake. If this happens, financial losses will occur, which will have a greater impact on the integrity of "face-swiping payment".

[0052] Taking into account the gradual development of camera hardware, offline payment scenarios are usually equipped with depth image acquisition devices, and the depth image collected by the depth image acquisition device can represent the distance of each object from the camera. Based on this situation, in the embodiments of this specification, the RGB image and the corresponding depth image used for "face payment" can be obtained, the face in the RGB image can be detected, and the possible payment user face (i.e., the target face) can be selected; then, based on the selected face and depth image, it is determined whether there is an interfering face in the RGB image. If there is an interfering face in the RGB image, it is considered that there is a risk that multiple faces cannot be confirmed in this payment transaction, and the user is prompted about the risk and asked to enter the relevant account information again for confirmation; if there is no interfering face in the RGB image, it is considered that this payment transaction is relatively safe, and recognition is performed based on the selected face, and payment is made after the recognition is passed.

[0053] As can be seen from the above embodiments, in this embodiment, when performing face recognition on an RGB image containing multiple faces, the depth image corresponding to the RGB image can be combined to determine the face used for face recognition in the RGB image. Compared with performing face recognition based only on the RGB image, in the embodiment of this specification, since the information contained in the depth image is relatively rich, and the depth image can reflect the distance between each face in the depth image and the image acquisition device, and the distance between the face and the image acquisition device can reflect the user's face recognition intention to a certain extent, the embodiment of this specification can avoid missing the face in the RGB image, and can more accurately determine the face used for face recognition in the RGB image.

[0054] Figure 2 is a flow chart of a face recognition method according to another embodiment of the present specification. In the embodiment of the present specification, the distance between the target face and the image acquisition device can be calculated first, and then the distance and depth image calculated can be used to determine whether there is an interfering face in the RGB image. Figure 2 As shown, the method may include the following steps:

[0055] In step 202, an RGB image and a corresponding depth image for face recognition are obtained, wherein the RGB image contains at least one face.

[0056] In the embodiments of this specification, the RGB image (color image) and the corresponding depth image used for face recognition are images taken for the same scene. The grayscale value of each pixel in the depth image can be used to characterize the distance from a certain point in the shooting scene to the depth image acquisition device. The device used to acquire the depth image is called the depth image acquisition device, and the device used to acquire the RGB color image is called the RGB image acquisition device.

[0057] In step 204, a target face is selected from the RGB image.

[0058] In the embodiment of this specification, the target face image is the face in the RGB image that is most likely to be used for face recognition.

[0059] In the embodiment of the present specification, face detection can be performed on the RGB image to detect the faces contained therein and select a face from the RGB image as the target face. Specifically, a face in a preset area of ​​the RGB image can be selected as the target face.

[0060] Considering that users with the intention of face recognition usually face the focus of the image acquisition device or are in the middle of the crowd, based on this situation, in the embodiments of this specification, the preset area may include: the central area of ​​the RGB image, or the focus area when the RGB image is taken. Accordingly, the face in the central area of ​​the RGB image can be selected as the target face; or the face in the focus area when the RGB image is taken can be selected as the target face.

[0061] In step 206, a target area corresponding to the target face in the depth image is determined.

[0062] Taking into account that the camera of the RGB image acquisition device and the camera of the depth image acquisition device are pre-calibrated, that is, the two have a clear spatial coordinate transformation relationship, based on this situation, in the embodiment of this specification, the coordinates of the target face on the depth image (that is, the target area) can be determined according to the spatial coordinate transformation relationship between the RGB image and its corresponding depth image.

[0063] In step 208, the distance D1 from the target face to the face image acquisition device is calculated based on the information of the pixel points in the target area.

[0064] Since each pixel in the depth image represents a distance, in the embodiments of the present specification, the distance D1 from the target face to the facial image acquisition device can be calculated based on the information of the pixel points in the target area; specifically, the distance from each pixel point in the target area to the facial image acquisition device can be calculated, and the average value of the distance from each pixel point to the facial image acquisition device can be determined as the distance D1 from the target face to the facial image acquisition device.

[0065] In step 210, it is determined whether there is a face at a distance D2 from the face image acquisition device in the depth image; if not, step 212 is executed; wherein the difference between D1 and D2 is less than a preset threshold.

[0066] In the embodiment of the present specification, if there is a face at a distance D2 from the face image acquisition device in the depth image, then there is an interfering face in the RGB image; if there is no face at a distance D2 from the face image acquisition device in the depth image, then it is determined that there is no interfering face in the RGB image.

[0067] In the embodiments of this specification, the face image acquisition device refers to a depth image acquisition device. The distances from the interference face and the target face to the depth image acquisition device are equal or similar.

[0068] In the embodiment of the present specification, the face in the depth image that is at a distance D2 from the face image acquisition device includes: a face with a complete and clear outline, or a face with an incomplete and unclear outline.

[0069] Taking into account that users with face recognition intentions are usually closer to the image acquisition device, and in a multi-person scenario, there is usually only one user with face recognition intentions, in the embodiments of the present specification, by judging whether there are interfering faces in the RGB image, it is determined whether the target face is the face with the greatest face recognition intention in the multi-person scenario; specifically, if there are interfering faces in the RGB image, it indicates that the target face is not the face with the greatest face recognition intention in the multi-person scenario; if there are no interfering faces in the RGB image, it indicates that the target face is the face with the greatest face recognition intention in the multi-person scenario.

[0070] Considering that face detection on RGB images may sometimes result in missed faces, for example, a face in the corner of an RGB image or half a face in an RGB image cannot be detected, in the embodiments of this specification, an RGB image and a depth image corresponding to the RGB image are used to avoid the above-mentioned missed detection problem.

[0071] In step 212, face recognition is performed based on the target face.

[0072] In the embodiment of the present specification, if there is no interfering face in the RGB image, face recognition is performed based on the target face in the RGB image; if there is an interfering face in the RGB image, a prompt message is output, and the prompt message is used to prompt that there is an interfering face in the RGB image.

[0073] As can be seen from the above embodiments, in this embodiment, when performing face recognition on an RGB image containing multiple faces, the depth image corresponding to the RGB image can be combined to determine the face used for face recognition in the RGB image. Compared with performing face recognition based only on the RGB image, in the embodiment of this specification, since the information contained in the depth image is relatively rich, and the depth image can reflect the distance between each face in the depth image and the image acquisition device, and the distance between the face and the image acquisition device can reflect the user's face recognition intention to a certain extent, the embodiment of this specification can avoid missing the face in the RGB image, and can more accurately determine the face used for face recognition in the RGB image.

[0074] Figure 3 is a structural diagram of a face recognition device according to an embodiment of the present specification. Figure 3 As shown, in a software implementation, the face recognition device 300 may include: an acquisition module 301, a selection module 302, a judgment module 303 and a recognition module 304, wherein:

[0075] An acquisition module 301 is used to acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face;

[0076] A selection module 302, configured to select a target face from the RGB image;

[0077] A judgment module 303 is used to judge whether there is an interfering face in the RGB image according to the target face and the depth image, and the difference between the distance between the interfering face and the face image acquisition device and the distance between the target face and the face image acquisition device is less than a preset threshold;

[0078] The recognition module 304 is configured to perform face recognition based on the target face when the interfering face does not exist in the RGB image.

[0079] As can be seen from the above embodiments, in this embodiment, when performing face recognition on an RGB image containing multiple faces, the depth image corresponding to the RGB image can be combined to determine the face used for face recognition in the RGB image. Compared with performing face recognition based only on the RGB image, in the embodiment of this specification, since the information contained in the depth image is relatively rich, and the depth image can reflect the distance between each face in the depth image and the image acquisition device, and the distance between the face and the image acquisition device can reflect the user's face recognition intention to a certain extent, the embodiment of this specification can avoid missing the face in the RGB image, and can more accurately determine the face used for face recognition in the RGB image.

[0080] Optionally, as an embodiment, the selection module 302 may include:

[0081] The face selection submodule is used to select a face in a preset area in the RGB image as a target face.

[0082] Optionally, as an embodiment, the preset area includes:

[0083] The central area of ​​the RGB image, or the focus area when the RGB image is captured.

[0084] Optionally, as an embodiment, the judging module 303 may include:

[0085] A target region determination submodule, used to determine a target region corresponding to the target face in the depth image;

[0086] A distance calculation submodule, used for calculating the distance D1 from the target face to the face image acquisition device according to the information of the pixel points in the target area;

[0087] The judgment submodule is used to judge whether there is a face in the depth image that is D2 away from the face image acquisition device, and the difference between D1 and D2 is less than the preset threshold; wherein,

[0088] If there is a face at a distance D2 from the face image acquisition device in the depth image, then there is an interfering face in the RGB image; if there is no face at a distance D2 from the face image acquisition device in the depth image, it is determined that there is no interfering face in the RGB image.

[0089] Optionally, as an embodiment, the distance calculation submodule may include:

[0090] A distance calculation unit, used to calculate the distance from each pixel point in the target area to the face image acquisition device;

[0091] The distance determination unit is used to determine the average value of the distances from each pixel point to the face image acquisition device as the distance D1 from the target face to the face image acquisition device.

[0092] Optionally, as an embodiment, the face recognition device 300 may further include:

[0093] The output module is used to output a prompt message when the interfering face exists in the RGB image, wherein the prompt message is used to prompt that the interfering face exists in the RGB image.

[0094] Figure 4 is a schematic diagram of the structure of an electronic device according to an embodiment of the present specification, such as Figure 4 As shown, at the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device may also include hardware required for other services.

[0095] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0096] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0097] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a face recognition device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0098] Acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face;

[0099] Select a target face from the RGB image;

[0100] According to the target face and the depth image, determine whether there is an interfering face in the RGB image, and the difference between the distance from the interfering face to the face image acquisition device and the distance from the target face to the face image acquisition device is less than a preset threshold;

[0101] If the interfering face does not exist in the RGB image, face recognition is performed based on the target face.

[0102] In the embodiment of the present specification, when performing face recognition on an RGB image containing multiple faces, the face used for face recognition in the RGB image can be determined in combination with the depth image corresponding to the RGB image. Compared with performing face recognition based only on the RGB image, in the embodiment of the present specification, since the information contained in the depth image is relatively rich, and the depth image can reflect the distance between each face in the depth image and the image acquisition device, and the distance between the face and the image acquisition device can reflect the user's face recognition intention to a certain extent, the embodiment of the present specification can avoid missing faces in the RGB image, and can more accurately determine the face used for face recognition in the RGB image.

[0103] Optionally, as an embodiment, the selecting a target face from the RGB image includes:

[0104] A face in a preset area in the RGB image is selected as a target face.

[0105] Optionally, as an embodiment, the preset area includes:

[0106] The central area of ​​the RGB image, or the focus area of ​​the RGB image when it is captured.

[0107] Optionally, as an embodiment, judging whether there is an interfering face in the RGB image according to the target face and the depth image includes:

[0108] Determine a target area corresponding to the target face in the depth image;

[0109] Calculate the distance D1 from the target face to the face image acquisition device based on the information of the pixel points in the target area;

[0110] Determine whether there is a face at a distance D2 from the face image acquisition device in the depth image, and the difference between D1 and D2 is less than the preset threshold;

[0111] If there is a face at a distance D2 from the face image acquisition device in the depth image, then there is an interfering face in the RGB image; if there is no face at a distance D2 from the face image acquisition device in the depth image, it is determined that there is no interfering face in the RGB image.

[0112] Optionally, as an embodiment, calculating the distance D1 from the target face to the face image acquisition device according to the information of the pixel points in the target area includes:

[0113] Calculate the distance from each pixel point in the target area to the face image acquisition device;

[0114] The average value of the distances from each pixel point to the face image acquisition device is determined as the distance D1 from the target face to the face image acquisition device.

[0115] Optionally, as an embodiment, the method further includes:

[0116] If the interfering face exists in the RGB image, a prompt message is output, where the prompt message is used to prompt that the interfering face exists in the RGB image.

[0117] The above is as in this manual Figure 4The method performed by the face recognition device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in software form. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of this specification can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of this specification can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0118] The electronic device may also perform Figure 1 Method and implementation of face recognition device in Figure 1 The functions of the illustrated embodiments will not be described in detail in the embodiments of this specification.

[0119] The embodiment of the present specification also provides a computer-readable storage medium, which stores one or more programs, wherein 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 execute Figure 1 The method of the embodiment shown is specifically used to perform the following method:

[0120] Acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face;

[0121] Select a target face from the RGB image;

[0122] According to the target face and the depth image, determine whether there is an interfering face in the RGB image, and the difference between the distance from the interfering face to the face image acquisition device and the distance from the target face to the face image acquisition device is less than a preset threshold;

[0123] If the interfering face does not exist in the RGB image, face recognition is performed based on the target face.

[0124] In short, the above description is only a preferred embodiment of this specification and is not intended to limit the protection scope of this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the protection scope of this specification.

[0125] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, 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.

[0126] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0127] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0128] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

Claims

1. A face recognition method, the method include: Acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face; the RGB image and the depth image are images taken for the same scene; the RGB image is acquired by an RGB image acquisition device; the depth image is acquired by a depth image acquisition device; the grayscale value of each pixel in the depth image is used to characterize the distance from a point in the scene to the depth image acquisition device; there is a predetermined spatial coordinate transformation relationship between the image acquired by the camera of the pre-calibrated RGB image acquisition device and the image acquired by the camera of the pre-calibrated depth image acquisition device; Select a target face from the RGB image; According to the target face and the depth image, judging whether there is an interfering face in the RGB image includes: if there is a face in the depth image and the distance between the face and the depth image acquisition device and the distance between the target face and the depth image acquisition device are less than a preset threshold, then there is an interfering face in the RGB image; if there is no face in the depth image, then there is no interfering face in the RGB image; If the interfering face does not exist in the RGB image, face recognition is performed based on the target face.

2. The method according to claim 1, wherein the target face is selected from the RGB image. include: A face in a preset area in the RGB image is selected as a target face.

3. The method according to claim 2, wherein the preset area include: The central area of ​​the RGB image, or the focus area of ​​the RGB image when it is captured.

4. The method according to claim 1, wherein judging whether there is an interfering face in the RGB image based on the target face and the depth image, include: Determine a target area corresponding to the target face in the depth image; Calculate the distance D1 from the target face to the depth image acquisition device based on the information of the pixel points in the target area; Determine whether there is a face at a distance D2 from the depth image acquisition device in the depth image, and the difference between D1 and D2 is less than the preset threshold; If there is a face at a distance D2 from the depth image acquisition device in the depth image, then there is an interfering face in the RGB image; if there is no face at a distance D2 from the depth image acquisition device in the depth image, it is determined that there is no interfering face in the RGB image.

5. The method according to claim 4, wherein the distance D1 from the target face to the depth image acquisition device is calculated based on the information of the pixel points in the target area. include: Calculate the distance from each pixel in the target area to the depth image acquisition device; The average value of the distances from each pixel point to the depth image acquisition device is determined as the distance D1 from the target face to the depth image acquisition device.

6. The method according to claim 4, It is characterized in that The determining a target area corresponding to the target face in the depth image includes: According to the spatial coordinate transformation relationship between the RGB image and the corresponding depth image, a target area corresponding to the target face in the depth image is determined.

7. The method according to claim 1, further comprising: include: If the interfering face exists in the RGB image, a prompt message is output, where the prompt message is used to prompt that the interfering face exists in the RGB image.

8. A facial payment method, the method include: Acquire an RGB image and a corresponding depth image for face payment, wherein the RGB image contains at least one face; the RGB image and the depth image are images taken for the same scene; the RGB image is acquired by an RGB image acquisition device; the depth image is acquired by a depth image acquisition device; the grayscale value of each pixel in the depth image is used to characterize the distance from a point in the scene to the depth image acquisition device; there is a predetermined spatial coordinate transformation relationship between the image acquired by the camera of the pre-calibrated RGB image acquisition device and the image acquired by the camera of the pre-calibrated depth image acquisition device; Select a target face from the RGB image; According to the target face and the depth image, judging whether there is an interfering face in the RGB image includes: if there is a face in the depth image and the distance between the face and the depth image acquisition device and the distance between the target face and the depth image acquisition device are less than a preset threshold, then there is an interfering face in the RGB image; if there is no face in the depth image, then there is no interfering face in the RGB image; If the interfering face does not exist in the RGB image, performing face recognition based on the target face; If the face recognition is passed, the payment operation is performed.

9. The method according to claim 8, wherein the target face is selected from the RGB image. include: A face in a preset area in the RGB image is selected as a target face.

10. The method according to claim 8, wherein judging whether there is an interfering face in the RGB image based on the target face and the depth image, include: Determine a target area corresponding to the target face in the depth image; Calculate the distance D1 from the target face to the depth image acquisition device based on the information of the pixel points in the target area; Determine whether there is a face at a distance D2 from the depth image acquisition device in the depth image, and the difference between D1 and D2 is less than the preset threshold; If there is a face at a distance D2 from the depth image acquisition device in the depth image, then there is an interfering face in the RGB image; if there is no face at a distance D2 from the depth image acquisition device in the depth image, it is determined that there is no interfering face in the RGB image.

11. The method according to claim 8, further comprising: include: If the interfering face exists in the RGB image, a prompt message is output, where the prompt message is used to prompt that there is a risk in the payment transaction.

12. A face recognition method, the method include: Acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face; the RGB image and the depth image are images taken for the same scene; the RGB image is acquired by an RGB image acquisition device; the depth image is acquired by a depth image acquisition device; the grayscale value of each pixel in the depth image is used to characterize the distance from a point in the scene to the depth image acquisition device; there is a predetermined spatial coordinate transformation relationship between the image acquired by the camera of the pre-calibrated RGB image acquisition device and the image acquired by the camera of the pre-calibrated depth image acquisition device; Select a target face from the RGB image; Judging whether there is an interfering face in the RGB image based on the target face and the depth image includes: if there is a face in the depth image and the distance from the face to the depth image acquisition device and the distance from the target face to the depth image acquisition device are less than a preset threshold, then there is an interfering face in the RGB image; if there is no face in the depth image, then there is no interfering face in the RGB image.

13. The method according to claim 12, wherein the target face is selected from the RGB image. include: A face in a preset area in the RGB image is selected as a target face.

14. The method according to claim 12, wherein judging whether there is an interfering face in the RGB image based on the target face and the depth image, include: Determine a target area corresponding to the target face in the depth image; Calculate the distance D1 from the target face to the depth image acquisition device based on the information of the pixel points in the target area; Determine whether there is a face at a distance D2 from the depth image acquisition device in the depth image, and the difference between D1 and D2 is less than the preset threshold; If there is a face at a distance D2 from the depth image acquisition device in the depth image, then there is an interfering face in the RGB image; if there is no face at a distance D2 from the depth image acquisition device in the depth image, it is determined that there is no interfering face in the RGB image.

15. A face recognition device, the device include: An acquisition module, used to acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face; the RGB image and the depth image are images taken for the same scene; the RGB image is acquired by an RGB image acquisition device; the depth image is acquired by a depth image acquisition device; the grayscale value of each pixel in the depth image is used to characterize the distance from a point in the scene to the depth image acquisition device; there is a predetermined spatial coordinate transformation relationship between the image acquired by the camera of the pre-calibrated RGB image acquisition device and the image acquired by the camera of the pre-calibrated depth image acquisition device; A selection module, used for selecting a target face from the RGB image; The judgment module is used to judge whether there is an interfering face in the RGB image according to the target face and the depth image, including: if there is a face in the depth image and the distance between the face and the depth image acquisition device and the distance between the target face and the depth image acquisition device are less than a preset threshold, then there is an interfering face in the RGB image; if there is no face in the depth image, then there is no interfering face in the RGB image; A recognition module is used to perform face recognition based on the target face when the interfering face does not exist in the RGB image.

16. The device according to claim 15, wherein the selection module include: The face selection submodule is used to select a face in a preset area in the RGB image as a target face.

17. An electronic device, include: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: Acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face; the RGB image and the depth image are images taken for the same scene; the RGB image is acquired by an RGB image acquisition device; the depth image is acquired by a depth image acquisition device; the grayscale value of each pixel in the depth image is used to characterize the distance from a point in the scene to the depth image acquisition device; there is a predetermined spatial coordinate transformation relationship between the image acquired by the camera of the pre-calibrated RGB image acquisition device and the image acquired by the camera of the pre-calibrated depth image acquisition device; Select a target face from the RGB image; According to the target face and the depth image, judging whether there is an interfering face in the RGB image includes: if there is a face in the depth image and the distance between the face and the depth image acquisition device and the distance between the target face and the depth image acquisition device are less than a preset threshold, then there is an interfering face in the RGB image; if there is no face in the depth image, then there is no interfering face in the RGB image; If the interfering face does not exist in the RGB image, face recognition is performed based on the target face.

18. A computer storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform the following operations: Acquire an RGB image and a corresponding depth image for face recognition, wherein the RGB image contains at least one face; the RGB image and the depth image are images taken for the same scene; the RGB image is acquired by an RGB image acquisition device; the depth image is acquired by a depth image acquisition device; the grayscale value of each pixel in the depth image is used to characterize the distance from a point in the scene to the depth image acquisition device; there is a predetermined spatial coordinate transformation relationship between the image acquired by the camera of the pre-calibrated RGB image acquisition device and the image acquired by the camera of the pre-calibrated depth image acquisition device; Select a target face from the RGB image; According to the target face and the depth image, judging whether there is an interfering face in the RGB image includes: if there is a face in the depth image and the distance between the face and the depth image acquisition device and the distance between the target face and the depth image acquisition device are less than a preset threshold, then there is an interfering face in the RGB image; if there is no face in the depth image, then there is no interfering face in the RGB image; If the interfering face does not exist in the RGB image, face recognition is performed based on the target face.

Citation Information

Cited By

  • Method and system for verifying identity of sperm library based on comparison of multi-biological characteristic information

    CN120012063A