Control method and control system
Through the combination of face detection and voice recognition of video stream data, the electronic device is automatically controlled to wake up, which solves the problems in the existing technology that the device cannot be used immediately and the startup security is insufficient, and realizes fast and safe device startup.
Patent Information
- Application Number
- CN202111410583.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-11-25
AI Technical Summary
Existing electronic devices require operators to manually wake them up, resulting in inability to use them immediately and insufficient safety during startup.
By acquiring video stream data for face detection and recognition, combined with voice recognition, it automatically controls the wake-up of electronic devices, improving startup speed and security.
It realizes the automatic wake-up of electronic devices, improves startup speed and safety, avoids useless face recognition, and ensures fast and safe startup of the device.
Smart Images

Figure CN114253612B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of control systems, and in particular to a control method and a control system. Background Art
[0002] Current electronic devices require operators to manually wake them up after they arrive in front of them, which results in the operator being unable to use the electronic device immediately after arriving in front of it, making it inconvenient for the operator to use it.
[0003] Therefore, it is necessary to provide a new control method and control system to solve the above problems existing in the prior art. Summary of the invention
[0004] The object of the present invention is to provide a control method and a control system, which are convenient for automatically controlling the awakening of an electronic device, improving the startup speed of the electronic device, and the safety of the electronic device when starting up.
[0005] To achieve the above object, the control method of the present invention is used to control the wake-up of an electronic device, comprising the following steps:
[0006] S1: Obtain video stream data, and then perform face detection on the video stream data to obtain a face frame;
[0007] S2: performing face recognition on the image in the face frame to determine the degree of match between the image in the face frame and a preset user image;
[0008] S3: When the matching degree between the image in the face frame and the preset user image reaches a preset threshold, voice recognition is started to determine whether to control the electronic device to wake up.
[0009] The beneficial effects of the control method are: acquiring video stream data, then performing face detection on the video stream data to obtain a face frame, performing face recognition on the image in the face frame to determine the degree of match between the image in the face frame and a preset user image, when the degree of match between the image in the face frame and the preset user image reaches a preset threshold, starting voice recognition to determine whether to control the electronic device to wake up, and timely controlling the electronic device to wake up by means of video stream, thereby improving the startup speed of the electronic device, and improving the safety of the electronic device when starting up by combining face recognition and voice recognition.
[0010] Optionally, before executing step S2, a first face frame comparison step is further included, and the first face frame comparison step includes:
[0011] Comparing the face frame with a first preset face frame to determine whether the face frame is larger than the first preset face frame;
[0012] If it is determined that the face frame is larger than the first preset face frame, step S2 is executed. The beneficial effect is that as a start condition for face recognition, useless face recognition is avoided, thereby improving the efficiency of face recognition.
[0013] Optionally, before executing step S2, a frame counting step is also included, and the frame counting step includes:
[0014] If it is determined that the face frame is smaller than or equal to the first preset face frame, the frame count is increased by 1 to obtain a new frame count, and then the frame count is replaced by the new frame count;
[0015] Comparing the new frame count with a preset frame count to determine whether the new frame count is greater than the preset frame count;
[0016] If it is determined that the new frame count is greater than the preset frame count, the movement trend of the target is obtained according to the change trend of the face frame.
[0017] Optionally, before executing step S2, a second face frame comparison step is further included, and the second face frame comparison step includes:
[0018] Determining whether the target's movement trend is close to the electronic device;
[0019] If it is determined that the movement trend of the target is approaching the electronic device, comparing the newly obtained face frame with the second preset face frame to determine whether the newly obtained face frame is larger than the second preset face frame;
[0020] If it is determined that the newly obtained face frame is larger than the second preset face frame, step S2 is executed. Its beneficial effect is that as a start condition for face recognition, useless face recognition is avoided, the efficiency of face recognition is improved, and face recognition cannot be started for a long time.
[0021] Optionally, the acquiring of video stream data and then performing face detection on the video stream data to obtain a face frame includes:
[0022] Each frame of the image in the video stream data is obtained, and then face detection is performed on each frame of the image in sequence in the video stream data to obtain a face frame.
[0023] Optionally, if face detection is performed on the same frame of the image to obtain at least two face frames, only the face frame closest to the center point of the image is obtained. The beneficial effect is that a unique face frame is obtained to ensure correct processing of subsequent processes.
[0024] Optionally, starting voice recognition to determine whether to control the electronic device to wake up includes:
[0025] Collecting sound information, and then comparing the sound information with pre-stored sound information to determine whether the sound information matches the pre-stored sound information;
[0026] If it is determined that the sound information matches the pre-stored sound information, the electronic device is controlled to wake up.
[0027] The present invention also provides a control system, which includes a video stream data acquisition unit, a face detection unit, a face recognition unit, a voice recognition unit and a wake-up unit, wherein the video stream data acquisition unit is used to acquire video stream data; the face detection unit is used to receive the video stream data acquired by the video stream data acquisition unit, and then perform face detection on the video stream data to obtain a face frame; the face recognition unit is used to perform face recognition on the image in the face frame to determine the matching degree between the image in the face frame and the preset user image, and after the matching degree between the image in the face frame and the preset user image reaches a preset threshold, start voice recognition to determine whether to control the electronic device to wake up; the wake-up unit is used to wake up the electronic device.
[0028] The beneficial effects of the control system are: the video stream data acquisition unit is used to acquire video stream data; the face detection unit is used to receive the video stream data acquired by the video stream data acquisition unit, and then perform face detection on the video stream data to obtain a face frame; the face recognition unit is used to perform face recognition on the image in the face frame to determine the matching degree between the image in the face frame and the preset user image, and after the matching degree between the image in the face frame and the preset user image reaches a preset threshold, start voice recognition to determine whether to control the electronic device to wake up; the wake-up unit is used to wake up the electronic device, and timely control the wake-up of the electronic device by means of video stream, thereby improving the startup speed of the electronic device, and by combining face recognition and voice recognition, improves the safety of the electronic device when starting up.
[0029] Optionally, the control system further comprises a first face frame comparison unit, which is used to compare the face frame with a first preset face frame to determine whether the face frame is larger than the first preset face frame.
[0030] Optionally, the control system further comprises a frame counting unit, which is used to add 1 to the frame count to obtain a new frame count, and then replace the frame count with the new frame count.
[0031] Optionally, the control system further includes a frame count comparison unit, which is used to determine whether the new frame count is greater than a preset frame count. If it is determined that the new frame count is greater than the preset frame count, the movement trend of the target is obtained based on the change trend of the face frame.
[0032] Optionally, the control system also includes a second face frame comparison unit, which is used to determine whether the target's movement trend is approaching the electronic device. If the target's movement trend is determined to be approaching the electronic device, the newly obtained face frame is compared with a second preset face frame to determine whether the newly obtained face frame is larger than the second preset face frame. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a structural block diagram of the control system of the present invention;
[0034] Figure 2 is a flow chart of the control method of the present invention;
[0035] Figure 3 It is a schematic diagram of two face frames appearing in one frame of image according to the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0037] In view of the problems existing in the prior art, an embodiment of the present invention provides a control system, referring to Figure 1The control system 100 includes a video stream data acquisition unit 101, a face detection unit 102, a face recognition unit 103, a voice recognition unit 104 and a wake-up unit 105, wherein the video stream data acquisition unit 101 is used to acquire video stream data; the face detection unit 102 is used to receive the video stream data acquired by the video stream data acquisition unit 101, and then perform face detection on the video stream data to obtain a face frame; the face recognition unit 103 is used to perform face recognition on the image in the face frame to determine the matching degree between the image in the face frame and the preset user image, and after the matching degree between the image in the face frame and the preset user image reaches a preset threshold, start voice recognition to determine whether to control the electronic device to wake up; the wake-up unit 105 is used to wake up the electronic device.
[0038] In some embodiments, the control system may further include a first face frame comparison unit, which is used to compare the face frame with a first preset face frame to determine whether the face frame is larger than the first preset face frame.
[0039] In some embodiments, the control system may further include a frame counting unit, which is used to add n to the frame count to obtain a new frame count, and then replace the frame count with the new frame count, where n is greater than 0.
[0040] In some embodiments, the control system may further include a frame count comparison unit, which is used to determine whether the new frame count is greater than a preset frame count. If it is determined that the new frame count is greater than the preset frame count, the movement trend of the target is obtained based on the change trend of the face frame.
[0041] In some embodiments, the control system may further include a second face frame comparison unit, which is used to determine whether the target's movement trend is approaching the electronic device. If the target's movement trend is determined to be approaching the electronic device, the newly obtained face frame is compared with a second preset face frame to determine whether the newly obtained face frame is larger than the second preset face frame.
[0042] In some embodiments, the control system may further include a frame count selection unit, and the frame count selection unit is used to select or input a preset frame count.
[0043] Figure 2 FIG. 1 is a flow chart of a control method in some embodiments of the present invention. Figure 2 The control method is implemented by the control system and is used to control the wake-up of the electronic device. The control method comprises the following steps:
[0044] S1: Obtain video stream data, and then perform face detection on the video stream data to obtain a face frame;
[0045] S2: performing face recognition on the image in the face frame to determine the degree of match between the image in the face frame and a preset user image;
[0046] S3: When the matching degree between the image in the face frame and the preset user image reaches a preset threshold, voice recognition is started to determine whether to control the electronic device to wake up.
[0047] In some embodiments, face detection and face recognition are performed by a trained neural network model, and the training method of the neural network model includes: collecting a custom data set, the custom data set includes face pictures; normalizing and preprocessing the face pictures in RGB format; obtaining a custom training network model, the custom training network model performs model compression based on YOLOV4; inputting the normalized preprocessed face pictures into the custom training network model for training; calculating the training loss of the face pictures through a loss function, back-propagating the training loss to update the training network model, and when the performance of the training network model on the validation set meets the preset threshold, the training ends; pruning the trained network model, and training all the data in the pruned network model at least ten times to obtain a trained neural network model for face detection or face recognition. Face detection and face recognition can also be performed by other methods, and the methods of face detection and face recognition are not specifically limited here.
[0048] In some embodiments, a first face frame comparison step may be included before executing step S2, and the first face frame comparison step includes: comparing the face frame with a first preset face frame to determine whether the face frame is larger than the first preset face frame; if it is determined that the face frame is larger than the first preset face frame, executing step S2.
[0049] In some embodiments, a frame counting step may be included before executing step S2, and the frame counting step includes: if it is determined that the face frame is less than or equal to a first preset face frame, adding 1 to the frame count to obtain a new frame count, and then replacing the frame count with the new frame count; comparing the new frame count with the preset frame count to determine whether the new frame count is greater than the preset frame count; if it is determined that the new frame count is greater than the preset frame count, obtaining the movement trend of the target according to the change trend of the face frame.
[0050] In some embodiments, taking the frame count as 1, the length of the first preset face frame as 6, and the height of the first preset face frame as 7 as an example:
[0051] The coordinates of the four vertices of the face frame in the ninth frame of the video stream data are (10, 11), (15, 11), (10, 6) and (15, 6), respectively. The coordinates of the four vertices of the face frame in the tenth frame of the video stream data are (9.75, 11.25), (15.25, 11.25), (9.75, 5.75) and (15.25, 5.75), respectively. The coordinates of the four vertices of the face frame in the eleventh frame of the video stream data are (9. 5, 11.5), (15.5, 11.5), (9.5, 5.5) and (15.5, 5.5), that is, the length of the face frame in the ninth image is 5, the height of the face frame in the ninth image is 5, the length of the face frame in the tenth frame image of the video stream data is 5.5, the height of the face frame in the tenth frame image of the video stream data is 5.5, the length of the face frame in the eleventh frame image of the video stream data is 6, and the height of the face frame in the eleventh frame image of the video stream data is 6;
[0052] It is determined that the length of the face frame in the ninth frame image is less than the length of the first preset face frame, and it is determined that the height of the face frame in the ninth frame image is less than the height of the first preset face frame. Then, it can be determined that the face frame in the ninth frame image is smaller than the first preset face frame, and the frame count is 1, which is equal to 2 after adding 1, that is, the new frame count is 2, and then the frame count is replaced by the new frame count, and the frame count is also 2;
[0053] It is determined that the length of the face frame in the tenth frame image is less than the length of the first preset face frame, and it is determined that the height of the face frame in the tenth frame image is less than the height of the first preset face frame. Then, it can be determined that the face frame in the tenth frame image is smaller than the first preset face frame, and the frame count is 2, which is equal to 3 after adding 1, that is, the new frame count is 3, and then the frame count is replaced by the new frame count, and the frame count is also 3;
[0054] It is determined that the length of the face frame in the eleventh frame image is equal to the length of the first preset face frame, and it is determined that the height of the face frame in the eleventh frame image is less than the height of the first preset face frame. It can be determined that the face frame in the eleventh frame image is smaller than the first preset face frame, and the frame count is 3, which is equal to 4 after adding 1, that is, the new frame count is 4, and then the frame count is replaced with the new frame count, and the frame count is also 4.
[0055] In some embodiments, a second face frame comparison step may be included before executing step S2, and the second face frame comparison step includes: determining whether the target's movement trend is approaching the electronic device; if the target's movement trend is determined to be approaching the electronic device, comparing the newly obtained face frame with a second preset face frame to determine whether the newly obtained face frame is larger than the second preset face frame; if the newly obtained face frame is determined to be larger than the second preset face frame, executing step S2.
[0056] In some embodiments, obtaining the target's motion trend according to the change trend of the face frame includes: comparing the sizes of adjacent face frames in the order in which the face frames are obtained; multiplying the first calculated value by a first enlargement threshold or a first reduction threshold according to the comparison result of the sizes of adjacent face frames to obtain a new first calculated value, and then replacing the first calculated value with the new first calculated value; comparing the new first calculated value with a first judgment threshold to obtain the change trend of the face frame, and then obtaining the target's motion trend. Wherein, the first calculated value is greater than 0.
[0057] In some embodiments, the first enlargement threshold is greater than 1 and less than 2, the first reduction threshold is less than 1 and greater than 0, and the sum of the first enlargement threshold and the first reduction threshold is 2. For example, the first enlargement threshold is 1.2, and the first reduction threshold is 0.8; for another example, the first enlargement threshold is 1.1, and the first reduction threshold is 0.9.
[0058] In some embodiments, comparing the new first calculated value with the first judgment threshold to obtain the changing trend of the face frame, and then obtaining the target motion trend, includes: comparing the new first calculated value with the first judgment threshold to obtain the changing trend of the face frame; if the new first calculated value is greater than the first judgment threshold, then judging that the changing trend of the face frame is getting larger, and then the target motion trend can be obtained to be close to the electronic device; if the new first calculated value is less than the first judgment threshold, then judging that the changing trend of the face frame is getting smaller, and then the target motion trend can be obtained to be away from the electronic device.
[0059] In some embodiments, the first determination threshold is equal to the first calculated value.
[0060] In some embodiments, before executing step S1, a frame count selection step is also included, and the frame count selection step includes: selecting or inputting a preset frame count.
[0061] In some embodiments, the step of acquiring video stream data and then performing face detection on the video stream data to obtain a face frame includes: acquiring each frame of image in the video stream data and then performing face detection on each frame of the image in sequence in the order of each frame of image in the video stream data to obtain a face frame.
[0062] In some embodiments, if face detection is performed on the same frame of the image to obtain at least two face frames, only the face frame closest to the center point of the image is obtained.
[0063] Figure 3 FIG. 1 is a schematic diagram of two face frames appearing in one frame of an image according to the present invention. Figure 3 , the figure includes a center point 201 of the image, a left face frame 202 and a right face frame 203, the center point 201 is the intersection of the diagonals of the image, the distance between the left face frame 202 and the center point 201 is smaller than the distance between the right face frame 203 and the center point 201, and when acquiring the face frames in the image, only the left face frame 202 is acquired.
[0064] In some embodiments, the initiation of voice recognition to determine whether to control the electronic device to wake up includes: collecting sound information, and then comparing the sound information with pre-stored sound information to determine whether the sound information matches the pre-stored sound information; if it is determined that the sound information matches the pre-stored sound information, then controlling the electronic device to wake up. For example, the pre-stored sound information is "Hello computer", assuming that the collected sound information is "Hello computer", then it is determined that the sound information matches the pre-stored sound information, and then the electronic device is controlled to wake up; for another example, the pre-stored sound information is "Hello computer", assuming that the collected sound information is "Hello computer", then it is determined that the sound information matches the pre-stored sound information, then the electronic device is not controlled to wake up, and the sound information continues to be collected.
[0065] In some embodiments, starting voice recognition to determine whether to control the electronic device to wake up may also include: starting a timer while starting voice recognition. If the timer exceeds a preset time and the electronic device has not been controlled to wake up, all the acquired face frames are cleared and step S1 is re-executed.
[0066] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.
Claims
1. A control method, characterized in that: Used to control the wake-up of an electronic device, including the following steps: S1: acquiring video stream data, and then performing face detection on the video stream data to obtain a face frame; S2: comparing the sizes of adjacent face frames in the order in which the face frames are acquired; multiplying a first calculated value by a first enlargement threshold or a first reduction threshold according to the comparison result of the sizes of adjacent face frames to obtain a new first calculated value, and then replacing the first calculated value with the new first calculated value; comparing the new first calculated value with a first judgment threshold to obtain a change trend of the face frame, and then obtaining a target motion trend, wherein the first calculated value is greater than 0; If the new first calculated value is greater than the first judgment threshold, it is judged that the change trend of the face frame is getting larger, and then the target movement trend is obtained to be close to the electronic device; if the new first calculated value is less than the first judgment threshold, it is judged that the change trend of the face frame is getting smaller, and then the target movement trend is obtained to be away from the electronic device; Performing face recognition on the image in the face frame to determine the degree of match between the image in the face frame and the preset user image; S3: when the degree of match between the image in the face frame and the preset user image reaches a preset threshold, starting voice recognition to determine whether to control the electronic device to wake up; starting timing while starting voice recognition, if the timing exceeds the preset time and the electronic device has not been controlled to wake up, clearing all the acquired face frames and re-executing the step S1.
2. The control method according to claim 1, characterized in that: Before executing step S2, a first face frame comparison step is also included, and the first face frame comparison step includes: Comparing the face frame with a first preset face frame to determine whether the face frame is larger than the first preset face frame; If it is determined that the face frame is larger than the first preset face frame, step S2 is executed.
3. The control method according to claim 2, characterized in that: Before executing step S2, a frame counting step is also included, and the frame counting step includes: If it is determined that the face frame is smaller than or equal to the first preset face frame, the frame count is increased by 1 to obtain a new frame count, and then the frame count is replaced by the new frame count; Comparing the new frame count with a preset frame count to determine whether the new frame count is greater than the preset frame count; If it is determined that the new frame count is greater than the preset frame count, the movement trend of the target is obtained according to the change trend of the face frame.
4. The control method according to claim 3, characterized in that: Before executing step S2, a second face frame comparison step is also included, and the second face frame comparison step includes: Determining whether the target's movement trend is close to the electronic device; If it is determined that the movement trend of the target is approaching the electronic device, comparing the newly obtained face frame with the second preset face frame to determine whether the newly obtained face frame is larger than the second preset face frame; If it is determined that the newly obtained face frame is larger than the second preset face frame, step S2 is executed.
5. The control method according to claim 1, characterized in that: The step of acquiring video stream data and then performing face detection on the video stream data to obtain a face frame includes: Each frame of the image in the video stream data is obtained, and then face detection is performed on each frame of the image in sequence in the video stream data to obtain a face frame.
6. The control method according to claim 5, characterized in that: If face detection is performed on the same frame of the image to obtain at least two face frames, only the face frame closest to the center point of the image is obtained.
7. The control method according to claim 1, characterized in that: The starting of voice recognition to determine whether to control the electronic device to wake up includes: Collecting sound information, and then comparing the sound information with pre-stored sound information to determine whether the sound information matches the pre-stored sound information; If it is determined that the sound information matches the pre-stored sound information, the electronic device is controlled to wake up.
8. A control system, characterized in that: Used to implement the control method as described in any one of claims 1 to 7, the control system includes a video stream data acquisition unit, a face detection unit, a face recognition unit, a voice recognition unit and a wake-up unit, wherein the video stream data acquisition unit is used to acquire video stream data; the face detection unit is used to receive the video stream data acquired by the video stream data acquisition unit, and then perform face detection on the video stream data to obtain a face frame; the face recognition unit is used to perform face recognition on the image in the face frame to determine the matching degree between the image in the face frame and the preset user image, and after the matching degree between the image in the face frame and the preset user image reaches a preset threshold, start voice recognition to determine whether to control the electronic device to wake up; the wake-up unit is used to wake up the electronic device.
9. The control system according to claim 8, characterized in that: It also includes a first face frame comparison unit, which is used to compare the face frame with a first preset face frame to determine whether the face frame is larger than the first preset face frame.
10. The control system according to claim 9, characterized in that: The system also includes a frame counting unit, which is used to add 1 to the frame count to obtain a new frame count, and then replace the frame count with the new frame count.
11. The control system according to claim 10, characterized in that: It also includes a frame count comparison unit, which is used to determine whether the new frame count is greater than the preset frame count. If it is determined that the new frame count is greater than the preset frame count, the movement trend of the target is obtained according to the change trend of the face frame.
12. The control system according to claim 11, characterized in that: It also includes a second face frame comparison unit, which is used to determine whether the target's movement trend is approaching the electronic device. If the target's movement trend is determined to be approaching the electronic device, the newly obtained face frame is compared with the second preset face frame to determine whether the newly obtained face frame is larger than the second preset face frame.
Citation Information
Patent Citations
Method and system for waking up smart home equipment voice control device
CN105700363A
Access control realization method and access control realization system for person and certificate unification based on biological feature recognition
CN108876998A
Wake-up method of electronic equipment, storage medium and robot
CN109976506A
Access control system based on video photography
CN110782568A
Detection result output method, electronic device, and medium
WO2021190387A1
