Activation method and device, electronic device and computer-readable storage medium
By selecting the camera or infrared sensor to activate the face recognition device according to the ambient brightness, the problem of low detection accuracy of infrared sensors in strong lighting environments is solved, the recognition efficiency and equipment life are improved, and energy consumption and the risk of mis-activation are reduced.
Patent Information
- Application Number
- CN202011608327.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2040-12-29
AI Technical Summary
In the environment of strong lighting, the detection accuracy of infrared sensors of existing face recognition devices is low, resulting in low recognition efficiency and affecting the energy consumption and service life of the device.
According to the relationship between the ambient brightness and the brightness threshold, a camera or infrared sensor is used to activate the face recognition device, and the camera is used to recognize when the light is strong and the infrared sensor is weak to improve detection accuracy.
It improves the recognition efficiency of facial recognition equipment, saves energy consumption, extends the service life of the equipment, reduces the situation of incorrect activation and untimely activation, and enhances the recognition accuracy.
Smart Images

Figure CN112650379B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of security technology, and in particular to an activation method and device, an electronic device, and a computer-readable storage medium. Background Art
[0002] As face recognition technology matures, face recognition technology is used for identity authentication in more and more scenarios. Specifically, face recognition devices use face recognition technology for identity authentication, which can complete identity authentication without human intervention, thereby saving labor costs.
[0003] In order to save energy consumption of the face recognition device, the face recognition device can be put into standby mode when no one needs to authenticate through the face recognition device, and activated when it is detected that someone needs to authenticate through the face recognition device. Summary of the invention
[0004] The present application provides an activation method and device, an electronic device, and a computer-readable storage medium.
[0005] The present application provides an activation method, which is applied to a face recognition device, wherein the face recognition device includes a camera and an infrared sensor, and the method includes:
[0006] Get the current ambient brightness;
[0007] According to the relationship between the ambient brightness and the brightness threshold, a corresponding activation strategy is adopted for the face recognition device, and the activation strategy includes activating the face recognition device using the camera and activating the face recognition device using the infrared sensor.
[0008] In combination with any implementation manner of the present application, the adopting a corresponding activation strategy for the face recognition device according to the relationship between the ambient brightness and the brightness threshold includes:
[0009] When the ambient brightness is greater than or equal to the brightness threshold, the camera is controlled to remain turned on and the infrared sensor is turned off, and the face recognition device is activated using the camera.
[0010] In combination with any implementation manner of the present application, using the camera to activate the face recognition device includes:
[0011] The camera is used to detect a target object within a recognition area and activate the face recognition device.
[0012] In combination with any implementation manner of the present application, the adopting a corresponding activation strategy for the face recognition device according to the relationship between the ambient brightness and the brightness threshold includes:
[0013] When the ambient brightness is less than the brightness threshold, the camera is turned off and the infrared sensor is turned on, and the face recognition device is activated by using the infrared sensor.
[0014] In combination with any embodiment of the present application, the step of activating the face recognition device using the infrared sensor includes:
[0015] In response to the infrared sensor detecting a target object within the recognition area, the face recognition device is activated.
[0016] In combination with any embodiment of the present application, the step of detecting a target object within a recognition area using the camera and activating the face recognition device includes:
[0017] Using the camera to collect a first image to be processed, wherein a collection area of the camera is the recognition area;
[0018] When an activation condition is met, it is determined that the target object in the recognition area is detected, and the face recognition device is activated, wherein the activation condition includes determining that the first image to be processed contains a face to be detected.
[0019] In combination with any implementation manner of the present application, before activating the face recognition device, the method further includes:
[0020] Using the camera to collect a second image to be processed;
[0021] The activation condition also includes determining that the second image to be processed contains the face to be detected.
[0022] In combination with any implementation manner of the present application, the acquisition time of the first image to be processed is a first time, and before the second image to be processed is acquired by the camera, the method further includes:
[0023] Get the collection time interval;
[0024] The using the camera to collect the second image to be processed includes:
[0025] The second image to be processed is acquired using the camera at a second time, wherein a time interval between the second time and the first time is the acquisition time interval.
[0026] In combination with any implementation manner of the present application, before activating the face recognition device, the method further includes:
[0027] Get the activation direction range;
[0028] Obtaining a moving direction of the target object according to the first image to be processed and the second image to be processed;
[0029] The activation condition also includes that the moving direction is within the activation direction range.
[0030] In combination with any embodiment of the present application, in response to the infrared sensor detecting a target object in the recognition area, activating the face recognition device includes:
[0031] Acquire a first infrared light quantity detected by the infrared sensor;
[0032] When the first infrared light quantity is greater than a light quantity threshold, it is determined that the target object is within the recognition area, and the face recognition device is activated.
[0033] In combination with any embodiment of the present application, after the first infrared light quantity is greater than the light quantity threshold and before determining that the target object is within the identification area, the method further includes:
[0034] Starting the camera and using the camera to capture a third image to be processed;
[0035] Obtaining an infrared light compensation amount according to the third image to be processed;
[0036] Correcting the infrared light amount detected by the infrared sensor according to the infrared light compensation amount to obtain a second infrared light amount;
[0037] The determining that the target object is within the identification area includes:
[0038] When the second infrared light quantity is less than or equal to the light quantity threshold, it is determined that the target object is within the recognition area.
[0039] In combination with any embodiment of the present application, the step of correcting the infrared light amount detected by the infrared sensor according to the infrared light compensation amount to obtain a second infrared light amount includes:
[0040] The sum of the infrared light compensation amount and the first infrared light amount is determined to obtain the second infrared light amount.
[0041] In combination with any embodiment of the present application, the face recognition device further includes an infrared lamp, and the method of correcting the infrared light amount detected by the infrared sensor according to the infrared light compensation amount to obtain a second infrared light amount includes:
[0042] Determining a driving current of the infrared lamp according to the infrared light compensation amount;
[0043] The infrared lamp is driven by the driving current, and a second infrared light quantity detected by the infrared sensor is acquired as the second infrared light quantity.
[0044] In combination with any embodiment of the present application, before obtaining the infrared light compensation amount according to the third image to be processed, the method further includes:
[0045] Obtaining the mapping relationship between color and infrared light compensation;
[0046] The step of obtaining the infrared light compensation amount according to the third image to be processed includes:
[0047] Performing feature extraction processing on the target object in the third image to be processed to obtain feature data;
[0048] Obtaining the color of the target object according to the feature data;
[0049] An infrared light compensation amount is obtained according to the mapping relationship and the color of the target object.
[0050] The present application provides a face recognition device, the face recognition device comprising a camera and an infrared sensor, and the face recognition device further comprising:
[0051] An acquisition unit is used to obtain the current ambient brightness;
[0052] An activation unit is used to adopt a corresponding activation strategy for the face recognition device according to the relationship between the ambient brightness and the brightness threshold, and the activation strategy includes activating the face recognition device using the camera and activating the face recognition device using the infrared sensor.
[0053] In combination with any embodiment of the present application, the activation unit is specifically used for:
[0054] When the ambient brightness is greater than or equal to the brightness threshold, the camera is controlled to remain turned on and the infrared sensor is turned off, and the face recognition device is activated using the camera.
[0055] In combination with any embodiment of the present application, the activation unit is specifically used for:
[0056] The camera is used to detect a target object within a recognition area and activate the face recognition device.
[0057] In combination with any embodiment of the present application, the activation unit is specifically used for:
[0058] When the ambient brightness is less than the brightness threshold, the camera is turned off and the infrared sensor is turned on, and the face recognition device is activated by using the infrared sensor.
[0059] In combination with any embodiment of the present application, the activation unit is specifically used for:
[0060] In response to the infrared sensor detecting a target object within the recognition area, the face recognition device is activated.
[0061] In combination with any embodiment of the present application, the activation unit is specifically used for:
[0062] Using the camera to collect a first image to be processed, wherein a collection area of the camera is the recognition area;
[0063] When an activation condition is met, it is determined that the target object in the recognition area is detected, and the face recognition device is activated, wherein the activation condition includes determining that the first image to be processed contains a face to be detected.
[0064] In combination with any embodiment of the present application, the activation unit is specifically used for:
[0065] Using the camera to collect a second image to be processed;
[0066] The activation condition also includes determining that the second image to be processed contains the face to be detected.
[0067] In combination with any embodiment of the present application, the acquisition time of the first image to be processed is a first time, and the acquisition unit is further used to acquire an acquisition time interval before using the camera to acquire the second image to be processed;
[0068] The activation unit is specifically used for:
[0069] The second image to be processed is acquired using the camera at a second time, wherein a time interval between the second time and the first time is the acquisition time interval.
[0070] In combination with any embodiment of the present application, the acquisition unit is further used to acquire an activation direction range before activating the face recognition device;
[0071] The face recognition device also includes:
[0072] A first processing unit, configured to obtain a moving direction of the target object according to the first image to be processed and the second image to be processed;
[0073] The activation condition also includes that the moving direction is within the activation direction range.
[0074] In combination with any embodiment of the present application, the activation unit is specifically used for:
[0075] Acquire a first infrared light quantity detected by the infrared sensor;
[0076] When the first infrared light quantity is greater than a light quantity threshold, it is determined that the target object is within the recognition area, and the face recognition device is activated.
[0077] In combination with any embodiment of the present application, the face recognition device starts the camera after the first infrared light amount is greater than the light amount threshold and before determining that the target object is in the recognition area, and uses the camera to capture a third image to be processed;
[0078] The face recognition device also includes:
[0079] A second processing unit, configured to obtain an infrared light compensation amount according to the third image to be processed;
[0080] A third processing unit, configured to correct the infrared light amount detected by the infrared sensor according to the infrared light compensation amount to obtain a second infrared light amount;
[0081] The activation unit is specifically used for:
[0082] When the second infrared light quantity is less than or equal to the light quantity threshold, it is determined that the target object is within the recognition area.
[0083] In combination with any implementation manner of the present application, the third processing unit is specifically used for:
[0084] The sum of the infrared light compensation amount and the first infrared light amount is determined to obtain the second infrared light amount.
[0085] In combination with any embodiment of the present application, the face recognition device further includes an infrared lamp, and the third processing unit is specifically used for:
[0086] Determining a driving current of the infrared lamp according to the infrared light compensation amount;
[0087] The infrared lamp is driven by the driving current, and a second infrared light quantity detected by the infrared sensor is acquired as the second infrared light quantity.
[0088] In combination with any embodiment of the present application, the acquisition unit is further configured to acquire a mapping relationship between color and infrared light compensation before obtaining the infrared light compensation amount according to the third image to be processed;
[0089] The third processing unit is specifically used for:
[0090] Performing feature extraction processing on the target object in the third image to be processed to obtain feature data;
[0091] Obtaining the color of the target object according to the feature data;
[0092] An infrared light compensation amount is obtained according to the mapping relationship and the color of the target object.
[0093] In some embodiments, an electronic device is provided, characterized in that it includes: a processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, the electronic device executes a method such as the above-mentioned activation method and any possible implementation method thereof.
[0094] In some embodiments, another electronic device is provided, including: a processor, a sending device, an input device, an output device and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes a method such as the above-mentioned activation method and any possible implementation method thereof.
[0095] In some embodiments, a computer-readable storage medium is provided, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor, the processor is caused to execute a method such as the above-mentioned activation method and any possible implementation method thereof.
[0096] In some embodiments, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is caused to execute the above-mentioned activation method and any possible implementation method thereof.
[0097] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0099] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0100] Figure 1 A flowchart of an activation method provided in an embodiment of the present application;
[0101] Figure 2A schematic diagram of the structure of an activation device provided in an embodiment of the present application;
[0102] Figure 3 A schematic diagram of the hardware structure of a face recognition device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0103] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0104] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0105] It should be understood that in the present application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three and more than three, and "and / or" is used to describe the association relationship of associated objects, indicating that there may be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " can indicate that the objects before and after the association are in an "or" relationship, which means any combination of these items, including any combination of single items (items) or plural items (items). For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple. The character " / " can also represent the division sign in mathematical operations, for example, a / b = a divided by b; 6 / 3 = 2. "At least one of the following" or similar expressions.
[0106] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0107] As face recognition technology matures, face recognition technology is used for identity authentication in more and more scenarios. Specifically, face recognition devices use face recognition technology for identity authentication, which can complete identity authentication without human intervention, thereby saving labor costs.
[0108] In order to save energy consumption of the face recognition device, the face recognition device can be put into standby or sleep mode when no one needs to authenticate through the face recognition device, and activated when it is detected that someone needs to authenticate through the face recognition device.
[0109] In traditional technologies, face recognition devices use infrared sensors to detect whether there are people in the recognition area and determine whether someone needs to pass the face recognition device for identity verification. However, when the face recognition device is located in an environment with strong lighting or outdoors, the infrared light emitted by the infrared sensor is easily weakened, and the detection accuracy of the infrared sensor is low, which in turn leads to low recognition efficiency of the face recognition device, thereby affecting the recognition efficiency.
[0110] Based on this, the embodiment of the present application provides a technical solution to improve the recognition efficiency of a face recognition device. The embodiment of the present application is performed by a face recognition device, wherein the face recognition device includes a camera and an infrared sensor, and the camera is a visible light camera.
[0111] The face recognition device can be any electronic device that can execute the technical solution disclosed in the method embodiment of the present application. Optionally, the face recognition device can be one of the following: a mobile phone, a computer, a server, and a tablet computer. The embodiment of the present application is described below in conjunction with the drawings in the embodiment of the present application.
[0112] See also Figure 1 , Figure 1 It is a flowchart of an activation method provided in an embodiment of the present application.
[0113] 101. Get the current ambient brightness.
[0114] In the embodiment of the present application, the current environment brightness is the brightness of the environment where the face recognition device is located. In a possible implementation, the face recognition device further includes a brightness sensor. The face recognition device uses the brightness sensor to detect the brightness of the environment where the face recognition device is located to obtain the current environment brightness.
[0115] In another implementation of obtaining the current ambient brightness, the face recognition device receives the current ambient brightness input by the user through an input component to obtain the current ambient brightness. The above input component includes: a keyboard, a mouse, a touch screen, a touch pad, and an audio input device.
[0116] In another implementation of obtaining the current ambient brightness, the face recognition device receives the current ambient brightness sent by the terminal to obtain the current ambient brightness. Optionally, the terminal can be any of the following: a mobile phone, a computer, a tablet computer, a server, and a wearable device.
[0117] 102. According to the relationship between the above-mentioned ambient brightness and the brightness threshold, a corresponding activation strategy is adopted for the above-mentioned face recognition device, and the above-mentioned activation strategy includes activating the above-mentioned face recognition device using the above-mentioned camera and activating the above-mentioned face recognition device using the above-mentioned infrared sensor. After the face recognition device is activated from the standby state or the dormant state, it can enter the working state, that is, start the face recognition process.
[0118] In the embodiment of the present application, the brightness threshold is used to determine whether the brightness of the environment in which the face recognition device is located is too high. In an implementation method of obtaining the brightness threshold, the face recognition device receives the brightness threshold input by the user through an input component to obtain the brightness threshold.
[0119] In another implementation manner of obtaining the brightness threshold, the face recognition device receives the brightness threshold sent by the terminal to obtain the brightness threshold.
[0120] In the embodiment of the present application, the relationship between the ambient brightness and the brightness threshold includes at least one of the following: the ambient brightness is greater than the brightness threshold, the ambient brightness is equal to the brightness threshold, and the ambient brightness is less than the brightness threshold.
[0121] Among them, if the ambient brightness is greater than or equal to the brightness threshold, it means that the brightness of the environment where the face recognition device is located is too high. At this time, if the infrared sensor is used to detect whether there is a person in the recognition area, a large error will be generated. If the ambient brightness is less than the brightness threshold, it means that the brightness of the environment where the face recognition device is located is low. At this time, the infrared sensor can be used to detect whether there is a person in the recognition area.
[0122] In an embodiment of the present application, the face recognition device includes a non-working state and a working state. If at least one component in the face recognition device used to detect whether a person enters the recognition area is called a detection component, and at least one component in the face recognition device other than the detection component is called a non-detection component. Then when the face recognition device is in a non-working state, the detection component is in a working state, and the non-detection component is in a non-working state. When the face recognition device is in a working state, both the detection component and the non-detection component are in a working state. In an embodiment of the present application, a component (including the above-mentioned detection component and non-detection component) in a non-working state may be a component in a standby state, a power-off state, or a component in a dormant state.
[0123] When there is no one in the recognition area, the face recognition device is put into a non-working state, and when there is someone in the recognition area, the face recognition device is activated and put into a working state, which can save the energy consumption of the face recognition device and improve the efficiency of the face recognition device. Therefore, whether to activate the face recognition device to put the face recognition device into a working state depends on whether there is someone in the recognition area.
[0124] In the embodiment of the present application, the activation strategy includes two implementation methods: using a camera to activate the face recognition device and using an infrared sensor to activate the face recognition device.
[0125] Considering that when the light is strong, the detection accuracy of whether there is a person in the recognition area using the infrared sensor is low, and the detection accuracy of whether there is a person in the recognition area using the camera is high. When the light is weak, the detection accuracy of whether there is a person in the recognition area using the infrared sensor is high, and the detection accuracy of whether there is a person in the recognition area using the camera is low. Therefore, the face recognition device determines the corresponding activation strategy based on the relationship between the ambient brightness and the above brightness threshold, thereby improving the detection accuracy, thereby improving the recognition efficiency of the face recognition device.
[0126] As an optional implementation, the face recognition device performs the following steps during the process of executing step 102:
[0127] 1. When the ambient brightness is greater than or equal to the brightness threshold, control the camera to remain turned on and turn off the infrared sensor, and use the camera to activate the face recognition device.
[0128] When the ambient brightness is greater than or equal to the brightness threshold, using the camera to activate the face device can improve the recognition efficiency, while turning off the infrared sensor can save the energy consumption of the face recognition device.
[0129] As an optional implementation, the face recognition device performs the following steps in the process of activating the face recognition device using a camera:
[0130] 2. Use the above-mentioned camera to detect the target object in the recognition area and activate the above-mentioned face recognition device.
[0131] In this step, the target object includes a person. The face recognition device can use a camera to collect a visible light image of the recognition area. By performing face detection on the visible light image, it can be determined whether the visible light image contains a face. If it is determined that the visible light image contains a face, it is determined that there is a person in the recognition area; if it is determined that the visible light image does not contain a face, it is determined that there is no person in the recognition area.
[0132] As an optional implementation, the face recognition device performs the following steps during the process of executing step 102:
[0133] 3. When the ambient brightness is lower than the brightness threshold, turn off the camera and turn on the infrared sensor, and use the infrared sensor to activate the face recognition device.
[0134] If the light intensity is less than the brightness threshold, it means that the environment where the face recognition device is located is dark. At this time, the accuracy of using the infrared sensor to detect whether there is someone in the recognition area is higher. Therefore, the face recognition device can use the infrared sensor to detect whether there is someone in the recognition area. When using the infrared sensor to detect whether there is someone in the recognition area, turning off the camera can reduce the energy consumption and loss of the face recognition device, extend the service life of the face recognition device, and achieve the effect of cost saving.
[0135] As an optional implementation, the face recognition device performs the following steps in the process of activating the face recognition device using the infrared sensor:
[0136] 4. In response to the infrared sensor detecting a target object in the recognition area, activating the face recognition device.
[0137] In this step, the target object includes a person. When the infrared sensor detects a person in the recognition area, the face recognition device is activated.
[0138] In the embodiment of the present application, the face recognition device determines whether the light intensity of the environment in which the face recognition device is located is too high based on the current environment brightness and the brightness threshold. Since the detection accuracy of the infrared sensor is low in an environment with high light intensity, and the detection accuracy of the infrared sensor is high in an environment with low light intensity, when the light intensity of the environment in which the face recognition device is located is too high, the face recognition device uses a camera to detect whether someone has entered the recognition area, and when the light intensity of the environment in which the face recognition device is located is too low, the face recognition device uses an infrared sensor to detect whether someone has entered the recognition area, which can improve the detection accuracy. Thereby improving the recognition efficiency of the face recognition device.
[0139] As an optional implementation, the face recognition device performs the following steps during the process of executing step 2:
[0140] 5. Use the above-mentioned camera to collect the first image to be processed, wherein the collection area of the above-mentioned camera is the above-mentioned recognition area.
[0141] 6. When an activation condition is met, determine that a target object in the recognition area is detected, and activate the face recognition device, wherein the activation condition includes determining that the first image to be processed contains a face to be detected.
[0142] In the embodiment of the present application, the face to be detected is a face in the first image to be processed. When the first image to be processed contains at least two faces, the face to be detected is any one face in the first image to be processed.
[0143] In this step, the first image to be processed contains a face to be detected, indicating that there is a person in the first image to be processed, that is, it is determined that there is a target object (ie, a person) in the recognition area. Therefore, the face recognition device should be activated to put it in working state.
[0144] The face recognition device can determine whether the first image to be processed contains a face by performing face detection processing on the first image to be processed.
[0145] In one possible implementation, the face recognition device processes the first image to be processed by a face detection algorithm to implement face detection processing on the first image to be processed. The face detection algorithm may be one of the following: you only look once (YOLO), deformable part model (DMP), single shot multiBox detector (SSD), Faster-RCNN, etc.
[0146] In another possible implementation, face detection processing on the first image to be processed may be implemented by a convolutional neural network. The convolutional neural network is trained by using images with annotation information as training data, so that the trained convolutional neural network can complete face detection processing on the image. The annotation information of the image in the training data is the position information of a face frame, and the face frame contains a face.
[0147] As a possible implementation method, before activating the face recognition device, the face recognition device also performs the following steps:
[0148] 7. Use the above-mentioned camera to collect the second image to be processed.
[0149] In the embodiment of the present application, the second image to be processed is different from the first image to be processed. Specifically, the acquisition time of the first image to be processed is different from the acquisition time of the second image to be processed.
[0150] For example, the face recognition device may first use the camera to capture the first image to be processed, and then use the camera to capture the second image to be processed; the face recognition device may also first use the camera to capture the second image to be processed, and then use the camera to capture the first image to be processed.
[0151] 8. The activation condition further includes determining that the second image to be processed contains the face to be detected.
[0152] If both the first image to be processed and the second image to be processed contain a face to be detected, it means that the person corresponding to the face to be detected is in the recognition area at least at two different times. At this time, the probability that the person corresponding to the face to be detected mistakenly enters the recognition area is low.
[0153] Therefore, when the face recognition device determines that both the first image to be processed and the second image to be processed contain the face to be detected, the face recognition device is activated so that the face recognition device enters a working state, which can improve recognition efficiency, save consumption of the face recognition device, and extend the service life of the face recognition device.
[0154] For example, Zhang San did not intend to pass the verification of the face recognition device, but Zhang San mistakenly entered the recognition area of the face recognition device. The face recognition device collected the first image to be processed containing Zhang San's face when Zhang San mistakenly entered the recognition area. After Zhang San realized that he had mistakenly entered the recognition area, he immediately left the recognition area. After Zhang San left the recognition area, the face recognition device collected the second image to be processed.
[0155] Since the second image to be processed does not contain Zhang San's face, the face recognition device will not be activated, thereby improving recognition efficiency.
[0156] As an optional implementation manner, the acquisition time of the first image to be processed is the first time, and the face recognition device further performs the following steps before performing step 7:
[0157] 9. Get the collection time interval.
[0158] In an implementation method of obtaining the collection time interval, a face recognition device receives the collection time interval input by a user through an input component to obtain the collection time interval.
[0159] In another implementation method of obtaining the collection time interval, the face recognition device receives the collection time interval sent by the terminal to obtain the collection time interval.
[0160] In another implementation of obtaining the collection time interval, the collection time interval is stored in the face recognition device, and the face recognition device obtains the collection time interval by reading the collection time interval from a storage medium.
[0161] After executing step 9, the face recognition device performs the following steps during the execution of step 7:
[0162] 10. Use the camera to collect the second image to be processed at a second time, wherein the time interval between the second time and the first time is the collection time interval.
[0163] In this step, the time interval between the second time and the first time is the acquisition time interval, that is, the acquisition time interval between the first image to be processed and the second image to be processed is the time interval acquired in step 9.
[0164] For example, the face recognition device collects the first time to be processed at 17:04:03 on December 23, 2020, that is, the first time is 17:04:03 on December 23, 2020. Assuming that the time interval is 1 second, the second time is 17:04:04 on December 23, 2020. That is, the face recognition device collects the second image to be processed at 17:04:04 on December 23, 2020.
[0165] If the first time is too short apart from the second time, and the activation condition is that both the first image to be processed and the second image to be processed contain the face to be detected, false activation is prone to occur. For example, Zhang San mistakenly entered the recognition area at 17:04:04 on December 23, 2020, and the face recognition device collected the first image to be processed at 17:04:04 on December 23, 2020. At this time, the first image to be processed contains Zhang San's face. Zhang San stayed in the recognition area for 3 seconds and then left the recognition area. The face recognition device collected the second image to be processed at 17:04:05 on December 23, 2020. At this time, the second image to be processed also contains Zhang San's face.
[0166] Since both the first image to be processed and the second image to be processed contain Zhang San's face, the face recognition device will be activated. However, Zhang San obviously does not want to be authenticated by the face recognition device. Therefore, the face recognition device will be activated by mistake.
[0167] If the first time is too long apart from the second time, the activation condition is that both the first and second processed images contain the face to be detected, which may lead to delayed activation. For example, Zhang San entered the recognition area at 17:04:04 on December 23, 2020, and walked to the face recognition device at 17:04:07 on December 23, 2020, waiting for verification by the face recognition device.
[0168] Assuming that the collection time interval is 5 seconds, then Zhang San needs to wait at least 2 seconds in front of the face recognition device before face recognition can be performed. Obviously, when the collection time interval is too long, it is easy to cause untimely activation.
[0169] In step 9 and step 10, by selecting a suitable value for the collection time interval, the probability of false activation and the probability of untimely activation can be reduced, thereby reducing the consumption of face recognition equipment and improving user experience.
[0170] As an optional implementation, before the face recognition device is activated, the following steps are further performed:
[0171] 11. Get the activation direction range.
[0172] In an embodiment of the present application, the activation direction range is used to determine whether the face to be detected is moving toward the face recognition device. In one possible implementation, the activation direction range may be an angle range. For example, the activation direction range is [-30°, 30°]. For ease of expression, in an embodiment of the present application, [α, β] represents a value interval greater than or equal to α and less than or equal to β.
[0173] In an implementation method of obtaining an activation direction range, a face recognition device receives an activation direction range input by a user through an input component to obtain the activation direction range.
[0174] In another implementation of obtaining the activation direction range, the face recognition device receives the activation direction range sent by the terminal to obtain the activation direction range.
[0175] In another implementation of acquiring the collection time interval, the activation direction range is stored in the face recognition device, and the face recognition device acquires the activation direction range by reading the activation direction range from a storage medium.
[0176] 12. According to the first image to be processed and the second image to be processed, the moving direction of the person corresponding to the face to be detected is obtained.
[0177] In the embodiment of the present application, the moving direction of the target object (i.e., the person corresponding to the face to be detected) may be the angle between the moving direction of the target object and the baseline of the face recognition device, wherein the baseline refers to a straight line parallel to the optical axis of the camera.
[0178] In a possible implementation, the face recognition device obtains a moving direction detection model before executing step 12. The face recognition device uses the moving direction detection model to process the first image to be processed and the second image to be processed to obtain the moving direction of the person corresponding to the face to be detected.
[0179] The moving direction detection model is obtained by training a deep learning model using moving direction training data. The moving direction training data includes at least one pair of images, each image pair includes two different images, and both images contain the same person. For example (Example 1), image pair a includes image A and image B. It is assumed that image A and image B both contain person b, and the position of person b in image A is different from the position of person b in image B. During the training process, the deep learning model obtains the moving direction of person b by processing image pair a.
[0180] Each image pair in the moving direction training data corresponds to a label information, where the label information is the moving direction of the person in the image pair. The segmentation results output by the deep learning model are supervised by the label information, the parameters of the deep learning model are updated, and the training of the deep learning model is completed.
[0181] For example, the electronic device uses a deep learning model to process the image pair a in Example 1 to obtain the moving direction of person b. Based on the loss obtained from the annotation information of the image pair a and the moving direction of person b, the parameters of the deep learning model are updated based on the loss, the training of the deep learning model is completed, and a moving direction detection model is obtained.
[0182] In another possible implementation, the face recognition device performs face detection processing on the first image to be processed to obtain the first position of the face to be detected in the first image to be processed. The face recognition device performs face detection processing on the second image to be processed to obtain the second position of the face to be detected in the second image to be processed. Since the first image to be processed and the second image to be processed are acquired by the same camera, the pixel coordinate system of the first image to be processed is the same as the pixel coordinate system of the second image to be processed. The point determined by the first position in the pixel coordinate system is referred to as the first point, and the point determined by the second position in the pixel coordinate system is referred to as the second point. The angle between the straight line passing through the first point and the second point and the longitudinal axis of the pixel coordinate system is determined as the moving direction of the target object.
[0183] 13. The above activation condition also includes that the above moving direction is within the above activation direction range.
[0184] In the embodiment of the present application, if the moving direction of the target object is within the activation direction range, it means that the target object is moving toward the face recognition device, that is, the probability that the target object needs to pass the verification of the face recognition device is high. Activating the face recognition device at this time can improve the recognition efficiency.
[0185] The moving direction of the target object is outside the activation direction range, which means that although the target object is in the recognition area, it is not moving towards the face recognition device, that is, the probability that the target object needs to pass the verification of the face recognition device is low. If the face recognition device is activated at this time, there is a high probability of false activation.
[0186] Therefore, in this step, taking the moving direction within the activation direction range as an activation condition can improve the recognition efficiency of the face recognition device.
[0187] As an optional implementation, the face recognition device performs the following steps during the process of executing step 4:
[0188] 14. Obtain the first infrared light quantity detected by the infrared sensor.
[0189] In the embodiment of the present application, the first infrared light amount is the infrared light amount detected by the infrared sensor in a working state. In a possible implementation, the face recognition device periodically obtains the infrared light amount detected by the infrared sensor from the infrared sensor.
[0190] In another possible implementation, the infrared sensor sends the detected amount of infrared light to a processor of the face recognition device in real time.
[0191] 15. When the first infrared light intensity is greater than the light intensity threshold, it is determined that the target object is within the recognition area, and the face recognition device is activated.
[0192] In the embodiment of the present application, the first infrared light amount is greater than the light amount threshold, indicating that the infrared sensor detects a person in the recognition area. Therefore, when the face recognition device determines that the first infrared light amount is greater than the light amount threshold, it is determined that there is a target object (i.e., a person) in the recognition area, and the face recognition device is activated. When the face recognition device determines that the first infrared light amount is less than the light amount threshold, the face recognition device is not activated. When the face recognition device determines that the first infrared light amount is equal to the light amount threshold, it is determined that there is no target object in the recognition area, and the face recognition device is not activated.
[0193] As an optional implementation, after determining that the first infrared light quantity is greater than the light quantity threshold and before determining that there is a target object in the recognition area, the face recognition device further performs the following steps:
[0194] 16. Start the camera and use it to capture a third image to be processed.
[0195] In the embodiment of the present application, the third image to be processed is different from the first image to be processed, and the third image to be processed is different from the second image to be processed.
[0196] 17. Obtain infrared light compensation amount based on the third image to be processed.
[0197] Since different colors have different absorption capabilities for infrared light, the color of a person's clothes may affect the detection accuracy of the infrared sensor. For example, black absorbs infrared light more strongly than white. If Zhang San and Li Si are both in the recognition area, and Zhang San is wearing black clothes and Li Si is wearing white clothes. Since black absorbs infrared light more strongly than white, the amount of infrared light emitted by the infrared sensor reflected by Zhang San is lower than the amount of infrared light reflected by Li Si. As a result, the infrared sensor can detect the presence of Li Si, but cannot detect the presence of Zhang San.
[0198] In this step, the infrared compensation amount is positively correlated with the infrared light absorption capacity of the color of the target object. The face recognition device obtains the color of the target object based on the third image to be processed, and corrects the detection result of the infrared sensor based on the color of the target object. Specifically, the face recognition device obtains the infrared light compensation amount based on the third image to be processed, and in subsequent processing, the infrared light compensation amount is used to correct the detection result of the infrared sensor.
[0199] In a possible implementation, before the face recognition device executes step 17, the face recognition device obtains an infrared light compensation amount detection network. The video stream processing device processes the third image to be processed using the infrared light compensation amount detection network to obtain the infrared light compensation amount.
[0200] The infrared light compensation amount detection network may be a convolutional neural network, and the convolutional neural network is trained by taking multiple images as training data, so that the trained convolutional neural network can obtain the infrared light compensation amount matching the image. The annotation information of the training data includes the infrared light compensation amount. The result output by the convolutional neural network is supervised by the annotation information, and the parameters of the convolutional neural network are updated to complete the training of the convolutional neural network.
[0201] 18. According to the infrared light compensation amount, correct the infrared light amount detected by the infrared sensor to obtain a second infrared light amount.
[0202] In one possible implementation, the face recognition device determines the sum of the infrared light compensation amount and the first infrared light amount to obtain the second infrared light amount. For example, the infrared light compensation amount is 10 lux, and the first infrared light amount is 30 lux. The face recognition device uses 10+30=40 lux as the second infrared light amount.
[0203] In another possible implementation, the face recognition device includes an infrared lamp, which is used for infrared fill light. The face recognition device determines the driving current of the infrared lamp according to the infrared light compensation amount. The face recognition device drives the infrared lamp with the driving current, and obtains the second infrared light amount detected by the infrared sensor as the second infrared light amount.
[0204] The face recognition device determines the driving current of the infrared lamp based on the infrared light compensation amount, and drives the infrared lamp with the driving current, which can achieve infrared fill light, thereby reducing the influence of the target object's clothing color on the detection accuracy of the infrared sensor.
[0205] After obtaining the second infrared light amount, the face recognition device determines that there is a target object in the recognition area, that is, there is a person in the recognition area, if it determines that the second infrared light amount is less than the light amount threshold. The face recognition device also determines that there is a target object in the recognition area, that is, there is a person in the recognition area, if it determines that the second infrared light amount is equal to the light amount threshold.
[0206] In the embodiment of the present application, the face recognition device can improve the detection accuracy of the infrared sensor by executing steps 16 to 18, thereby improving the recognition efficiency of the face recognition device.
[0207] As an optional implementation, the face recognition device further performs the following steps before performing step 17:
[0208] 19. Obtain the mapping relationship between color and infrared light compensation.
[0209] In the embodiment of the present application, the mapping relationship represents the mapping between color and infrared light compensation. In the mapping relationship, the color with stronger infrared light absorption ability has a larger infrared light compensation amount.
[0210] In an implementation method of acquiring the mapping relationship between color and infrared light compensation, a face recognition device receives the mapping relationship between color and infrared light compensation input by a user through an input component to acquire the mapping relationship between color and infrared light compensation.
[0211] In another implementation of acquiring the mapping relationship between color and infrared light compensation, the face recognition device receives the mapping relationship between color and infrared light compensation sent by the terminal to acquire the mapping relationship between color and infrared light compensation.
[0212] In another implementation of obtaining the mapping relationship between color and infrared light compensation, the mapping relationship between color and infrared light compensation is stored in the face recognition device. The face recognition device obtains the mapping relationship between color and infrared light compensation by reading the mapping relationship between color and infrared light compensation from a storage medium.
[0213] After obtaining the mapping relationship, the face recognition device performs the following steps during the execution of step 17:
[0214] 20. Perform feature extraction processing on the target object in the third image to be processed to obtain feature data.
[0215] In an embodiment of the present application, the feature data carries information including the color information of the target object. Feature extraction processing can be implemented through a deep learning model. By using multiple images with annotated information as training data, the deep learning model is trained so that the trained deep learning model can complete the feature extraction processing of the image. The annotation information of the image in the training data includes: the color information of the characters in the image. In the process of training the deep learning model using the training data, the deep learning model extracts the feature data of the image from the image, and determines the color information of the characters in the image based on the feature data. The annotation information is used as supervisory information to supervise the results obtained by the deep learning model during the training process, and the parameters of the deep learning model are updated to complete the training of the deep learning model. In this way, the face recognition device can use the trained deep learning model to perform feature extraction processing on the third image to obtain the feature data of the target object.
[0216] 21. Based on the above feature data, obtain the color of the above target object.
[0217] 22. Obtain infrared light compensation amount according to the above mapping relationship and the color of the above target object.
[0218] Based on the technical solution provided in the embodiment of the present application, the embodiment of the present application also provides a possible application scenario. With the development of face recognition technology, face recognition technology has been widely used in different application scenarios, among which confirming the identity of a person through face recognition is an important application scenario, for example, real-name authentication, identity authentication, etc. are performed through face recognition technology.
[0219] Face recognition technology extracts features from a face image obtained by capturing the face area of a person to obtain face feature data. The extracted face feature data is compared with the face feature data in a database to determine the identity of the person in the face image.
[0220] However, recently, there have been more and more incidents of using "non-living" face images to attack face recognition technology. The above-mentioned "non-living" face images include: paper photos, electronic images, etc. Using "non-living" face images to attack face recognition technology means replacing the face area of the person with a "non-living" face image to achieve the effect of deceiving face recognition technology. For example, Zhang San places a photo of Li Si in front of Li Si's mobile phone to perform face recognition unlocking. The mobile phone takes a photo of Li Si through a camera to obtain a face image containing Li Si's face area, and then determines that Zhang San's identity is Li Si, and unlocks the mobile phone. In this way, Zhang San successfully deceives the face recognition technology of the mobile phone by using Li Si's photo to unlock Li Si's mobile phone. It is of great significance to effectively prevent attacks on face recognition technology by "non-living" face images (hereinafter referred to as two-dimensional attacks).
[0221] With current technology, facial recognition devices based on RGB cameras and infrared cameras can achieve liveness detection, reducing the probability of "non-live" facial images attacking facial recognition technology.
[0222] Obviously, when no one needs to authenticate identity through face recognition technology, the infrared camera and the RGB camera do not need to work. Therefore, based on the technical solution provided in the embodiment of the present application, when it is detected that someone needs to authenticate identity (i.e., within the recognition area of the face recognition device), the face recognition device can be activated, which can reduce the energy consumption and consumption of the face recognition device, extend the service life of the face recognition device, and improve the recognition efficiency.
[0223] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0224] The method of the embodiment of the present application is described in detail above, and the device of the embodiment of the present application is provided below.
[0225] See also Figure 2 , Figure 2 A schematic diagram of the structure of a face recognition device provided in an embodiment of the present application. The face recognition device includes a camera 11, an infrared sensor 12, an acquisition unit 13, an activation unit 14, a first processing unit 15, a second processing unit 16, and a third processing unit 17. The face recognition device also includes:
[0226] An acquisition unit 13 is used to acquire the current environment brightness;
[0227] The activation unit 14 is used to adopt a corresponding activation strategy for the face recognition device according to the relationship between the ambient brightness and the brightness threshold, and the activation strategy includes activating the face recognition device using the camera and activating the face recognition device using the infrared sensor.
[0228] In combination with any embodiment of the present application, the activation unit 14 is specifically used for:
[0229] When the ambient brightness is greater than or equal to the brightness threshold, the camera is controlled to remain turned on and the infrared sensor is turned off, and the face recognition device is activated using the camera.
[0230] In combination with any embodiment of the present application, the activation unit 14 is specifically used for:
[0231] The camera is used to detect a target object within a recognition area and activate the face recognition device.
[0232] In combination with any embodiment of the present application, the activation unit 14 is specifically used for:
[0233] When the ambient brightness is less than the brightness threshold, the camera is turned off and the infrared sensor is turned on, and the face recognition device is activated by using the infrared sensor.
[0234] In combination with any embodiment of the present application, the activation unit 14 is specifically used for:
[0235] In response to the infrared sensor detecting a target object within the recognition area, the face recognition device is activated.
[0236] In combination with any embodiment of the present application, the activation unit 14 is specifically used for:
[0237] Using the camera to collect a first image to be processed, wherein a collection area of the camera is the recognition area;
[0238] When an activation condition is met, it is determined that the target object in the recognition area is detected, and the face recognition device is activated, wherein the activation condition includes determining that the first image to be processed contains a face to be detected.
[0239] In combination with any embodiment of the present application, the activation unit 14 is specifically used for:
[0240] Using the camera to collect a second image to be processed;
[0241] The activation condition also includes determining that the second image to be processed contains the face to be detected.
[0242] In combination with any embodiment of the present application, the acquisition time of the first image to be processed is a first time, and the acquisition unit 13 is further used to acquire an acquisition time interval before using the camera to acquire the second image to be processed;
[0243] The activation unit 14 is specifically used for:
[0244] The second image to be processed is acquired using the camera at a second time, wherein a time interval between the second time and the first time is the acquisition time interval.
[0245] In combination with any embodiment of the present application, the acquisition unit 13 is further configured to acquire an activation direction range before activating the face recognition device;
[0246] The face recognition device 1 also includes:
[0247] A first processing unit 15 is used to obtain a moving direction of the target object according to the first image to be processed and the second image to be processed;
[0248] The activation condition also includes that the moving direction is within the activation direction range.
[0249] In combination with any embodiment of the present application, the activation unit 14 is specifically used for:
[0250] Acquire a first infrared light quantity detected by the infrared sensor;
[0251] When the first infrared light quantity is greater than a light quantity threshold, it is determined that the target object is within the recognition area, and the face recognition device is activated.
[0252] In combination with any embodiment of the present application, the face recognition device 1 starts the camera 11 after the first infrared light amount is greater than the light amount threshold and before determining that the target object is in the recognition area, and uses the camera 11 to capture a third image to be processed;
[0253] The face recognition device 1 also includes:
[0254] A second processing unit 16 is used to obtain an infrared light compensation amount according to the third image to be processed;
[0255] A third processing unit 17 is used to correct the infrared light amount detected by the infrared sensor according to the infrared light compensation amount to obtain a second infrared light amount;
[0256] The activation unit 14 is specifically used for:
[0257] When the second infrared light quantity is less than or equal to the light quantity threshold, it is determined that the target object is within the recognition area.
[0258] In combination with any embodiment of the present application, the third processing unit 17 is specifically used for:
[0259] The sum of the infrared light compensation amount and the first infrared light amount is determined to obtain the second infrared light amount.
[0260] In combination with any embodiment of the present application, the face recognition device further includes an infrared lamp, and the third processing unit is specifically used for:
[0261] Determining a driving current of the infrared lamp according to the infrared light compensation amount;
[0262] The infrared lamp is driven by the driving current, and a second infrared light quantity detected by the infrared sensor is acquired as the second infrared light quantity.
[0263] In combination with any embodiment of the present application, the acquisition unit 13 is further configured to acquire a mapping relationship between color and infrared light compensation before obtaining the infrared light compensation amount according to the third image to be processed;
[0264] The third processing unit 17 is specifically used for:
[0265] Performing feature extraction processing on the target object in the third image to be processed to obtain feature data;
[0266] Obtaining the color of the target object according to the feature data;
[0267] An infrared light compensation amount is obtained according to the mapping relationship and the color of the target object.
[0268] In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0269] Figure 3 A schematic diagram of the hardware structure of a face recognition device provided in an embodiment of the present application. The face recognition device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 are coupled through a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present application. It should be understood that in each embodiment of the present application, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, it can be connected through various interfaces, transmission lines, buses, etc.
[0270] The processor 21 may include one or more processors, for example, one or more central processing units (CPUs). When the processor 21 is a CPU, the CPU may be a single-core CPU or a multi-core CPU.
[0271] The processor 21 is used to call the program code and data in the memory to execute the steps in the above method embodiment. For details, please refer to the description in the method embodiment, which will not be repeated here.
[0272] The memory 22 is used to store program codes and data of the network device.
[0273] The memory 22 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or portable read-only memory (CD-ROM), which is used for related instructions and data.
[0274] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The output device 24 and the input device 23 may be independent devices or an integrated device.
[0275] It can be understood that in the embodiment of the present application, the memory 22 can be used not only to store relevant instructions, but also to store relevant data. For example, the memory 22 can be used to store the current ambient brightness obtained through the input device 23. The embodiment of the present application does not limit the specific data stored in the memory.
[0276] Understandably, Figure 3 Only a simplified design of a face recognition device is shown. In practical applications, the face recognition device may also include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all face recognition devices that can implement the embodiments of the present application are within the protection scope of the present application.
[0277] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0278] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present application have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.
[0279] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0280] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0281] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0282] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0283] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
Claims
1. An activation method, characterized in that: The activation method is applied to a face recognition device, the face recognition device includes an infrared lamp, a camera and an infrared sensor, and the method includes: Get the current ambient brightness; According to the relationship between the ambient brightness and the brightness threshold, a corresponding activation strategy is adopted for the face recognition device, the activation strategy includes activating the face recognition device by using the camera and activating the face recognition device by using the infrared sensor; activating the face recognition device by using the infrared sensor includes: activating the face recognition device in response to the infrared sensor detecting a target object in a recognition area, the target object includes a person; In response to the infrared sensor detecting that there is a target object in the recognition area, activating the face recognition device includes: obtaining a first infrared light amount detected by the infrared sensor; when the first infrared light amount is greater than a light amount threshold, starting the camera and using the camera to capture a third image to be processed; Obtaining the mapping relationship between color and infrared light compensation; Obtaining an infrared light compensation amount according to the third image to be processed; obtaining the infrared light compensation amount according to the third image to be processed includes: performing feature extraction processing on the target object in the third image to be processed to obtain feature data; obtaining the color of the target object according to the feature data; obtaining the infrared light compensation amount according to the mapping relationship and the color of the target object; According to the infrared light compensation amount, the infrared light amount detected by the infrared sensor is corrected to obtain a second infrared light amount; the correcting the infrared light amount detected by the infrared sensor according to the infrared light compensation amount to obtain the second infrared light amount includes: determining the driving current of the infrared lamp according to the infrared light compensation amount; driving the infrared lamp with the driving current, and obtaining the second infrared light amount detected by the infrared sensor as the second infrared light amount; When the second infrared light quantity is less than or equal to the light quantity threshold, it is determined that the target object is within the recognition area, and the face recognition device is activated.
2. The method according to claim 1, characterized in that The adopting a corresponding activation strategy for the face recognition device according to the relationship between the ambient brightness and the brightness threshold comprises: When the ambient brightness is greater than or equal to the brightness threshold, the camera is controlled to remain turned on and the infrared sensor is turned off, and the face recognition device is activated using the camera.
3. The method according to claim 1 or 2, characterized in that: Activating the face recognition device using the camera includes: The camera is used to detect a target object within a recognition area and activate the face recognition device.
4. The method according to claim 1, characterized in that: The adopting a corresponding activation strategy for the face recognition device according to the relationship between the ambient brightness and the brightness threshold comprises: When the ambient brightness is less than the brightness threshold, the camera is turned off and the infrared sensor is turned on, and the face recognition device is activated by using the infrared sensor.
5. The method according to claim 4, characterized in that The step of detecting a target object within a recognition area using the camera and activating the face recognition device comprises: Using the camera to collect a first image to be processed, wherein a collection area of the camera is the recognition area; When an activation condition is met, it is determined that the target object in the recognition area is detected, and the face recognition device is activated, wherein the activation condition includes determining that the first image to be processed contains a face to be detected.
6. The method according to claim 5, characterized in that Before activating the face recognition device, the method further includes: Using the camera to collect a second image to be processed; The activation condition also includes determining that the second image to be processed contains the face to be detected.
7. A face recognition device, characterized in that: The face recognition device includes an infrared lamp, a camera and an infrared sensor, and the face recognition device also includes: An acquisition unit is used to obtain the current ambient brightness; an activation unit, configured to adopt a corresponding activation strategy for the face recognition device according to a relationship between the ambient brightness and the brightness threshold, wherein the activation strategy includes activating the face recognition device using the camera and activating the face recognition device using the infrared sensor; activating the face recognition device using the infrared sensor includes: activating the face recognition device in response to the infrared sensor detecting a target object in a recognition area, wherein the target object includes a person; In response to the infrared sensor detecting that there is a target object in the recognition area, activating the face recognition device includes: obtaining a first infrared light amount detected by the infrared sensor; when the first infrared light amount is greater than a light amount threshold, starting the camera and using the camera to capture a third image to be processed; Obtaining the mapping relationship between color and infrared light compensation; Obtaining an infrared light compensation amount according to the third image to be processed; obtaining the infrared light compensation amount according to the third image to be processed includes: performing feature extraction processing on the target object in the third image to be processed to obtain feature data; obtaining the color of the target object according to the feature data; obtaining the infrared light compensation amount according to the mapping relationship and the color of the target object; According to the infrared light compensation amount, the infrared light amount detected by the infrared sensor is corrected to obtain a second infrared light amount; the correcting the infrared light amount detected by the infrared sensor according to the infrared light compensation amount to obtain the second infrared light amount includes: determining the driving current of the infrared lamp according to the infrared light compensation amount; driving the infrared lamp with the driving current, and obtaining the second infrared light amount detected by the infrared sensor as the second infrared light amount; When the second infrared light quantity is less than or equal to the light quantity threshold, it is determined that the target object is within the recognition area, and the face recognition device is activated.
8. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and when the processor executes the computer instructions, the electronic device executes the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor is enabled to execute the method according to any one of claims 1 to 6.
