Face recognition method and device, electronic equipment and storage medium
By increasing the emission power of the infrared light source to a target value within a safe range when the screen breaks, the problem of unclear facial image acquisition after screen breakage is solved, the recognition accuracy is improved and the safety of human eyes is ensured.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI JINSHENG COMM TECH CO LTD
- Filing Date
- 2022-12-29
- Publication Date
- 2026-06-12
Smart Images

Figure CN118279942B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of facial recognition technology, and in particular to a facial recognition method, device, electronic device and storage medium. Background Technology
[0002] Facial recognition is a biometric technology that identifies individuals based on their facial features. It involves using cameras or webcams to capture images or video streams containing faces, automatically detecting and tracking faces within the images, and then performing facial recognition on the detected faces. This technology is also commonly referred to as portrait recognition or face recognition.
[0003] In related technologies, to overcome the influence of changes in lighting, facial recognition functions in electronic devices generally use infrared image-based facial recognition technology to ensure accuracy, stability, and efficiency. However, facial recognition components are typically deployed below the screen of electronic devices. If the screen above the facial recognition components cracks due to external damage, the infrared light emitted by the infrared light source in the facial recognition component at its original transmission power will be insufficient to detect facial information, thus affecting the operation of the facial recognition function. Summary of the Invention
[0004] This application proposes a face recognition method, device, electronic device, and storage medium to improve the accuracy and security of face recognition.
[0005] In a first aspect, embodiments of this application provide a face recognition method applied to an electronic device. The electronic device includes a screen, a target light source, and an image acquisition unit. The screen includes a first region, and the target light source and the image acquisition unit are correspondingly configured with respect to the first region. The method includes: responding to a face recognition command, detecting the integrity of the first region; if a break is detected in the first region, increasing the current emission power of the target light source to a first target power, wherein the first target power is less than a first power threshold; controlling the target light source to emit light at the first target power, and acquiring a first face image in the environment through the image acquisition unit; and performing face recognition based on the first face image.
[0006] Secondly, embodiments of this application provide a face recognition device. The electronic device includes a screen, a target light source, and an image acquisition unit. The screen includes a first area, and the target light source and the image acquisition unit are correspondingly arranged with respect to the first area. The device includes: an integrity detection module, a power adjustment module, an image acquisition module, and a face recognition module. The integrity detection module is used to detect the integrity of the first area in response to a face recognition command. The power adjustment module is used to increase the current emission power of the target light source to a first target power, where the first target power is less than a first power threshold, if a break is detected in the first area. The image acquisition module is used to control the target light source to emit light at the first target power and to acquire a first face image in the environment through the image acquisition unit. The face recognition module is used to perform face recognition based on the first face image.
[0007] Thirdly, embodiments of this application provide an electronic device, including: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to perform the methods described above.
[0008] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code that can be invoked by a processor to execute the methods described above.
[0009] In the solution provided in this application, in response to a face recognition command, the integrity of a first region is detected. If a crack is detected in the first region, the current emission power of the target light source is increased to a first target power, which is less than a first power threshold. The target light source is controlled to emit light at the first target power, and a first face image in the environment is acquired through an image acquisition unit. Face recognition is then performed based on the first face image. Thus, when a crack is detected in the first region corresponding to the target light source and the image acquisition unit on the screen, increasing the emission power of the target light source improves the clarity of the acquired face image, thereby avoiding situations where the acquired face image is partially obscured and has low clarity due to damage to the first region, leading to face recognition failure or inaccuracy. Furthermore, the increased emission power of the target light source is less than the first power threshold, preventing excessive energy from the emitted light exceeding human eye safety standards and causing eye damage during face recognition, thus further ensuring the safety of the eye recognition process. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 A flowchart illustrating a face recognition method provided in an embodiment of this application is shown.
[0012] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown.
[0013] Figure 3 A flowchart illustrating a face recognition method provided in another embodiment of this application is shown.
[0014] Figure 4 It shows Figure 3 A flowchart illustrating a sub-step of step S210 in one embodiment.
[0015] Figure 5 It shows Figure 3 A flowchart illustrating a sub-step of step S210 in another embodiment.
[0016] Figure 6 A flowchart illustrating a face recognition method provided in another embodiment of this application is shown.
[0017] Figure 7 This is a block diagram of a face recognition device according to an embodiment of this application.
[0018] Figure 8 This is a block diagram of an electronic device for performing a face recognition method according to an embodiment of this application.
[0019] Figure 9 This is a storage unit in this application embodiment for storing or carrying program code that implements the face recognition method according to this application embodiment. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.
[0021] It should be noted that some processes described in the specification, claims, and accompanying drawings of this application include multiple operations that appear in a specific order. These operations may not be performed in the order they appear herein, or they may be performed in parallel. Operation numbers such as S110, S120, etc., are merely used to distinguish different operations and do not represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be performed sequentially or in parallel. Also, the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or server that includes a series of steps or sub-modules is not necessarily limited to those steps or sub-modules that are explicitly listed, but may include other steps or sub-modules that are not explicitly listed or that are inherent to such process, method, product, or device.
[0022] The inventors propose a face recognition method, device, electronic device, and storage medium. Before performing face recognition, if a crack is detected in a first area of the screen, the current emission power of the target light source is increased within a safe range for human eyes, and then a face image is acquired for face recognition. The face recognition method provided in the embodiments of this application is described in detail below.
[0023] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a face recognition method according to an embodiment of this application, applied to an electronic device. The electronic device includes a screen, a target light source, and an image acquisition unit. The screen includes a first area, and the target light source and the image acquisition unit are correspondingly configured with respect to the first area. The following will be combined with... Figure 1 The face recognition method provided in this application embodiment is described in detail. This face recognition method may include the following steps:
[0024] Step S110: In response to the face recognition command, detect the integrity of the first region.
[0025] In this embodiment, the electronic device can be an electronic terminal with data processing capabilities, including but not limited to smartphones, tablets, laptops, desktop computers, smartwatches, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, and MP4 (Moving Picture Experts Group Audio Layer IV) players.
[0026] In practical applications, to increase the screen-to-body ratio of electronic devices and truly achieve a full-screen display, the facial recognition component is typically placed below the screen. This means the target light source and image acquisition unit are located below the screen; in other words, facial recognition is achieved through under-display technology. In this case, the screen can be divided into a first area and a second area. The first area corresponds to the target light source and image acquisition unit, while the second area comprises all other areas of the screen besides the first area.
[0027] Optionally, please refer to Figure 2 The electronic device 10 includes a screen 101, a target light source 102, and an image acquisition unit 103. The target light source 102 and the image acquisition unit 103 are both located below the screen 101. The area enclosed by the dotted line in the screen 101 above the image acquisition unit 103 and the target light source is the first area 104. The other areas in the screen 101 besides the first area 104 are the second area 105.
[0028] Understandably, if the first region is cracked under external force, the face image captured by the image acquisition unit directly below the first region will be obstructed, leading to face recognition failure. Therefore, upon receiving a face recognition command, the integrity of the first region can be checked first, i.e., whether the first region is cracked.
[0029] The facial recognition command can be triggered by the user lifting up to wake up the electronic device, by the user clicking on the screen of the electronic device, by the user pressing a physical button on the electronic device, by the user issuing a facial recognition voice, or by the user initiating a payment operation. This embodiment does not limit this, that is, other ways that can be used to trigger the facial recognition function of the electronic device are also within the scope of protection of this application.
[0030] Step S120: If a crack is detected in the first region, the current emission power of the target light source is increased to a first target power, where the first target power is less than a first power threshold.
[0031] In this embodiment, the target light source can generally be an infrared light source, such as an infrared light emitter. Correspondingly, the image acquisition unit is also an infrared camera. The image acquired by the image acquisition unit is an infrared image, which is the image formed by the radiation of an object emitted by the infrared light source in the infrared band. The principle is based on the intensity of the infrared light reflected by the object. That is, the greater the intensity of the infrared light reflected by the object, the clearer the infrared image, meaning the more useful information it contains, which is more beneficial for image recognition.
[0032] Therefore, if a break is detected in the first region, the captured face image will be partially obscured. This can be addressed by increasing the current emission power of the target light source to a first target power, thereby increasing the intensity of infrared light reflected from the face. This makes the unobscured portion of the face in the captured image clearer, containing more useful information, and ultimately improving the success rate of face recognition based on the captured image. The first target power is less than a first power threshold, calculated based on the critical value for laser light reaching the human eye's safety standard. Controlling the target light source to emit laser light at a first target power lower than the first power threshold avoids problems such as eye damage from the emitted laser light.
[0033] The first target power can be a preset power value or a value adjusted according to a preset power adjustment algorithm. That is, the current transmission power can be gradually increased multiple times, ensuring that the power value after each increase is less than the first power threshold. The current transmission power can be understood as the luminous power of the target light source. Therefore, increasing the current transmission power of the target light source can be achieved by increasing the driving current or driving voltage through the target light source, etc. This embodiment does not impose any limitations on this.
[0034] Step S130: Control the target light source to emit light at the first target power, and acquire the first face image in the environment through the image acquisition unit.
[0035] Furthermore, the electronic device can control the target light source to emit infrared laser at a first target power, and then acquire a first face image in the environment through the image acquisition unit. The first face image is a face image of the target user within the shooting range of the image acquisition unit, and the target user can be a user whose relative distance to the electronic device is less than a preset distance.
[0036] Step S140: Perform face recognition based on the first face image.
[0037] Finally, after obtaining the first face image, facial recognition of the target user can be performed using the first face image. Specifically, the first face image is matched with each preset face image in a preset face image set in the electronic device. If no preset face image matches the first face image, it is determined that the target user does not have the authority to operate the electronic device. If a preset face image matches the first face image, it is preliminarily determined that the target user has the authority to operate the electronic device. Further, to improve the accuracy of face recognition, since the first face image is a 2D infrared image, the speckle image acquired by the infrared camera has been processed to calculate the depth information of each pixel in the face image, thus obtaining a face depth map corresponding to the first face image. Then, this face depth map is matched against each preset face depth image in the preset face depth image set. If any preset face depth image matches the face depth map corresponding to the first face image, it is determined that the target user has the authority to operate the electronic device; if no preset face depth image matches the face depth map corresponding to the first face image, it is determined that the target user does not have the authority to operate the electronic device.
[0038] In some implementations, the image acquisition unit can be pre-set to acquire multiple first face images from the environment. This means the image acquisition unit is controlled to acquire face images multiple times within a preset time period. Each first face image can then be matched against each preset face image in a preset face image set, performing multiple face matching operations. In each matching operation, a preset face image will match a first face image, thus initially determining whether the target user has the necessary operating permissions for the electronic device. This improves the accuracy of face recognition and reduces the occurrence of false recognition problems.
[0039] In some implementations, if face recognition based on the first face image fails, a first prompt message is output. This first prompt message indicates that face recognition cannot be enabled at this time. The failure to recognize a face does not necessarily mean that the target user lacks the necessary permissions to operate the electronic device. Rather, it means that the electronic device fails to match the first face image with a preset face image from a preset face image set. In other words, the first face image contains too little useful information; for example, a large occluded area in the first face image prevents image matching. Optionally, in addition to indicating that face recognition cannot be enabled, the first prompt message may also indicate that the first area of the electronic device's screen is cracked and should be repaired promptly, and may prompt the user to authenticate using other authentication methods. These other authentication methods include at least voiceprint verification, fingerprint verification, and password verification, and this embodiment does not limit this.
[0040] In this embodiment, when a crack is detected in the first area on the screen corresponding to the target light source and the image acquisition unit, increasing the emission power of the target light source can improve the clarity of the acquired face image. This avoids situations where the acquired face image is partially obscured and has low clarity due to damage to the first area, leading to face recognition failure or inaccuracy. Furthermore, the increased emission power of the target light source is less than the first power threshold, preventing excessive energy from the emitted light exceeding human eye safety standards and causing eye damage during face recognition. This further ensures the safety of the eye recognition process.
[0041] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating a face recognition method according to another embodiment of this application, applied to an electronic device. The electronic device includes a screen, a target light source, and an image acquisition unit. The screen includes a first area, and the target light source and the image acquisition unit are correspondingly configured with respect to the first area. The following will be combined with... Figure 3 The face recognition method provided in this application embodiment is described in detail. This face recognition method may include the following steps:
[0042] Step S210: In response to the face recognition command, detect the integrity of the first region.
[0043] In this embodiment, the screen includes a display panel and a cover plate corresponding to the display panel. The display panel has a plurality of arrayed light-emitting pixels. The electronic device can display content by illuminating the light-emitting pixels in the display panel. The display panel also has a touch detection function, that is, it can detect whether a hand has touched the screen. Since the display panel is easily broken by external force, a transparent cover plate corresponding to the display panel can be provided. Specifically, the transparent cover plate can be placed above the display panel to cover the display panel, so as to protect the display panel from damage without affecting the display of the content.
[0044] In some implementations, please refer to Figure 4 Step S210 may include the contents of steps S211A to S213A:
[0045] S211A: Obtain the capacitance value in the display circuit corresponding to the panel area.
[0046] S212A: If the capacitance value is within the preset capacitance value range, it is determined that there is no crack in the panel area.
[0047] S213A: If the capacitance value is not within the preset capacitance value range, it is determined that there is a crack in the panel area.
[0048] Understandably, while the cover plate provides some protection against breakage from external forces, a significant drop from a height can still cause the display panel to crack. If the area of the display panel corresponding to the first region is cracked, it will affect the image acquisition unit's ability to capture facial images. Therefore, when detecting the integrity of the first region, the integrity of the panel area corresponding to the first region can be detected first. The position of the panel area and... Figure 2 The position of 104 is the same.
[0049] Specifically, if the display panel is cracked, it will cause a partial circuit break or open circuit in the corresponding display circuit, resulting in a change in the current value in the display circuit, and consequently, a change in the capacitance value. Based on this, a preset capacitance value detection function can be used to detect the capacitance value in the display circuit corresponding to the panel area and determine whether the capacitance value is within the preset capacitance value range. If the detected capacitance value is within the preset capacitance value range, it is determined that the panel area is not cracked; if the detected capacitance value is not within the preset capacitance value range, it is determined that the panel area is cracked. The preset capacitance value range can be obtained in advance through statistical analysis assuming the display panel is not cracked, and the historical capacitance value ranges analyzed are stored in the electronic device as the preset capacitance value range.
[0050] In some implementations, please refer to Figure 5 Step S210 may include the contents of steps S211B to S213B:
[0051] S211B: Acquire a second face image in the environment through the image acquisition unit.
[0052] S212B: If a preset light spot image is detected in a preset image area in the second face image, it is determined that the cover plate area is cracked, and the preset image area corresponds to the cover plate area.
[0053] S213B: If it is detected that the preset image area in the second face image does not contain the preset light spot image, it is determined that the cover plate area is not cracked.
[0054] Understandably, although the cover plates designed to protect the display panel from cracking by external forces are made of relatively hard materials, they are still susceptible to damage under significant external forces. Therefore, regardless of whether there is a crack in the aforementioned panel area, it is necessary to assess the integrity of the cover plate area corresponding to the first area. The location of the cover plate area is related to... Figure 2 The position of 104 is the same.
[0055] Specifically, a second face image in the environment can be acquired through an image acquisition unit. Before acquiring the second face image, the target light source is controlled to emit light at a preset emission power, and then the second face image is acquired. If the cover plate area is cracked, the crack will create different interfaces (air and glass interface), resulting in different photographic effects. This will be reflected in the final acquired second face image as some light spot images. Therefore, it can be determined whether the preset image area in the second face image contains a preset light spot image. If it does, it is determined that the cover plate area is cracked; if it does not, it is determined that the cover plate area is not cracked.
[0056] Step S220: If a crack is detected in the panel area corresponding to the first area in the display panel, or a crack is detected in the cover plate area corresponding to the first area in the cover plate, the current emission power of the target light source is increased to the first target power.
[0057] Furthermore, regardless of whether a crack is detected in the panel area corresponding to the first area in the display panel or a crack is detected in the cover plate area corresponding to the first area, the current emission power of the target light source will be increased to a first target power, which is less than a first power threshold.
[0058] Step S230: Control the target light source to emit light at the first target power, and acquire the first face image in the environment through the image acquisition unit.
[0059] Step S240: Perform face recognition based on the first face image.
[0060] In this embodiment, the specific implementation of steps S230 to S240 can be found in the content of the foregoing embodiments, and will not be repeated here.
[0061] In some implementations, after step S240, a third prompt message may be output. This third prompt message indicates that a first area of the screen of the electronic device is cracked, allowing the user to be aware of the damage and repair the screen promptly. Specifically, the third prompt message may further include details of the damage to both the panel area and the cover plate area, enabling the user to be aware of the specific damage and perform corresponding repairs.
[0062] In this embodiment, regarding the integrity of the panel area corresponding to the first area in the display panel, the capacitance value of the display circuit corresponding to the panel area can be detected by the built-in capacitance value detection function of the electronic device, and based on the capacitance value, it can be quickly determined whether the panel area is cracked. Simultaneously, regarding the integrity of the cover plate area corresponding to the first area in the cover plate, a face image can be acquired by the image acquisition unit. Based on the presence of a preset light spot image in the face image, it can be quickly determined whether the cover plate area is cracked. Furthermore, if either the panel area or the cover plate area is cracked, the emission power of the target light source is increased to improve the clarity of the acquired face image. This avoids situations where the acquired face image is partially obscured by light spots due to damage to the first area, resulting in lower clarity and causing face recognition failure or inaccuracy. Moreover, the increased emission power of the target light source is less than the first power threshold, avoiding excessive energy of the emitted light exceeding human eye safety standards and causing eye damage during face recognition, thus further ensuring the safety of the eye recognition process.
[0063] Please refer to Figure 6 , Figure 6 This is a flowchart illustrating a face recognition method according to another embodiment of this application, applied to an electronic device. The electronic device includes a screen, a target light source, and an image acquisition unit. The screen includes a first area, and the target light source and the image acquisition unit are correspondingly configured with respect to the first area. The following will be combined with... Figure 6 The face recognition method provided in this application embodiment is described in detail. This face recognition method may include the following steps:
[0064] Step S310: In response to the face recognition command, detect the integrity of the first region.
[0065] In this embodiment, the specific implementation of step S310 can be found in the content of the foregoing embodiments, and will not be repeated here.
[0066] Step S320: If a crack is detected in the first region, obtain the current emission power of the target light source.
[0067] Step S330: If the current transmission power is less than the first power threshold, obtain the power difference between the first power threshold and the current transmission power.
[0068] Understandably, electronic devices leave a safety margin when controlling the laser emitted by the target light source. The higher the safety margin, the better. A safety margin of 13.1 times means that after the laser energy is increased by 13.1 times, it reaches the critical value of the laser eye safety standard. In other words, the lower the luminous power of the target light source, the higher the safety for human eyes during facial recognition.
[0069] Therefore, if a crack is detected in the first region, the current emission power of the target light source can be obtained, and it can be determined whether the current emission power is less than the first power threshold. If the current emission power is less than the first power threshold, the current emission power is adjusted to a second target power that is less than the first power threshold, so as to avoid damage to the human eye due to excessive emission power.
[0070] Optionally, if the current transmission power is less than the first power threshold, the power difference between the first power threshold and the current transmission power can be further obtained. The magnitude of this power difference can quantify the gap between the current transmission power and the first power threshold. In this case, the power difference can be regarded as a variation of the aforementioned safety margin. The larger the power difference, the farther away from the critical value of the laser eye safety standard. At this time, the safety for the human eye is higher.
[0071] Step S340: If the power difference is greater than the second power threshold, increase the current emission power of the target light source to the first target power.
[0072] The second power threshold can be the difference between the first power threshold and a third target power that is relatively close to the first power threshold, where the third target power is less than the first power threshold. Therefore, it can be further determined whether the power difference is greater than the second power threshold. If the power difference is greater than the second power threshold, it indicates that the current emission power of the target light source has room for improvement without causing damage to the human eye. Thus, the current emission power of the target light source can be increased to the first target power. The specific method for increasing the power can be found in the preceding embodiments and will not be repeated here.
[0073] Step S350: Control the target light source to emit light at the first target power, and acquire the first face image in the environment through the image acquisition unit.
[0074] Step S360: Perform face recognition based on the first face image.
[0075] In this embodiment, the specific implementation of steps S230 to S240 can be found in the content of the foregoing embodiments, and will not be repeated here.
[0076] Step S370: If the power difference is less than or equal to the second power threshold, control the target light source to emit light at the current emission power, and acquire a third face image in the environment through the image acquisition unit.
[0077] Step S380: Perform face recognition based on the third face image.
[0078] Step S390: If face recognition fails, output a second prompt message. The second prompt message is used to indicate that the face recognition function cannot be enabled at present.
[0079] Optionally, if the power difference is less than or equal to the second power threshold, it indicates that the current emission power of the target light source is very close to the critical value of the laser eye safety standard. In this case, if the current emission power of the target light source is directly increased, since the actual emission power of the target light source deviates more or less from the theoretically desired emission power, the increased current emission power may exceed the critical value of the laser eye safety standard, resulting in eye damage.
[0080] Therefore, when the power difference is less than or equal to the second power threshold, the current emission power of the target light source is not increased. Instead, the target light source is directly controlled to emit light at its current emission power, and then the image acquisition unit acquires a third face image from the environment. Face recognition is performed based on the third face image. If face recognition fails, increasing the current emission power of the target light source at this time may cause eye damage. Therefore, a second prompt message is directly output to inform the user that the face recognition function cannot be enabled. The second prompt message may also indicate that the first area of the screen of the electronic device is cracked and should be repaired promptly, and may prompt the user to authenticate using other authentication methods. These other authentication methods include at least voiceprint verification, fingerprint verification, and password verification, and this embodiment does not limit this. Optionally, the second prompt message may also prompt the user to check if there is dirt in the first area, because dirt can also affect the face image acquisition by the image acquisition unit.
[0081] In this embodiment, when a crack is detected in the first area of the screen, it is further determined whether the safety margin of the target light source is sufficient, i.e., whether the power difference is greater than the second power threshold. If sufficient, the emission power of the target light source is increased within the allowable range of the laser eye safety standard threshold to improve the clarity of the acquired face image. This avoids situations where the acquired face image is partially obscured and has low clarity due to the damage to the first area, leading to face recognition failure or inaccuracy. If insufficient, the target light source is directly controlled to emit light at the current emission power, and the face image is acquired and face recognition is performed through the image acquisition unit. In the event of face recognition failure, a second prompt message is output to indicate that the face recognition function cannot be enabled at this time. This protects eye safety while prompting the user to check the screen damage and repair it in a timely manner.
[0082] Please refer to Figure 7 The diagram illustrates a structural block diagram of a face recognition device 400 according to an embodiment of this application, applied to an electronic device. The electronic device includes a screen, a target light source, and an image acquisition unit. The screen includes a first area, and the target light source and the image acquisition unit are correspondingly arranged with respect to the first area. The device 400 may include: an integrity detection module 410, a power adjustment module 420, an image acquisition module 430, and a face recognition module 440.
[0083] The integrity detection module 410 is used to detect the integrity of the first region in response to a face recognition command.
[0084] The power adjustment module 420 is used to increase the current emission power of the target light source to a first target power, which is less than a first power threshold, if a crack is detected in the first region.
[0085] The image acquisition module 430 is used to control the target light source to emit light at the first target power, and to acquire a first face image in the environment through the image acquisition unit.
[0086] The face recognition module 440 is used to perform face recognition based on the first face image.
[0087] In some embodiments, the screen includes a display panel and a cover plate corresponding to the display panel. The power adjustment module 420 can be specifically used to increase the current emission power of the target light source to a first target power if a crack is detected in the panel area corresponding to the first area in the display panel, or a crack is detected in the cover plate area corresponding to the first area in the cover plate.
[0088] In this manner, the integrity detection module 410 can be specifically used to: obtain the capacitance value in the display circuit corresponding to the panel area; if the capacitance value is within a preset capacitance value range, determine that the panel area is not broken; if the capacitance value is not within the preset capacitance value range, determine that the panel area is broken.
[0089] In this manner, the integrity detection module 410 can also be specifically used to: acquire a second face image in the environment through the image acquisition unit; if a preset image area in the second face image is detected to contain a preset light spot image, determine that the cover plate area is cracked, and the preset image area corresponds to the cover plate area; if a preset image area in the second face image is detected not to contain the preset light spot image, determine that the cover plate area is not cracked.
[0090] In some implementations, the face recognition module 440 may include a prompting unit. The prompting unit may be used to output a first prompt message if face recognition based on the first face image fails, the first prompt message indicating that the face recognition function cannot be enabled at present.
[0091] In some embodiments, the power adjustment module 420 may include: a current emission power acquisition unit, a power difference acquisition unit, and a power difference judgment unit. The current emission power acquisition unit may be used to acquire the current emission power of the target light source if a crack is detected in the first region. The power difference acquisition unit may be used to acquire the power difference between the first power threshold and the current emission power if the current emission power is less than a first power threshold. The power difference judgment unit may be used to: increase the current emission power of the target light source to the first target power if the power difference is greater than a second power threshold; if the power difference is less than or equal to the first power threshold, control the target light source to emit light at the current emission power, and acquire a third face image in the environment through the image acquisition unit; perform face recognition based on the third face image; if face recognition fails, output a second prompt message, which indicates that the face recognition function cannot be enabled at present.
[0092] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0093] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0094] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0095] In summary, in response to a face recognition command, the integrity of the first region is detected. If a break is detected in the first region, the current emission power of the target light source is increased to a first target power, which is less than a first power threshold. The target light source is controlled to emit light at the first target power, and a first face image in the environment is acquired through the image acquisition unit. Face recognition is then performed based on the first face image. Thus, when a break is detected in the first region corresponding to the target light source and the image acquisition unit on the screen, increasing the emission power of the target light source improves the clarity of the acquired face image, thereby avoiding situations where the acquired face image is partially obscured and has low clarity due to damage to the first region, leading to face recognition failure or inaccuracy. Furthermore, the increased emission power of the target light source is less than the first power threshold, preventing excessive energy from the emitted light exceeding human eye safety standards and causing eye damage during face recognition, thus further ensuring the safety of the eye recognition process.
[0096] The following will combine Figure 8 This application describes an electronic device.
[0097] Reference Figure 8 , Figure 8 This diagram illustrates a structural block diagram of an electronic device 500 provided in an embodiment of this application. The method described above in this embodiment can be executed by this electronic device 500. The electronic device can be an electronic terminal with data processing capabilities, including but not limited to smartphones, tablets, laptops, desktop computers, smartwatches, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, and MP4 (Moving Picture Experts Group Audio Layer IV) players, etc.
[0098] The electronic device 500 in this application embodiment may include one or more of the following components: processor 501, memory 502, and one or more application programs, wherein the one or more application programs may be stored in memory 502 and configured to be executed by one or more processors 501, and the one or more programs are configured to perform the methods as described in the foregoing method embodiments.
[0099] Processor 501 may include one or more processing cores. Processor 501 connects to various parts within the electronic device 500 using various interfaces and lines, and performs various functions and processes data of the electronic device 500 by running or executing instructions, programs, code sets, or instruction sets stored in memory 502, and by calling data stored in memory 502. Optionally, processor 501 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 501 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the aforementioned modem can also be integrated into processor 501 and implemented as a separate communication chip.
[0100] The memory 502 may include random access memory (RAM) or read-only memory (ROM). The memory 502 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 502 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the electronic device 500 during use (such as the various correspondences described above).
[0101] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0102] In the several embodiments provided in this application, the coupling or direct coupling or communication connection between the modules shown or discussed may be an indirect coupling or communication connection through some interface, device or module, and may be electrical, mechanical or other forms.
[0103] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0104] Please refer to Figure 9 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 600 stores program code that can be called by a processor to execute the methods described in the above method embodiments.
[0105] The computer-readable storage medium 600 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 600 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 600 has storage space for program code 610 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 610 may be compressed, for example, in a suitable form.
[0106] In some embodiments, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the steps in the above-described method embodiments.
[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A face recognition method, characterized by, The method is applied to an electronic device, the electronic device including a screen, a target light source, and an image acquisition unit, the screen including a first area, the target light source and the image acquisition unit being configured correspondingly to the first area, the method including: In response to a face recognition command, the integrity of the first region is detected; If a crack is detected in the first region, the current emission power of the target light source is increased to a first target power, where the first target power is less than a first power threshold. The target light source is controlled to emit light at the first target power, and a first face image in the environment is acquired through the image acquisition unit. Face recognition is performed based on the first face image.
2. The method of claim 1, wherein, The screen includes a display panel and a cover plate corresponding to the display panel. The step of increasing the current emission power of the target light source to a first target power if a crack is detected in the first area includes: If a crack is detected in the panel area corresponding to the first area in the display panel, or a crack is detected in the cover plate area corresponding to the first area in the cover plate, the current emission power of the target light source is increased to the first target power.
3. The method of claim 2, wherein, The detection of the integrity of the first region includes: Obtain the capacitance value in the display circuit corresponding to the panel area; If the capacitance value is within the preset capacitance value range, it is determined that there is no crack in the panel area; If the capacitance value is not within the preset capacitance value range, it is determined that there is a crack in the panel area.
4. The method of claim 2, wherein, The detection of the integrity of the first region includes: The image acquisition unit acquires a second face image in the environment. If a preset light spot image is detected in a preset image region of the second face image, it is determined that the cover plate region is cracked, and the preset image region corresponds to the cover plate region. If the preset image region in the second face image does not contain the preset light spot image, it is determined that the cover plate region is not cracked.
5. The method according to any one of claims 1 to 4, characterized in that, The step of performing face recognition based on the first face image includes: If face recognition fails based on the first face image, a first prompt message is output, indicating that the face recognition function cannot be enabled at present.
6. The method according to any one of claims 1-4, characterized in that, If a crack is detected in the first region, increasing the current emission power of the target light source to a first target power includes: If a crack is detected in the first region, the current emission power of the target light source is obtained; If the current transmit power is less than the first power threshold, obtain the power difference between the first power threshold and the current transmit power; If the power difference is greater than the second power threshold, the current emission power of the target light source is increased to the first target power.
7. The method according to claim 6, characterized in that, After obtaining the power difference between the first power threshold and the current transmit power, the method further includes: If the power difference is less than or equal to the second power threshold, the target light source is controlled to emit light at the current emission power, and a third face image in the environment is acquired through the image acquisition unit. Face recognition is performed based on the third face image; If facial recognition fails, a second prompt message will be output, indicating that the facial recognition function cannot be enabled at present.
8. A face recognition device, characterized in that, An electronic device is used in which the electronic device includes a screen, a target light source, and an image acquisition unit. The screen includes a first area, and the target light source and the image acquisition unit are correspondingly arranged with respect to the first area. The device includes: The integrity detection module is used to detect the integrity of the first region in response to a face recognition command; A power adjustment module is used to increase the current emission power of the target light source to a first target power, where the first target power is less than a first power threshold, if a crack is detected in the first region. The image acquisition module is used to control the target light source to emit light at the first target power, and to acquire a first face image in the environment through the image acquisition unit; The face recognition module is used to perform face recognition based on the first face image.
9. An electronic device, characterized in that, include: One or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code that can be invoked by a processor to execute the method as described in any one of claims 1-7.