Control method and electronic equipment

By adjusting the face detection frequency according to the face movement speed, the problem of excessive power consumption of electronic devices when preventing unfamiliar users from peeping at the screen is solved, and the effect of reducing power consumption while ensuring privacy is achieved.

CN120066228APending Publication Date: 2025-05-30BOE TECHNOLOGY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510223463.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

Currently, when electronic devices are enabled to prevent unfamiliar users from peeping at the screen, they frequently perform face detection and recognition, resulting in excessive power consumption.

Method used

The frequency of face detection is determined by the movement speed of faces in the images collected by the camera. A lower detection frequency is used when the face is moving at a lower speed to reduce power consumption; a higher detection frequency is used when the face is moving at a higher speed to avoid tracking failure.

Benefits of technology

While ensuring user personal privacy, it reduces the power consumption of electronic devices, avoids unnecessary occupation of system resources, and improves hardware life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066228A_ABST
    Figure CN120066228A_ABST
Patent Text Reader

Abstract

The invention provides a control method and electronic equipment. The method comprises the following steps: acquiring first image information acquired by a camera; if the first image information comprises one or more human faces, determining the detection frequency of each human face according to the moving speed of each human face in the one or more human faces; according to the detection frequency of each human face, detecting one or more human faces to obtain a detection result; and controlling the screen or the display content on the screen according to the detection result. The power consumption waste of the electronic equipment can be reduced while the personal privacy of the user is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic devices, and more particularly, to a control method and an electronic device. Background Art

[0002] Currently, some electronic devices are already equipped with the function of preventing strangers from peeping at the screen. When a stranger is detected peeping at the screen, the electronic device can perform corresponding anti-peeping operations to ensure the user's personal privacy. When the function of preventing strangers from peeping at the screen is turned on in current electronic devices, face detection and face recognition are frequently performed, resulting in excessive power consumption of the electronic device. Summary of the Invention

[0003] This application provides a control method and an electronic device, which helps to reduce the power consumption waste of the electronic device while ensuring the user's personal privacy.

[0004] In a first aspect, this application provides a control method, which includes: obtaining first image information collected by a camera; if the first image information includes one or more human faces, determining the detection frequency of each human face according to the moving speed of each human face in the one or more human faces; detecting the one or more human faces according to the detection frequency of each human face to obtain a detection result; and controlling the screen or the display content on the screen according to the detection result.

[0005] In combination with the first aspect, in some possible implementation manners of the first aspect, before obtaining the first image information collected by the camera, the method further includes: obtaining second image information collected by the camera; if the second image information does not include a human face, obtaining third image information collected by the camera after a first preset duration from the time when the second image information is obtained; if the pixel difference between the second image information and the third image is less than or equal to a first preset difference, stopping the face detection operation on the third image information.

[0006] In combination with the first aspect, in some possible implementation manners of the first aspect, before obtaining the first image information collected by the camera, the method further includes: obtaining fourth image information collected by the camera; if the fourth image information does not include a human face, obtaining fifth image information collected by the camera after a second preset duration from the time when the fourth image information is obtained; segmenting the fourth image information to obtain a plurality of regions including at least a first region and a second region, and segmenting the fifth image information to obtain a plurality of regions including at least a third region and a fourth region, where the first region corresponds to the third region and the second region corresponds to the fourth region; if the pixel difference between the first region and the third region is less than or equal to a second preset difference and the pixel difference between the second region and the fourth region is less than or equal to the second preset difference, stopping the face detection operation on the fifth image information.

[0007] In combination with the first aspect, in some possible implementations of the first aspect, determining the detection frequency of each face according to the moving speed of each face in one or more faces includes: determining the detection frequency of each face according to the moving speed of each face in one or more faces and the load of the processing unit of the electronic device.

[0008] In combination with the first aspect, in some possible implementations of the first aspect, the method further includes: detecting that the user performs a lock screen operation; in response to the lock screen operation, controlling the camera to stop acquiring image information.

[0009] In combination with the first aspect, in some possible implementations of the first aspect, before acquiring the first image information collected by the camera, the method further includes: controlling the display device to prompt the user to register face information; in response to the input of the user registering face information, saving the face information registered by the user; wherein, controlling the screen or the display content on the screen according to the detection result includes: controlling the screen or the display content on the screen according to the detection result and the face information registered by the user.

[0010] In combination with the first aspect, in some possible implementations of the first aspect, the method further includes: performing an encryption process on the face information registered by the user.

[0011] In a second aspect, the present application provides an electronic device, which includes a camera and a module or unit for executing the method described in any one of the above first aspects.

[0012] In a third aspect, the present application provides an electronic device, which includes: a camera; a memory for storing a computer program; a processor for executing the computer program stored in the memory so that the electronic device executes the method described in any one of the above first aspects.

[0013] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program runs on a computer, enables the computer to execute the method described in any one of the above first aspects.

[0014] In a fifth aspect, a computer program product is provided, which includes: computer program code, and when the computer program code runs on a computer, enables the computer to execute the method described in any one of the above first aspects. Description of the Drawings

[0015] Figure 1 It is a schematic block diagram of the electronic device provided by the embodiment of the present application.

[0016] Figure 2It is a schematic flowchart of the control method provided by an embodiment of the present application.

[0017] Figure 3 It is another schematic flowchart of the control method provided by an embodiment of the present application.

[0018] Figure 4 It is another schematic flowchart of the control method provided by an embodiment of the present application.

[0019] Figure 5 It is a schematic diagram of the interface externally exposed by the electronic device provided by an embodiment of the present application. Detailed implementation manners

[0020] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may mean A or B; herein, "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone. These three situations. "At least one item" means one or more than one item. For example, "at least one of A and B" is similar to "A and / or B", describing the association relationship of associated objects, indicating that three relationships may exist. For example, at least one of A and B may mean: A exists alone, A and B exist simultaneously, and B exists alone. These three situations.

[0021] In the embodiments of the present application, prefix words such as "first" and "second" are only used to distinguish different described objects, and have no limiting effect on the position, order, priority, quantity, content, etc. of the described objects. The use of ordinal numbers and other prefix words for distinguishing described objects in the embodiments of the present application does not constitute a limitation on the described objects. The description of the described objects refers to the description in the context of the claims or embodiments, and should not constitute unnecessary limitations due to the use of such prefix words. In addition, in the description of this embodiment, unless otherwise specified, the meaning of "a plurality" is two or more.

[0022] Figure 1 It shows a schematic block diagram of the electronic device 100 provided by an embodiment of the present application. The electronic device 100 may include a processor 110, a memory 120, a camera 130, and a screen 140.

[0023] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent components or integrated in one or more processors.

[0024] The memory 120 may include an internal memory. The internal memory may be used to store one or more computer programs, and the one or more computer programs include instructions. The processor 110 may execute the above instructions stored in the internal memory, so that the electronic device 100 executes the control method provided in some embodiments of this application. The internal memory may include a program storage area and a data storage area. Among them, the program storage area may store an operating system; the program storage area may also store one or more applications, etc. The data storage area may store data created during the use of the electronic device 100. In addition, the internal memory may include high-speed random access memory and may also include non-volatile memory, such as one or more disks (or disk storage components), flash memory components, universal flash storage (UFS), etc. In some embodiments, the processor 110 may execute the control method provided in the embodiments of this application, run various applications, and perform data processing by running the instructions stored in the internal memory and / or the instructions stored in the memory provided in the processor 110.

[0025] The screen 140 can be used to display images, videos, etc. The screen 140 can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLed, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc.

[0026] As mentioned above, some current electronic devices are already equipped with the function of preventing strangers from peeping at the screen. When a stranger is detected peeping at the screen, the electronic device can perform corresponding anti-peeping operations to ensure the user's personal privacy. When the function of preventing strangers from peeping at the screen is enabled on the current electronic device, face detection and face recognition are frequently performed, resulting in excessive power consumption of the electronic device.

[0027] The embodiments of the present application provide a control method and an electronic device. The detection frequency of a face can be determined based on the moving speed of the face in the image captured by the camera. In this way, it is possible to ensure that a lower detection frequency is used when the moving speed of the face is low, which helps to reduce the power consumption waste of the electronic device while ensuring the user's personal privacy. A higher detection frequency is used when the moving speed of the face is high to avoid failure in tracking the face.

[0028] Figure 2 A schematic flowchart of the control method 200 provided by the embodiments of the present application is shown. The method 200 includes:

[0029] S210, obtaining first image information captured by the camera.

[0030] Exemplarily, the electronic device can obtain a frame of image at time T 0 and perform face detection on the image.

[0031] The above face detection can be understood as analyzing whether there is a face in the image. Exemplarily, the electronic device can segment the image through an image segmentation algorithm to obtain multiple regions. The electronic device can determine whether the multiple regions include a region where a face exists.

[0032] S220. If the first image information includes one or more human faces, determine the detection frequency of each human face according to the moving speed of each human face in the one or more human faces.

[0033] Exemplarily, if the electronic device determines that the area where face 1 exists is included in multiple areas, then the electronic device can determine the moving speed of face 1. For example, the electronic device can acquire the images collected by the camera within a duration 1 (e.g., 0.5 s) and analyze the images within duration 1, and can obtain the moving speed of face 1. The electronic device can determine the detection frequency of face 1 according to the moving speed of face 1.

[0034] For example, Table 1 shows a corresponding relationship between the moving speed of a human face and the detection frequency.

[0035] Table 1

[0036] Moving speed of the human face Detection frequency of the human face (0, 0.5 m / s) Perform human face detection on 1 frame of image within a preset duration [0.5 m / s, 1 m / s) Perform human face detection on 8 frames of image within a preset duration … …

[0037] Optionally, determining the detection frequency of each human face according to the moving speed of each human face in the one or more human faces includes: determining the detection frequency of each human face according to the moving speed and moving trajectory of each human face in the one or more human faces.

[0038] For example, the electronic device can acquire the images collected by the camera within a duration 1 (e.g., 0.5 s) and analyze the images within duration 1, and can obtain the moving speed and moving trajectory of face 1.

[0039] S230. Detect the one or more human faces according to the detection frequency of each human face to obtain a detection result.

[0040] The above detection of one or more human faces may include face detection and face recognition. Face recognition can be understood as, after determining the area where a human face exists in the image collected by the camera, identifying the facial features in the area where the human face is located, so as to determine whether the human face in the image is the human face registered by the user.

[0041] Exemplarily, taking the preset duration as 1 s as an example, if the detected moving speed of the human face is 0.1 m / s, then the camera can be controlled to acquire 1 frame of image within 1 s and perform face detection on the image. If the face detection result indicates that there is a human face in the image, then face recognition can be performed on the human face, so that the human face can be obtained as face 1. In the next 1 s, the camera is controlled to acquire 1 frame of image again and perform face detection on the image, so as to realize the tracking of face 1. In this way, when the moving speed of face 1 is slow, a lower face detection frequency can be adopted, and the power consumption waste of the electronic device can be reduced while ensuring the accurate tracking of face 1.

[0042] If the detected moving speed of the face is 0.6 m / s, then the camera can be controlled to capture 8 frames of images within 1 s. The electronic device can perform face detection on the first frame of the 8 frames of images. If the face detection result indicates that there is a face in the image, then face recognition can be performed on the face, so that the face can be obtained as Face 2. The next 7 frames of images can only perform face detection without performing face recognition. The purpose of performing face detection on the 7 frames of images after the first frame is to track Face 2. In this way, when the moving speed of Face 2 is relatively fast, a higher face detection frequency can be adopted within a preset duration, which can avoid the failure of tracking Face 2.

[0043] The above takes the case where when the detected moving speed of the face is 0.6 m / s, face detection and face recognition can be performed on the first frame of the 8 frames of images and face detection is performed on the next 7 frames of images as an example for illustration, and the embodiments of the present application are not limited thereto. Exemplarily, face detection and face recognition can also be performed on the first frame and the eighth frame of the 8 frames of images, and face detection is performed on the middle 6 frames of images without performing face recognition.

[0044] S240, control the screen or the display content on the screen according to the detection result.

[0045] Optionally, controlling the screen or the display content on the screen according to the detection result includes: performing a screen anti-peeping operation according to the detection result.

[0046] Exemplarily, when it is determined that the face in the image is Face 1, it can be determined whether Face 1 is a face registered by the user. If Face 1 is a face registered by the user, the screen anti-peeping operation may not be performed; if Face 1 is not a face registered by the user, then the screen anti-peeping operation can be performed.

[0047] Exemplarily, the ways for the electronic device to perform the screen anti-peeping operation include but are not limited to one or more of the following:

[0048] (1) Adjust the screen brightness;

[0049] (2) Adjust the font size of the text displayed on the screen;

[0050] (3) Perform privacy processing on the content being displayed on the screen. For example, when the detection result indicates that the face in the image is the face of a strange user and the electronic device receives a message (for example, a message of an instant messaging application), the electronic device can control the display screen to display a prompt message "Received 1 message" without displaying the specific content of the message.

[0051] In the embodiments of the present application, the detection frequency of a human face is determined based on the moving speed of the human face, and a lower detection frequency can be used when the moving speed of the human face is low. In this way, the performance consumption of the central processing unit (CPU) of the electronic device can be reduced. After testing, the performance consumption of the CPU during the execution of the screen anti-peeping operation is less than 1%. In this way, it is possible to prevent the electronic device from performing the screen anti-peeping operation from affecting the operation of other applications. Through reasonable resource scheduling and optimization, the stability of the electronic device under high load is ensured.

[0052] Optionally, before obtaining the first image information collected by the camera, method 200 further includes: obtaining second image information collected by the camera; if the second image information does not include a human face, obtaining third image information collected by the camera after a first preset duration from the time of obtaining the second image information; if the pixel difference between the second image information and the third image is less than or equal to a first preset difference, stop performing the human face detection operation on the third image information.

[0053] Exemplarily, at time T 1 the electronic device obtains a frame of image collected by the camera and performs human face detection on the image. If the result of the human face detection indicates that the image does not include a human face, then the electronic device can switch to the frame difference judgment mode. In the frame difference judgment mode, the electronic device can obtain another frame of image collected by the camera at time T 1 +1 s and determine whether the pixel difference between the two frames of images is greater than a first preset difference (for example, 5%).

[0054] If the pixel difference between the two frames of images is less than or equal to the first preset difference, the electronic device can determine that there is no one in the current scene and stop performing the human face detection operation on the subsequently collected images. In this way, the power consumption of the electronic device can be reduced, and compared with using the human face detection operation, the CPU performance consumption here can be reduced by more than 80%.

[0055] If the pixel difference between the two frames of images is greater than the first preset difference, the electronic device can determine that the image obtained 1 s later is different from the previous one, and can continue to perform the human face detection operation on the image obtained 1 s later. If the result of the human face detection indicates that there is a human face in the image obtained 1 s later, then the detection frequency of the human face can be determined based on the moving speed of the human face, and thus the human face can be detected based on the detection frequency of the human face. If the result of the human face detection indicates that there is no human face in the image obtained 1 s later, then the electronic device can continue to obtain another frame of image collected by the camera at time T 1 +2 s. The electronic device can perform corresponding operations based on the pixel difference between the image obtained at time T 1 +1 s and the image obtained at time T 1 +2 s.

[0056] Optionally, before obtaining the first image information collected by the camera, the method 200 further includes: obtaining fourth image information collected by the camera; if the fourth image information does not include a human face, obtaining fifth image information collected by the camera after a second preset duration from the time of obtaining the fourth image information; segmenting the fourth image information to obtain a plurality of regions including at least a first region and a second region, and segmenting the fifth image information to obtain a plurality of regions including at least a third region and a fourth region, where the first region corresponds to the third region, and the second region corresponds to the fourth region; if the pixel difference between the first region and the third region is less than or equal to a second preset difference and the pixel difference between the second region and the fourth region is less than or equal to the second preset difference, stop performing a face detection operation on the fifth image information.

[0057] Optionally, obtaining the fourth image information collected by the camera includes: determining that the pixel difference between images obtained within one or more first preset durations is less than or equal to a first preset difference.

[0058] Exemplarily, if the electronic device continuously determines that the pixel difference between adjacent two frames of images is less than or equal to the first preset difference through images obtained within one or more first preset durations, then the electronic device can enter a sub-region change detection mode. In the sub-region change detection mode, the electronic device can compare the pixel differences between corresponding regions by dividing each frame of image into a plurality of regions instead of using the complete two frames of images for comparison.

[0059] Exemplarily, the electronic device can obtain Image 1 at time T 2 and obtain Image 2 at time T 2 + 1s. The electronic device can divide Image 1 into Region 1 and Region 2 and divide Image 2 into Region 3 and Region 4, where Region 1 corresponds to Region 3, and Region 2 corresponds to Region 4. By comparing the pixel differences between Region 1 and Region 3 and between Region 2 and Region 4, it can be determined whether Image 2 has changed compared to Image 1.

[0060] For example, if the pixel differences between Region 1 and Region 3 and between Region 2 and Region 4 are both less than or equal to a second preset difference (e.g., 5%), then the electronic device can determine that Image 2 has not changed compared to Image 1. If there is no human face in Image 1, then it can be directly determined that there is no human face in Image 2, and the electronic device can stop performing a face detection operation on Image 2.

[0061] For another example, if the pixel difference between Region 1 and Region 3 is greater than a second preset difference, and / or the pixel difference between Region 2 and Region 4 is greater than the second preset difference, then the electronic device may determine that Image 2 has changed compared to Image 1. At this time, the electronic device may perform a face detection operation on Image 2.

[0062] The above first preset difference and second preset difference may be the same, or they may not be the same.

[0063] The above electronic device divides Image 1 and Image 2 in the same way. In the above embodiments, it is taken as an example that Image 1 and Image 2 are divided into 2 regions, but the embodiments of the present application are not limited to this. For example, Image 1 and Image 2 may also be divided into 9 regions (upper left, middle upper, upper right, middle right, lower right, middle lower, lower left, middle left, center), and the pixel differences of the corresponding regions in Image 1 and Image 2 are used to determine whether Image 2 has changed compared to Image 1.

[0064] In the embodiments of the present application, by first dividing a complete image into multiple regions and then comparing the pixel differences between the corresponding regions in two consecutive frames of images, it can be determined whether the image has changed. Compared with determining by the pixel differences of the complete image, the performance consumption can be reduced by more than 90%, which helps to further reduce the power consumption waste of the electronic device.

[0065] Optionally, determining the detection frequency of each face according to the moving speed of each face in the one or more faces includes: determining the detection frequency of each face according to the moving speed of each face in the one or more faces and the load of the processing unit of the electronic device.

[0066] During the face detection process, the electronic device can monitor the usage of the CPU and memory in real time to ensure that it does not affect the normal operation of other applications. When the load of the CPU exceeds the preset load, the detection frequency of the face can be automatically reduced (for example, when the moving speed of the face is relatively fast, the face detection of 8 frames of images collected by the camera within 1 second is adjusted to the face detection of 6 frames of images collected by the camera within 1 second), to ensure the smoothness of the overall system. The electronic device can silently optimize resource allocation in the background, and the user does not need to pay attention to the system load.

[0067] In the embodiments of the present application, an intelligent scheduling mechanism is designed to dynamically adjust the detection frequency of the face and resource allocation according to the current system load, so as to achieve the best performance and power consumption balance. When it is detected that the CPU load is too high, the electronic device can automatically reduce the detection frequency of the face to maintain a smooth user experience.

[0068] Optionally, the method 200 further includes: detecting that the user performs a screen locking operation; in response to the screen locking operation, controlling the camera to stop acquiring image information.

[0069] Exemplarily, taking a laptop computer installed with the Windows system as an example. The laptop computer can continuously monitor the screen locking event through the Windows User32 library and use the GetForegroundWindow function to determine the current application state. When it detects that the system triggers a screen locking event, it can automatically stop the face detection algorithm, release the camera resources and the detection thread, and enter the silent state. Optionally, during the process of releasing the camera resources and the detection thread, corresponding prompt information can be displayed on the user interface to let the user understand the system state. This mechanism effectively reduces the unnecessary occupation of system resources, avoids unnecessary hardware consumption, improves the hardware lifespan, and the hardware resources such as the camera can be released during the screen locking period. When the user unlocks the screen, it can automatically re-acquire the camera resources and resume the detection thread to ensure a seamless connection of the user experience and avoid the delay and inconvenience for the user after unlocking.

[0070] Optionally, before acquiring the first image information collected by the camera, the method 200 further includes: controlling the display device to prompt the user to register face information; in response to the input of the user registering face information, saving the face information registered by the user; wherein, according to the detection result, controlling the screen or the display content on the screen includes: according to the detection result and the face information registered by the user, controlling the screen or the display content on the screen.

[0071] Exemplarily, the detection result includes the result of face recognition (for example, including face feature 1), and the face information registered by the user includes face feature 2 obtained during the user registration process. If face feature 1 and face feature 2 match, then it can be determined that there is no strange user in front of the current electronic device, and the electronic device can keep the display content on the current screen unchanged. If face feature 1 and face feature 2 do not match, then it can be determined that there is a strange user in front of the current electronic device, and the electronic device can control the brightness of the screen to decrease or can control the font of the display content on the screen to become smaller.

[0072] Optionally, the method 200 further includes: performing an encryption process on the face information registered by the user.

[0073] Optionally, the face information registered by the user includes a face image and face features.

[0074] Exemplarily, after startup, the electronic device first checks whether there is already registered face information. If the user has not registered, the electronic device can display a prompt button of "Register current face" on the screen. In response to detecting the user's click operation on the prompt button, the electronic device can activate the camera to capture an image. During the capture process, a real-time video stream can be displayed to facilitate the user to adjust the posture. The captured image undergoes a series of preprocessing steps, including image enhancement, denoising, and face detection, to extract face features and generate feature data. The electronic device automatically verifies the quality of the captured image to ensure it meets the registration requirements.

[0075] Exemplarily, the electronic device can use the advanced encryption standard (AES) algorithm to encrypt the face features and face images to ensure the security of the information. The encrypted face information will be stored locally. At the same time, the electronic device will display a successful registration message to the user and guide them to the next step. After the user completes the registration, the electronic device can display an option of "Start detection" on the screen, and this option can be for enabling the screen anti-peeping function. In response to the user's click operation, the electronic device can activate the real-time detection function, and the function runs in the background without affecting the user's other application operations.

[0076] Encrypting the face information registered by the user can ensure the security of user data and prevent any unauthorized access. Optionally, the electronic device can also provide a regular encryption key update policy to ensure the continuous security of the data.

[0077] Optionally, before performing the screen anti-peeping operation (for example, during the system initialization process), the electronic device can perform hardware identity authentication to ensure the uniqueness of each device. The authentication information includes a combination of one or more of the local hard disk ID, CPU ID, and motherboard ID to generate a unique identity identifier. This mechanism prevents the access of unauthorized devices.

[0078] Optionally, the electronic device can also provide functions of "One-key on" and "One-key off", and the user can control the detection status at any time according to needs, which is convenient for operation. During the one-key off process, the system will prompt the user to confirm the operation to avoid misoperation.

[0079] Figure 3 Shows a schematic flowchart of the control method 300 provided by an embodiment of the present application. The method 300 includes:

[0080] S310, obtaining second image information collected by the camera.

[0081] Exemplarily, when detecting that the user enables the screen anti-peeping function, the electronic device can obtain the second image information collected by the camera.

[0082] S320. If the second image information does not include a face, the third image information collected by the camera is obtained after a first preset duration from the acquisition of the second image information.

[0083] Exemplarily, the first preset duration is 1 s.

[0084] The above S320 can refer to the relevant description in the above method 200, and will not be elaborated here.

[0085] S330. If the pixel difference between the second image information and the third image is less than or equal to a first preset difference, the face detection operation on the third image information is stopped.

[0086] The above S330 can refer to the relevant description in the above method 200, and will not be elaborated here.

[0087] In the embodiment of the present application, if the pixel difference between the second image information and the third image information is less than or equal to the first preset difference, the electronic device may determine that there is no one in the current scene and stop the face detection operation on the third image information. In this way, the power consumption of the electronic device can be reduced. Compared with using the face detection operation, the CPU performance consumption can be reduced by more than 80% here.

[0088] Figure 4 The schematic flowchart of the control method 400 provided by the embodiment of the present application is shown. The method 400 includes:

[0089] S410. Obtain the fourth image information collected by the camera.

[0090] Exemplarily, when it is detected that the user enables the screen anti-peeping function, the electronic device may obtain the fourth image information collected by the camera.

[0091] S420. If the fourth image information does not include a face, the fifth image information collected by the camera is obtained after a second preset duration from the acquisition of the fourth image information.

[0092] S430. Segment the fourth image information to obtain a plurality of regions including at least a first region and a second region, and segment the fifth image information to obtain a plurality of regions including at least a third region and a fourth region. The first region corresponds to the third region, and the second region corresponds to the fourth region.

[0093] S440. If the pixel difference between the first region and the third region is less than or equal to a second preset difference and the pixel difference between the second region and the fourth region is less than or equal to the second preset difference, the face detection operation on the fifth image information is stopped.

[0094] Optionally, obtaining the fourth image information collected by the camera includes: determining that the pixel difference between images obtained within one or more first preset time periods is less than or equal to a first preset difference.

[0095] The above first preset difference and second preset difference may be the same, or may not be the same.

[0096] The above S410 - S440 may refer to the relevant descriptions in the above method 200 and will not be elaborated here.

[0097] In the embodiments of the present application, by first dividing a complete image into multiple regions and then comparing the pixel differences between corresponding regions in two consecutive frames of images, it can be determined whether the image has changed. Compared with judging by the pixel difference of the complete image, the performance consumption can be reduced by more than 90%, which helps to further reduce the power consumption waste of the electronic device.

[0098] Figure 5 The figure shows a schematic diagram of the interfaces externally exposed by the electronic device provided in the embodiments of the present application. The interfaces externally exposed by the electronic device include an initialization engine interface, a face information acquisition interface, an interface for judging whether to store face information, a face information registration interface, a detection start interface, a stranger detection interface, a detection stop interface, and an engine release interface.

[0099] During system initialization, the initialization engine interface can be called to load the face - related algorithm module and authenticate the hardware information of the electronic device.

[0100] In the face registration stage, the electronic device first calls the face information acquisition interface to determine whether the camera has been turned on. If it has been turned on, the image collected by the camera is obtained and the face information in the image is extracted. If the camera has not been turned on, the camera can be turned on to collect an image and extract the face information in the image, and the camera can be turned off after the image is collected. After the face information is extracted, the interface for judging whether to store face information can be called to store information such as the original image obtained by the camera, the face features, and the position of the face in the image in the database of the electronic device. When the screen anti - peeping function is executed, the electronic device can call the face information registration interface to compare the face information extracted from the real - time collected image with the face information in the database, so as to determine whether there is a stranger staring at the screen.

[0101] After the electronic device enables the screen anti-peeping function, the electronic device can call the enabling detection interface and start a background thread. The electronic device can control the camera to turn on and obtain the images captured by the camera. Perform dynamic face detection and tracking on the images captured by the camera. The electronic device can determine whether the face quality is qualified. If the face quality is qualified, the face information extracted from the image can be compared with the face information in the database to determine whether there is a stranger in front of the screen of the electronic device. The electronic device can call the stranger detection interface to obtain the result of whether there is a stranger.

[0102] When the electronic device detects that the user performs a screen locking operation, it can call the closing detection interface. The electronic device can stop the background loop thread and turn off the camera.

[0103] When detecting that the user turns off the screen anti-peeping function, the electronic device can call the release engine interface to release the face-related algorithms.

[0104] An embodiment of the present application also provides an electronic device, which includes a camera and a module or unit for executing the above control method.

[0105] An embodiment of the present application also provides an electronic device, which includes: a camera; a memory for storing a computer program; a processor for executing the computer program stored in the memory so that the electronic device executes the above control method.

[0106] An embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code runs on a computer, it causes the computer to execute the control method in the above embodiments.

[0107] An embodiment of the present application also provides a computer-readable medium, which stores program code, when the computer program code runs on a computer, it causes the computer to execute the control method in the above embodiments.

[0108] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0109] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0110] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical, or other forms.

[0111] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0112] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0113] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0114] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claimed rights.

Claims

1. A control method, characterized in that: include: Acquire first image information captured by the camera; If the first image information includes one or more human faces, determining a detection frequency of each human face according to a moving speed of each of the one or more human faces; Detecting the one or more faces according to the detection frequency of each face to obtain a detection result; According to the detection result, the screen or the display content on the screen is controlled.

2. The method according to claim 1, characterized in that Before obtaining the first image information captured by the camera, the method further includes: Acquire second image information captured by the camera; If the second image information does not include a face, obtaining third image information captured by the camera after a first preset time period from the time the second image information is obtained; If the pixel difference between the second image information and the third image information is less than or equal to a first preset difference, the face detection operation on the third image information is stopped.

3. The method according to claim 1 or 2, characterized in that: Before obtaining the first image information captured by the camera, the method further includes: Acquire fourth image information collected by the camera; If the fourth image information does not include a face, obtaining fifth image information captured by the camera after a second preset time period from the time the fourth image information is obtained; Segmenting the fourth image information to obtain a plurality of regions including at least a first region and a second region, and segmenting the fifth image information to obtain a plurality of regions including at least a third region and a fourth region, wherein the first region corresponds to the third region, and the second region corresponds to the fourth region; If the pixel difference between the first area and the third area is less than or equal to a second preset difference and the pixel difference between the second area and the fourth area is less than or equal to the second preset difference, stop performing the face detection operation on the fifth image information.

4. The method according to claim 1 or 2, characterized in that: The determining, according to the moving speed of each face among the one or more faces, the detection frequency of each face comprises: The detection frequency of each face is determined according to the moving speed of each face in the one or more faces and the load of the processing unit of the electronic device.

5. The method according to claim 1 or 2, characterized in that: The method further comprises: It is detected that the user performs a screen lock operation; In response to the screen lock operation, the camera is controlled to stop acquiring image information.

6. The method according to claim 1 or 2, characterized in that: Before obtaining the first image information captured by the camera, the method further includes: Controlling the display device to prompt the user to register facial information; In response to input of registered face information by the user, saving the registered face information of the user; Wherein, controlling the screen or the display content on the screen according to the detection result includes: The screen or the display content on the screen is controlled according to the detection result and the facial information registered by the user.

7. The method according to claim 6, characterized in that The method further comprises: The facial information registered by the user is encrypted.

8. An electronic device, characterized in that: The electronic device comprises a camera and a unit or module for executing the method according to any one of claims 1 to 7.

9. An electronic device, characterized in that: include: Camera; processor; Memory; and a computer program, wherein the computer program is stored in the memory, the computer program comprising instructions, which, when executed by the processor, enable the electronic device to perform the method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a computer, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the method according to any one of claims 1 to 7 is implemented.