Face recognition method, terminal and computer-readable storage medium
By dynamically adjusting the camera frame rate to reduce the resource consumption of the camera and processor during the face recognition process, the problem of excessive hardware and CPU power consumption in the existing technology is solved, and efficient face recognition is achieved.
Patent Information
- Application Number
- CN201910557117.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-25
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2039-06-25
AI Technical Summary
Existing face recognition technology consumes too much power on hardware and CPU during the unlocking process, resulting in low efficiency.
By controlling the camera to obtain images of the first preset number of frames at the first frame rate, and determining if the unlocking is successful, if not successful, the frame rate is reduced to obtain images of the second preset number of frames for face recognition, reducing the resources of the camera and processor. consumption.
It effectively reduces the resource consumption of cameras and processors during the face recognition process, while ensuring the efficiency of face recognition.
Smart Images

Figure CN110263522B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic technology, and in particular to a face recognition method, a terminal and a computer-readable storage medium. Background Art
[0002] At present, the basic solution of face recognition is that the camera acquires images at a certain frequency, and then unlocks through the face recognition program. If the unlocking is successful within 5 seconds, the camera will be turned off quickly; if it fails, the camera will be turned off after 5 seconds. In most cases, the unlocking will be successful within 10 times of correct face recognition. However, the camera currently uses the same frame rate (for example, 30 frames / second) to acquire images and match the unlocking process, which requires about 150 matches in total, which will greatly increase the power consumption of the hardware (camera) and CPU. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a face recognition method, a terminal and a computer storage medium, so that the terminal can reduce the consumption of hardware and processor resources during the face recognition process.
[0004] To solve the above problems, the present invention provides a face recognition method, which is applied to a terminal, and the method includes: controlling a camera to acquire a first preset number of frames of images at a first frame rate; determining whether unlocking is successful using the first preset number of frames of images; if unsuccessful, controlling the camera to acquire a second preset number of frames of images at a second frame rate; and performing face recognition based on the second preset number of frames of images.
[0005] Optionally, before the step of controlling the camera to acquire a first preset number of frames of images at a first frame rate, the step also includes: determining whether the terminal is in a locked state; and if so, starting the camera.
[0006] Optionally, after the step of controlling the camera to acquire a first preset number of frames of images at a first frame rate, the method further includes: a face recognition program on the terminal unlocking the terminal using the first preset number of frames of images.
[0007] Optionally, the step of using the first preset number of frames of images for unlocking by the face recognition program on the terminal specifically includes: the face recognition program loads the first preset number of frames of images, and compares the first preset number of frames of images with pre-stored standard images.
[0008] Optionally, the step of determining whether the unlocking is successful using the first preset number of frames of images specifically includes: determining whether the system enters the user main interface; if so, determining that the unlocking is successful using the first preset number of frames of images.
[0009] Optionally, the second frame rate is lower than the first frame rate.
[0010] Optionally, the camera further includes an unlocking deadline, and the unlocking deadline is used to forcibly terminate the face recognition.
[0011] Optionally, performing face recognition based on the second preset number of frames of images also includes: when the time for acquiring the first preset number of frames of images and the time for acquiring the second preset number of frames of images exceed the unlocking deadline, ending the face recognition.
[0012] Furthermore, the present invention also provides a terminal, which also includes: a memory, a communication bus and a processor, wherein: the memory is used to store a face recognition program; the communication bus is used to realize the connection and communication between the processor and the memory; the processor is used to execute the face recognition program stored in the memory to realize the steps described above.
[0013] Furthermore, the present invention also provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the face recognition method as described in any of the above items.
[0014] By implementing the above solution, the terminal can ensure the efficiency of face recognition and reduce the consumption of terminal camera hardware and processor processing resources when performing face recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In the accompanying drawings (which are not necessarily drawn to scale), like reference numerals may describe similar components in different views. Like reference numerals with different letter suffixes may represent different examples of similar components. The accompanying drawings generally illustrate various embodiments discussed herein by way of example and not limitation.
[0016] Figure 1 A schematic diagram of the hardware structure of a terminal for implementing various embodiments of the present invention;
[0017] Figure 2 A communication network system architecture diagram provided for an embodiment of the present invention;
[0018] Figure 3 A schematic diagram of a face recognition method of the present invention;
[0019] Figure 4 A schematic diagram of a module of a terminal of the present invention;
[0020] Figure 5 The present invention is a schematic diagram of a terminal structure. DETAILED DESCRIPTION
[0021] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0022] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0023] The terminal may be implemented in various forms. For example, the terminal described in the present invention may include mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, terminals, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.
[0024] The following description will be made by taking a terminal as an example, and those skilled in the art will appreciate that, in addition to components specifically used for mobile purposes, the configuration according to the embodiments of the present invention can also be applied to fixed-type terminals.
[0025] See also Figure 1 , which is a schematic diagram of the hardware structure of a terminal for implementing various embodiments of the present invention, the terminal 100 may include: a radio frequency (RF) unit 101, a WiFi module 102, an audio output unit 103, an A / V (audio / video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art can understand that Figure 1 The mobile terminal structure shown in the figure does not constitute a limitation on the mobile terminal, and the terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0026] Combine the following Figure 1 The components of the terminal 100 are described in detail:
[0027] The radio frequency unit 101 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving the downlink information of the base station, it is sent to the processor 110 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 101 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 101 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobilecommunication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access 2000 (CDMA2000), Wideband Code Division Multiple Access (WCDMA), Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), Frequency Division Duplexing-Long Term Evolution (FDD-LTE) and Time Division Duplexing-Long Term Evolution (TDD-LTE), etc.
[0028] WiFi is a short-range wireless transmission technology. Mobile terminals can help users send and receive emails, browse web pages, and access streaming media through WiFi module 102. It provides users with wireless broadband Internet access. Figure 1 The WiFi module 102 is shown, but it is understandable that it is not an essential component of the mobile terminal and can be omitted as required without changing the essence of the invention.
[0029] The audio output unit 103 can convert the audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, etc. Moreover, the audio output unit 103 can also provide audio output related to a specific function performed by the terminal 100 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, etc.
[0030] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processor (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 106. The image frame processed by the graphics processor 1041 can be stored in the memory 109 (or other storage medium) or sent via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a telephone call mode, a recording mode, a voice recognition mode, and other operating modes, and can process such sound into audio data. The processed audio (voice) data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 can implement various types of noise elimination (or suppression) algorithms to eliminate (or suppress) noise or interference generated in the process of receiving and sending audio signals.
[0031] The terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can also be configured on the mobile phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0032] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0033] The user input unit 107 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1071 or near the touch panel 1071 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 110, and can receive and execute the command sent by the processor 110. In addition, the touch panel 1071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, etc., which are not specifically limited here.
[0034] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of the touch event. Then, the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Figure 1 In the figure, the touch panel 1071 and the display panel 1061 are used as two independent components to implement the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to implement the input and output functions of the terminal, which is not limited here.
[0035] The interface unit 108 serves as an interface through which at least one external device can be connected to the terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal 100 or may be used to transmit data between the terminal 100 and an external device.
[0036] The memory 109 can be used to store software programs and various data. The memory 109 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 109 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0037] The processor 110 is the control center of the mobile terminal. It uses various interfaces and lines to connect various parts of the entire mobile terminal. It executes various functions of the mobile terminal and processes data by running or executing software programs and / or modules stored in the memory 109, and calling data stored in the memory 109, so as to monitor the mobile terminal as a whole. The processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 110.
[0038] The terminal 100 may also include a power supply 111 (such as a battery) for supplying power to various components. Preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0039] although Figure 1 Not shown, the terminal 100 may also include a Bluetooth module, etc., which will not be described in detail here.
[0040] To facilitate understanding of the embodiments of the present invention, the communication network system on which the terminal of the present invention is based is described below.
[0041] See also Figure 2 , Figure 2 A communication network system architecture diagram is provided for an embodiment of the present invention. The communication network system is an LTE system of universal mobile communication technology. The LTE system includes a user equipment (UE) 201, an evolved UMTS terrestrial radio access network (Evolved UMTS Terrestrial Radio Access Network, E-UTRAN) 202, an evolved packet core network (Evolved Packet Core, EPC) 203 and an operator's IP service 204 which are sequentially connected for communication.
[0042] Generally, UE201 may be the above-mentioned terminal 100, which will not be described in detail here.
[0043] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 , etc. Among them, eNodeB 2021 can be connected to other eNodeBs 2022 through a backhaul (eg, an X2 interface), and eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 can provide UE 201 with access to EPC 203 .
[0044] EPC203 may include Mobility Management Entity (MME) 2031, Home Subscriber Server (HSS) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, PGW (PDN Gate Way) 2035 and Policy and Charging Rules Function (PCRF) 2036, etc. Among them, MME2031 is a control node that processes signaling between UE201 and EPC203, and provides bearer and connection management. HSS2032 is used to provide some registers to manage functions such as home location register (not shown in the figure), and save some user-specific information such as service features and data rates. All user data can be sent through SGW2034, PGW2035 can provide IP address allocation and other functions for UE 201, PCRF2036 is the policy and charging control policy decision point for service data flow and IP bearer resources, which selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).
[0045] The IP service 204 may include the Internet, an intranet, an IP Multimedia Subsystem (IMS), or other IP services.
[0046] Although the above description is made by taking the LTE system as an example, those skilled in the art should know that the present invention is not only applicable to the LTE system, but also applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA and future new network systems, etc., which are not limited here. Based on the above terminal hardware structure and communication network system, various embodiments of the method of the present invention are proposed.
[0047] Figure 3The flowchart of the face recognition method in the embodiment of the present invention is applied to a terminal. It can be understood that the flowchart in the embodiment of the method is not used to limit the order of executing the steps.
[0048] like Figure 3 As shown, the method comprises the following steps:
[0049] Step S300: Control the camera to acquire a first preset number of frames of images at a first frame rate.
[0050] In this embodiment, the terminal performs face recognition, and generally needs to obtain a certain number of face images through the camera on the terminal as the basis for face recognition. Therefore, before controlling the camera to obtain face images, it is also necessary to determine whether the terminal is in a locked state. If the terminal is already in an unlocked state at this time, the camera module of the terminal will not be actively mobilized to start at this time. Of course, if the terminal is in a locked state at this time, the camera will be started to prepare for obtaining the corresponding image. In this embodiment, the first frame rate is preferably 30 frames / second, and the first preset number of frames is preferably 30 frames. Furthermore, after controlling the camera to obtain the first preset number of frames of images, the face recognition program on the terminal will also use the obtained first preset number of frames of images to unlock. Specifically, after loading the first number of frames of images, the face recognition program will match and compare the first number of frames of images with the pre-stored standard images. If the matching result exceeds a certain threshold, it is determined that the unlocking is successful, wherein the so-called standard image is a face image pre-stored by the user.
[0051] Step S302, determining whether unlocking is successful using the first preset number of frames of images.
[0052] In an embodiment of the present invention, the step of determining whether the unlocking is successful using the first preset number of frames of images specifically includes: determining whether the system enters the user main interface; if so, determining that the unlocking is successful using the first preset number of frames of images. For example, if the terminal system enters the system main interface, such as the system main screen, it means that the terminal is unlocked successfully.
[0053] Step S304: If unsuccessful, control the camera to acquire a second preset number of frames of images at a second frame rate.
[0054] In the embodiment of the present invention, the second frame rate is less than the first frame rate. For example, if the first frame rate is 30 frames per second, the second frame rate can be selected as 15 frames per second. Of course, the values of the first frame rate and the second frame rate can be set according to specific circumstances, as long as the second frame rate is less than the first frame rate. If the first preset number of frames is 30 frames, the second preset number of frames can be 45 frames.
[0055] Step S306: performing face recognition based on the second preset number of frames of images.
[0056] In this embodiment, the system is also provided with an unlocking deadline, wherein the unlocking deadline is used to forcibly end face recognition. For example, if the unlocking deadline is 5 seconds, the face recognition process will end after the unlocking lasts for 5 seconds, regardless of whether the unlocking is successful or not.
[0057] In this embodiment, once the first frame rate, the second frame rate, and the first preset number are determined, the second preset number of frames can be determined according to the unlocking forced time. For example, the first frame rate is 30 frames / second, the second frame rate is 15 frames / second, the first preset number of frames is 30 frames, and the unlocking deadline is 5 seconds, then the second preset number of frames is 60 frames. In this way, compared with acquiring images at a constant first frame rate, the total number of frames is reduced from 150 frames to 90 frames, which reduces the number of camera operations and the image processing burden of the processor. Based on the above analysis, once the entire process, that is, the time to acquire the first preset number of frame images and the time to acquire the second preset number of frame images exceeds the unlocking deadline, the above face recognition is terminated.
[0058] By implementing the above-mentioned face recognition method, the terminal can achieve the effect of face recognition during the face recognition process, and can also effectively reduce the loss of the camera and the processing burden of the processor.
[0059] Figure 4 The module diagram of a terminal of the present invention includes a first control module 400, a judgment module 402, a second control module 404, an unlocking module 406, a memory 408 and a processor 410. The above program modules are stored in the memory 408 in the form of program codes and executed by the processor 410 to implement the steps or methods of the above embodiments.
[0060] The first control module 400 is used to control the camera to acquire a first preset number of frames of images at a first frame rate.
[0061] In this embodiment, the terminal performs face recognition, and generally needs to obtain a certain number of face images through the camera on the terminal as the basis for face recognition. Therefore, before controlling the camera to obtain face images, it is also necessary to determine whether the terminal is in a locked state. If the terminal is already in an unlocked state at this time, the camera module of the terminal will not be actively mobilized to start at this time. Of course, if the terminal is in a locked state at this time, the camera will be started to prepare for obtaining the corresponding image. In this embodiment, the first frame rate is preferably 30 frames / second, and the first preset number of frames is preferably 30 frames. Furthermore, after controlling the camera to obtain the first preset number of frames of images, the face recognition program on the terminal will also use the obtained first preset number of frames of images to unlock. Specifically, after loading the first number of frames of images, the face recognition program will match and compare the first number of frames of images with the pre-stored standard images. If the matching result exceeds a certain threshold, it is determined that the unlocking is successful, wherein the so-called standard image is a face image pre-stored by the user.
[0062] The determination module 402 is used to determine whether the unlocking is successful using the first preset number of frames of images.
[0063] In an embodiment of the present invention, the step of determining whether the unlocking is successful using the first preset number of frames of images specifically includes: determining whether the system enters the user main interface; if so, determining that the unlocking is successful using the first preset number of frames of images. For example, if the terminal system enters the system main interface, such as the system main screen, it means that the terminal is unlocked successfully.
[0064] The second control module 404 is used to control the camera to acquire a second preset number of frames of images at a second frame rate when unlocking is unsuccessful.
[0065] In the embodiment of the present invention, the second frame rate is less than the first frame rate. For example, if the first frame rate is 30 frames per second, the second frame rate can be selected as 15 frames per second. Of course, the values of the first frame rate and the second frame rate can be set according to specific circumstances, as long as the second frame rate is less than the first frame rate. If the first preset number of frames is 30 frames, the second preset number of frames can be 45 frames.
[0066] The unlocking module 406 is configured to perform face recognition based on the second preset number of frames of images.
[0067] In this embodiment, the system is also provided with an unlocking deadline, wherein the unlocking deadline is used to forcibly end face recognition. For example, if the unlocking deadline is 5 seconds, the face recognition process will end after the unlocking lasts for 5 seconds, regardless of whether the unlocking is successful or not.
[0068] In this embodiment, once the first frame rate, the second frame rate, and the first preset number are determined, the second preset number of frames can be determined according to the unlocking forced time. For example, the first frame rate is 30 frames / second, the second frame rate is 15 frames / second, the first preset number of frames is 30 frames, and the unlocking deadline is 5 seconds, then the second preset number of frames is 60 frames. In this way, compared with acquiring images at a constant first frame rate, the total number of frames is reduced from 150 frames to 90 frames, which reduces the number of camera operations and the image processing burden of the processor. Based on the above analysis, once the entire process, that is, the time to acquire the first preset number of frame images and the time to acquire the second preset number of frame images exceeds the unlocking deadline, the above face recognition is terminated.
[0069] By implementing the above-mentioned face recognition method, the terminal can achieve the effect of face recognition during the face recognition process, and can also effectively reduce the loss of the camera and the processing burden of the processor.
[0070] Figure 5 FIG. 1 is a schematic diagram of the structure of the terminal of the present invention. Figure 5 As shown, the terminal at least includes: a memory 501, a communication bus 502 and a processor 503. Among them:
[0071] The memory 501 is used to store the face recognition program;
[0072] The communication bus 502 is used to realize the connection and communication between the processor and the memory;
[0073] The processor 503 is used to execute the face recognition program stored in the memory to implement the following steps:
[0074] The camera is controlled to acquire a first preset number of frames of images at a first frame rate.
[0075] In this embodiment, the terminal performs face recognition, and generally needs to obtain a certain number of face images through the camera on the terminal as the basis for face recognition. Therefore, before controlling the camera to obtain face images, it is also necessary to determine whether the terminal is in a locked state. If the terminal is already in an unlocked state at this time, the camera module of the terminal will not be actively mobilized to start at this time. Of course, if the terminal is in a locked state at this time, the camera will be started to prepare for obtaining the corresponding image. In this embodiment, the first frame rate is preferably 30 frames / second, and the first preset number of frames is preferably 30 frames. Furthermore, after controlling the camera to obtain the first preset number of frames of images, the face recognition program on the terminal will also use the obtained first preset number of frames of images to unlock. Specifically, after loading the first number of frames of images, the face recognition program will match and compare the first number of frames of images with the pre-stored standard images. If the matching result exceeds a certain threshold, it is determined that the unlocking is successful, wherein the so-called standard image is a face image pre-stored by the user.
[0076] Determine whether unlocking is successful using the first preset number of frames of images.
[0077] In an embodiment of the present invention, the step of determining whether the unlocking is successful using the first preset number of frames of images specifically includes: determining whether the system enters the user main interface; if so, determining that the unlocking is successful using the first preset number of frames of images. For example, if the terminal system enters the system main interface, such as the system main screen, it means that the terminal is unlocked successfully.
[0078] If unsuccessful, the camera is controlled to acquire a second preset number of frames of images at a second frame rate.
[0079] In the embodiment of the present invention, the second frame rate is less than the first frame rate. For example, if the first frame rate is 30 frames per second, the second frame rate can be selected as 15 frames per second. Of course, the values of the first frame rate and the second frame rate can be set according to specific circumstances, as long as the second frame rate is less than the first frame rate. If the first preset number of frames is 30 frames, the second preset number of frames can be 45 frames.
[0080] Face recognition is performed based on the second preset number of frames of images.
[0081] In this embodiment, the system is also provided with an unlocking deadline, wherein the unlocking deadline is used to forcibly end face recognition. For example, if the unlocking deadline is 5 seconds, the face recognition process will end after the unlocking lasts for 5 seconds, regardless of whether the unlocking is successful or not.
[0082] In this embodiment, once the first frame rate, the second frame rate, and the first preset number are determined, the second preset number of frames can be determined according to the unlocking forced time. For example, the first frame rate is 30 frames / second, the second frame rate is 15 frames / second, the first preset number of frames is 30 frames, and the unlocking deadline is 5 seconds, then the second preset number of frames is 60 frames. In this way, compared with acquiring images at a constant first frame rate, the total number of frames is reduced from 150 frames to 90 frames, which reduces the number of camera operations and the image processing burden of the processor. Based on the above analysis, once the entire process, that is, the time to acquire the first preset number of frame images and the time to acquire the second preset number of frame images exceeds the unlocking deadline, the above face recognition is terminated.
[0083] By implementing the above-mentioned face recognition method, the terminal can achieve the effect of face recognition during the face recognition process, and can also effectively reduce the loss of the camera and the processing burden of the processor.
[0084] The present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a face recognition program, and the face recognition program implements the above steps when executed by a processor.
[0085] It should be noted that the description of the above terminal embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the terminal embodiment of the present invention, please refer to the description of the method embodiment of the present invention for understanding.
[0086] It should be noted that in the embodiment of the present invention, if the above-mentioned face recognition method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computing device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present invention is not limited to any specific combination of hardware and software.
[0087] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0088] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0090] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0091] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0092] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0093] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A face recognition method, applied to a terminal, characterized in that: The method comprises: Controlling the camera to acquire a first preset number of frames of images at a first frame rate; The face recognition program on the terminal uses the first preset number of frames of images to unlock the phone; The step of unlocking the face using the first preset number of frames of images by the face recognition program on the terminal specifically includes: The face recognition program loads the first preset number of frames of images and compares the first preset number of frames of images with pre-stored standard images; Determining whether unlocking is successful using the first preset number of frames of images; If unsuccessful, controlling the camera to acquire a second preset number of frames of images at a second frame rate; performing face recognition based on the second preset number of frames of images; The second frame rate is less than the first frame rate; The camera further includes an unlocking deadline, wherein the unlocking deadline is used to forcibly terminate the face recognition; The performing face recognition based on the second preset number of frames of images further includes: When the time for acquiring the first preset number of image frames and the time for acquiring the second preset number of image frames exceed the unlocking deadline, the face recognition is terminated.
2. The face recognition method according to claim 1, wherein: Before the step of controlling the camera to acquire a first preset number of frames of images at a first frame rate, the step further includes: Determining whether the terminal is in a locked state; If so, the camera is activated.
3. The face recognition method according to claim 1, wherein: The step of determining whether unlocking is successful using the first preset number of frames of images specifically includes: Determine whether the system has entered the user main interface; If so, it is determined that the unlocking is successful using the first preset number of frames of images.
4. A terminal, characterized in that: The terminal further includes at least: a memory, a communication bus, and a processor, wherein: The memory is used to store the face recognition program; The communication bus is used to realize the connection and communication between the processor and the memory; The processor is configured to execute the face recognition program stored in the memory to implement the steps of the face recognition method according to any one of claims 1 to 3.
5. A computer-readable storage medium having a face recognition program stored thereon, wherein the face recognition program, when executed by a processor, implements the steps of the face recognition method according to any one of claims 1 to 3.
