Control method and control system

Through the analysis of video stream data and object detection, the wake-up or sleep of electronic devices is automatically controlled, which solves the inconvenience and high power consumption of device wake-up and sleep control in the prior art, and improves the start-up speed and energy efficiency of the device.

CN114265626BActive Publication Date: 2025-03-18SENSLAB INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111410361.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2025-03-18
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

Existing electronic devices need to be manually awakened when the operator arrives, and manually controlled to enter the sleep state when leaving, resulting in a reduced startup speed and an increase in power consumption.

Method used

By acquiring video stream data, detecting the target object in the image and obtaining the image of its movement change, and performing object detection to obtain the trend of movement change, thereby automatically controlling the wake-up or sleep of the electronic device.

Benefits of technology

It realizes timely control of characters to wake up or sleep when they are approaching or away from electronic devices, which improves the startup speed of electronic devices and reduces power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114265626B_ABST
    Figure CN114265626B_ABST
Patent Text Reader

Abstract

The present invention provides a control method and a control system, which is applied to electronic devices to control the awakening and sleeping of electronic devices. The control method includes acquiring video stream data, detecting a target object in each frame of the video stream data, acquiring an image in which the target object has motion changes, performing target detection on the image in which the target object has motion changes to obtain the motion change trend of the target object, and controlling the electronic device to wake up or sleep according to the motion change trend of the target object. The electronic device can be controlled to wake up or sleep in time when a person approaches or moves away from the electronic device through the motion change of the target object in the video stream data and the motion change trend of the target object, thereby increasing the aerodynamic speed of the electronic device, and controlling the electronic device to sleep in time, thereby reducing the power consumption of the electronic device. The present invention also provides a control system for implementing the control method.
Need to check novelty before this filing date? Find Prior Art

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 up after they arrive in front of them, which results in the operator being unable to use the electronic device immediately upon arrival, making it inconvenient for the operator to use. When the operator leaves, the electronic device also requires manual control or a long time before it enters a sleep state, increasing the power consumption of the electronic device.

[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 or sleeping of an electronic device, improving the startup speed of the electronic device and reducing the power consumption of the electronic device.

[0005] To achieve the above object, the control method of the present invention is applied to an electronic device to control the wake-up and sleep of the electronic device. The control method includes:

[0006] Acquire video stream data, detect a target object in each frame of the video stream data, and acquire an image in which the target object has motion changes;

[0007] Performing target detection on the image in which the target object has motion changes to obtain the motion change trend of the target object;

[0008] According to the movement change trend of the target object, the electronic device is controlled to wake up or sleep.

[0009] The beneficial effects of the control method are: acquiring video stream data, detecting the target object in each frame image of the video stream data, acquiring an image in which the target object has motion changes, performing target detection on the image in which the target object has motion changes to obtain the motion change trend of the target object, and controlling the electronic device to wake up or sleep according to the motion change trend of the target object. The electronic device can be timely controlled to wake up or sleep when a person approaches or moves away from the electronic device through the motion changes of the target object in the video stream data and the motion change trend of the target object, thereby improving the aerodynamic speed of the electronic device, and timely controlling the electronic device to sleep, thereby reducing the power consumption of the electronic device.

[0010] Optionally, the acquiring of video stream data, detecting a target object in each frame of the video stream data, and acquiring an image in which the target object has motion changes, includes:

[0011] Extracting multiple frames of images from the video stream data, and detecting whether there is a target object in the images;

[0012] Comparing two adjacent frames of images containing the target object to determine whether the target object has motion changes;

[0013] If it is determined that the target object has motion changes, an image of the target object having motion changes is obtained. The beneficial effect is that it is easy to accurately obtain an image of the target object having motion changes.

[0014] Optionally, comparing two adjacent frames of images in which the target object exists to determine whether the target object has a motion change includes:

[0015] Comparing two adjacent frames of images containing the target object to determine the difference between the two adjacent frames of images containing the target object;

[0016] Comparing the difference with a difference threshold to determine whether the difference is less than or equal to the difference threshold;

[0017] If it is determined that the difference is less than or equal to the difference threshold, it is determined that there is no motion change in the target object;

[0018] If the difference is greater than the difference threshold, it is determined that the target object has a motion change. The beneficial effect is to avoid inaccurate motion change detection caused by inaccurate acquisition of video stream data and slight changes in the environment.

[0019] Optionally, performing target detection on the image in which the target object has motion changes to obtain the motion change trend of the target object includes:

[0020] According to the sorting order of the images with motion changes of the target object in the video stream data, face detection is performed on the images with motion changes of the target object in sequence to obtain face frames;

[0021] According to the change trend of the face frame, the movement change trend of the target object is obtained.

[0022] Optionally, the performing face detection on the images with motion changes of the target object in sequence according to the sorting order of the images with motion changes of the target object in the video stream data to obtain face frames includes:

[0023] Face detection is performed on each frame of the target object in which there is a motion change, to determine whether there is a face in each frame of the target object in which there is a motion change. When there is a face in the image, a face frame is obtained from the image, the frame count is increased by 1 to obtain a new frame count, and the frame count is replaced by the new frame count to obtain at least one face frame. The beneficial effect is that the accuracy of the motion trend detection of the target object is improved by calculating the frame count.

[0024] Optionally, obtaining the movement change trend of the target object according to the change trend of the face frame includes:

[0025] According to the acquisition order of the face frames, the sizes of adjacent face frames are compared in sequence;

[0026] According to the comparison result of the sizes of the adjacent face frames, multiply the first calculated value by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then replace the first calculated value with the new first calculated value;

[0027] The new first calculated value is compared with the first judgment threshold to obtain the change trend of the face frame, and then the motion change trend of the target object. The beneficial effect is that the influence of the false detection of individual face frames on the motion change trend detection of the target object is avoided, and the detection accuracy is improved.

[0028] Optionally, comparing the new first calculated value with a first judgment threshold to obtain a change trend of the face frame and further obtain a movement change trend of the target object includes:

[0029] Comparing the new first calculated value with the first judgment threshold to obtain a change trend of the face frame;

[0030] 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 movement change trend of the target object is close to the electronic device;

[0031] If the new first calculated value is less than the first judgment threshold, it is determined that the change trend of the face frame is getting smaller and smaller, and then the movement change trend of the target object is obtained to be away from the electronic device.

[0032] Optionally, obtaining the movement change trend of the target object according to the change trend of the face frame includes:

[0033] Determining whether the new frame count is less than a frame count threshold;

[0034] If it is determined that the new frame count is less than the frame count threshold, comparing the sizes of adjacent face frames in sequence according to the acquisition order of the face frames;

[0035] According to the comparison result of the sizes of the adjacent face frames, the first calculated value is multiplied by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then the first calculated value is replaced by the new first calculated value.

[0036] Optionally, obtaining the movement change trend of the target object according to the change trend of the face frame further includes:

[0037] If it is determined that the new frame count is greater than or equal to the frame count threshold, then obtaining an average frame of all the face frames acquired before the new frame count is equal to the frame count threshold;

[0038] comparing the size of the average value frame with the size of the most recently obtained face frame, and multiplying the second calculated value by a second enlargement threshold or a second reduction threshold according to the comparison result of the size of the average value frame with the size of the most recently obtained face frame to obtain a new second calculated value, and then replacing the second calculated value with the new second calculated value;

[0039] Performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a comparison result value;

[0040] The comparison result value is compared with the second judgment threshold to obtain the change trend of the face frame, and then the motion change trend of the target object is obtained. The beneficial effect is that the influence of the false detection of individual face frames on the motion change trend detection of the target object is avoided, and the accuracy of the detection is further improved by combining the frame count.

[0041] Optionally, comparing the comparison result value with a second judgment threshold to obtain a change trend of the face frame and further obtain a movement change trend of the target object includes:

[0042] Comparing the comparison result value with a second judgment threshold value to obtain a change trend of the face frame;

[0043] If the comparison result value is greater than the second judgment threshold, it is judged that the change trend of the face frame is getting larger, and then the movement change trend of the target object is close to the electronic device;

[0044] If the comparison result value is less than the second judgment threshold, it is determined that the change trend of the face frame is getting smaller and smaller, and then the movement change trend of the target object is obtained to be away from the electronic device.

[0045] Optionally, performing target detection on the image in which the target object has motion changes to obtain the motion change trend of the target object includes:

[0046] According to the sorting order of the images with motion changes of the target object in the video stream data, sequentially perform human shape detection on the images with motion changes of the target object to obtain human shape frames;

[0047] According to the change trend of the human-shaped frame, the movement change trend of the target object is obtained.

[0048] Optionally, the performing human shape detection on the images with motion changes of the target object in sequence according to the sorting order of the images with motion changes of the target object in the video stream data to obtain human shape frames includes:

[0049] Performing human figure detection on each frame of the target object with motion changes in turn to determine whether there is a human figure in each frame of the target object with motion changes, when a human figure exists in the image, obtaining a human figure frame from the image, then adding 1 to the frame count to obtain a new frame count, and replacing the frame count with the new frame count to obtain at least one human figure frame. The beneficial effect is that it is convenient to improve the accuracy of detecting the motion trend of the target object by calculating the frame count.

[0050] Optionally, obtaining the movement change trend of the target object according to the change trend of the human-shaped frame includes:

[0051] According to the order in which the human-shaped frames are obtained, the sizes of the adjacent human-shaped frames are compared in sequence;

[0052] According to the comparison result of the sizes of the adjacent human-shaped frames, multiply the first calculated value by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then replace the first calculated value with the new first calculated value;

[0053] The new first calculated value is compared with the first judgment threshold to obtain the change trend of the human frame, and then the motion change trend of the target object. The beneficial effect is to avoid the influence of the false detection of individual human frames on the motion change trend detection of the target object, thereby improving the accuracy of detection.

[0054] Optionally, comparing the new first calculated value with a first judgment threshold to obtain a change trend of the human-shaped frame and further obtain a movement change trend of the target object includes:

[0055] Compare the new first calculated value with the first judgment threshold to obtain a change trend of the human-shaped frame;

[0056] If the new first calculated value is greater than the first judgment threshold, it is judged that the change trend of the human-shaped frame is getting larger, and then the movement change trend of the target object is close to the electronic device;

[0057] If the new first calculated value is less than the first judgment threshold, it is determined that the change trend of the human-shaped frame is getting smaller and smaller, and then the movement change trend of the target object is obtained to be away from the electronic device.

[0058] Optionally, obtaining the movement change trend of the target object according to the change trend of the human-shaped frame includes:

[0059] Determine whether the new frame count is less than a frame count threshold;

[0060] If it is determined that the new frame count is less than the frame count threshold, comparing the sizes of the human-shaped frames in the adjacent images in sequence according to the sorting order of the images in the video stream data;

[0061] According to the comparison result of the sizes of the human-shaped frames in the adjacent images, the first calculated value is multiplied by the first enlargement threshold or the first reduction threshold to obtain a new first calculated value, and then the first calculated value is replaced by the new first calculated value.

[0062] Optionally, obtaining the movement change trend of the target object according to the change trend of the human-shaped frame further includes:

[0063] If it is determined that the new frame count is greater than or equal to the frame count threshold, then obtaining an average value frame of all the human-shaped frames acquired before the new frame count is equal to the frame count threshold;

[0064] Comparing the sizes of the average value frame and the most recently obtained human-shaped frame, multiplying the second calculated value by a second enlargement threshold or a second reduction threshold according to the comparison result of the sizes of the average value frame and the most recently obtained human-shaped frame to obtain a new second calculated value, and then replacing the second calculated value with the new second calculated value;

[0065] Performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a comparison result value;

[0066] The comparison result value is compared with the second judgment threshold to obtain the change trend of the human frame, and then the motion change trend of the target object. The beneficial effect is that the influence of the false detection of individual human frames on the motion change trend detection of the target object is avoided, and the accuracy of the detection is further improved in combination with the frame count.

[0067] Optionally, comparing the comparison result value with a second judgment threshold to obtain a change trend of the human-shaped frame and further obtain a movement change trend of the target object includes:

[0068] Compare the new comparison result value with the second judgment threshold to obtain a change trend of the human-shaped frame;

[0069] If the comparison result value is greater than the second judgment threshold, it is judged that the change trend of the human-shaped frame is getting larger, and then the movement change trend of the target object is close to the electronic device;

[0070] If the comparison result value is less than the second judgment threshold, it is determined that the change trend of the human-shaped frame is getting smaller and smaller, and then the movement change trend of the target object is obtained to be away from the electronic device.

[0071] Optionally, performing target detection on the image in which the target object has motion changes to obtain the motion change trend of the target object includes:

[0072] According to the sorting order of the images of the target object with motion changes in the video stream data, face detection and human shape detection are sequentially performed on the images of the target object with motion changes to obtain face frames and human shape frames;

[0073] According to the change trend of the face frame and the change trend of the human frame, the movement change trend of the target object is obtained. The beneficial effect is that the accuracy of the movement change trend detection of the target object is improved by combining the face frame and the human frame.

[0074] Optionally, the performing face detection and human shape detection on the images with motion changes of the target object in sequence according to the sorting order of the images with motion changes of the target object in the video stream data to obtain the face frame and the human shape frame includes:

[0075] Perform face detection and human shape detection on each frame image in which the target object has motion changes in turn to determine whether a face and a human shape exist simultaneously in each frame image in which the target object has motion changes. When a face and a human shape exist simultaneously in the image, a face frame and a human shape frame are obtained from the image, then the frame count is increased by 1 to obtain a new frame count, and the frame count is replaced by the new frame count to obtain at least one face frame and at least one human shape frame. The beneficial effect is that it is convenient to improve the accuracy of the motion trend detection of the target object by calculating the frame count.

[0076] Optionally, obtaining the movement change trend of the target object according to the change trend of the face frame and the change trend of the human-shaped frame includes:

[0077] According to the acquisition order of the face frames, the sizes of the adjacent face frames are compared in sequence, and according to the acquisition order of the human-shaped frames, the sizes of the adjacent human-shaped frames are compared in sequence;

[0078] According to the comparison result of the sizes of the adjacent face frames, multiply the first calculated value by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then replace the first calculated value with the new first calculated value;

[0079] According to the comparison result of the sizes of the adjacent human-shaped frames, multiply the second calculated value by a second enlargement threshold or a second reduction threshold to obtain a new second calculated value, and then replace the second calculated value with the new second calculated value;

[0080] Performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a first comparison result value;

[0081] The first comparison result value is compared with the first judgment threshold value to obtain the change trend of the face frame and the change trend of the human-shaped frame, and then obtain the motion change trend of the target object. The beneficial effect is that the influence of the false detection of individual face frames and human-shaped frames on the motion change trend of the target object is avoided, and the detection accuracy is improved.

[0082] Optionally, comparing the first comparison result value with a first judgment threshold to obtain a change trend of the face frame and a change trend of the human shape frame, and then obtaining a movement change trend of the target object, includes:

[0083] Compare the first comparison result value with a first judgment threshold to obtain a change trend of the face frame;

[0084] If the first comparison result value is greater than the first judgment threshold, it is determined that the change trend of the face frame is getting bigger and bigger, and the change trend of the human-shaped frame is getting bigger and bigger, and then it can be obtained that the movement change trend of the target object is approaching the electronic device;

[0085] If the first comparison result value is less than the first judgment threshold, it is determined that the change trend of the face frame is getting smaller and smaller, and the change trend of the human shape frame is getting smaller and smaller, and then it can be obtained that the movement change trend of the target object is moving away from the electronic device.

[0086] Optionally, obtaining the movement change trend of the target object according to the change trend of the face frame and the change trend of the human-shaped frame includes:

[0087] Determine whether the new frame count is less than a frame count threshold;

[0088] If it is determined that the new frame count is less than the frame count threshold, comparing the sizes of adjacent face frames in sequence according to the acquisition order of the face frames, and comparing the sizes of adjacent human-shaped frames in sequence according to the acquisition order of the human-shaped frames;

[0089] According to the comparison result of the sizes of the adjacent face frames, multiply the first calculated value by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then replace the first calculated value with the new first calculated value;

[0090] According to the comparison result of the sizes of the adjacent human-shaped frames, multiply the second calculated value by a second enlargement threshold or a second reduction threshold to obtain a new second calculated value, and then replace the second calculated value with the new second calculated value;

[0091] A weighted average calculation is performed on the new first calculated value and the new second calculated value to obtain a first comparison result value.

[0092] Optionally, obtaining the movement change trend of the target object according to the change trend of the face frame and the change trend of the human-shaped frame further includes:

[0093] If it is determined that the new frame count is greater than or equal to the frame count threshold, then obtaining an average value frame of all the face frames and an average value frame of all the human shape frames acquired before the new frame count is equal to the frame count threshold;

[0094] comparing the size of the average frame of all the face frames with the size of the most recently obtained face frame, and multiplying the third calculated value by a third enlargement threshold or a third reduction threshold according to the comparison result of the average frame of all the face frames with the size of the most recently obtained face frame to obtain a new third calculated value, and then replacing the third calculated value with the new third calculated value;

[0095] Comparing the size of the average value frame of all the human-shaped frames with the size of the most recently obtained human-shaped frame, multiplying the fourth calculated value by a fourth enlargement threshold or a fourth reduction threshold according to the comparison result of the average value frame of all the human-shaped frames with the size of the most recently obtained human-shaped frame to obtain a new fourth calculated value, and then replacing the fourth calculated value with the new fourth calculated value;

[0096] Performing weighted average calculation on the new third calculated value and the new fourth calculated value to obtain a second comparison result value;

[0097] Performing a weighted average on the first comparison result and the second comparison result value to obtain a third comparison result value;

[0098] The third comparison result value is compared with the second judgment threshold value to obtain the change trend of the face frame and the change trend of the human shape frame, and then obtain the movement change trend of the target object.

[0099] Optionally, comparing the third comparison result value with the second judgment threshold value to obtain the change trend of the face frame and the change trend of the human shape frame, and then obtaining the movement change trend of the target object, includes:

[0100] Compare the third comparison result value with the second judgment threshold value to obtain a change trend of the face frame and a change trend of the human shape frame;

[0101] If the third comparison result value is greater than the second judgment threshold, it is judged that the change trend of the face frame is getting bigger and bigger, and the change trend of the human shape frame is getting bigger and bigger, and then it can be obtained that the movement change trend of the target object is approaching the electronic device;

[0102] If the third comparison result value is less than the second judgment threshold, it is judged that the change trend of the face frame is getting smaller and smaller, and the change trend of the human shape frame is getting smaller and smaller, and then it can be obtained that the movement change trend of the target object is moving away from the electronic device.

[0103] The present invention also provides a control system, which includes a video stream data acquisition unit, a motion detection unit, a motion trend calculation unit, and a wake-up and sleep control unit, wherein the video stream data acquisition unit is used to acquire video stream data; the motion detection unit is used to detect the target object in each frame image of the video stream data, and acquire an image in which the target object has motion changes; the motion trend calculation unit is used to perform target detection on the image in which the target object has motion changes, so as to obtain the motion change trend of the target object; and the wake-up and sleep control unit is used to control the electronic device to wake up or sleep according to the motion change trend of the target object.

[0104] The beneficial effects of the control system are: the video stream data acquisition unit is used to acquire video stream data; the motion detection unit is used to detect the target object in each frame image of the video stream data, and acquire the image with motion change of the target object; the motion trend calculation unit is used to perform target detection on the image with motion change of the target object, so as to obtain the motion change trend of the target object; the wake-up and sleep control unit is used to control the electronic device to wake up or sleep according to the motion change trend of the target object, and can timely control the electronic device to wake up or sleep when a person approaches or moves away from the electronic device through the motion change of the target object in the video stream data and the motion change trend of the target object, thereby improving the aerodynamic speed of the electronic device, and timely controlling the electronic device to sleep, thereby reducing the power consumption of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0105] Figure 1 It is a structural block diagram of the control system of the present invention;

[0106] Figure 2 is a flow chart of the control method of the present invention;

[0107] Figure 3 is a schematic diagram of a first frame image in some embodiments of the present invention;

[0108] Figure 4 is a schematic diagram of a second frame image in some embodiments of the present invention;

[0109] Figure 5 is a schematic diagram of a third frame image in some embodiments of the present invention;

[0110] Figure 6 is a schematic diagram of a fourth frame image in some embodiments of the present invention;

[0111] Figure 7 is a schematic diagram of a fifth frame of image in some embodiments of the present invention;

[0112] Figure 8 is a schematic diagram of a sixth frame of image in some embodiments of the present invention;

[0113] Fig. 9 is a schematic diagram of a seventh frame of image in some embodiments of the present invention;

[0114] Fig.10 It is a schematic diagram of two face frames appearing in one frame of image according to the present invention. DETAILED DESCRIPTION

[0115] 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.

[0116] In view of the problems existing in the prior art, an embodiment of the present invention provides a control system. Figure 1The control system 100 includes a video stream data acquisition unit 101, a motion detection unit 102, a motion trend calculation unit 103, and a wake-up and sleep control unit 104, wherein the video stream data acquisition unit 101 is used to acquire video stream data; the motion detection unit 102 is used to detect the target object in each frame of the video stream data and acquire the image with motion change of the target object; the motion trend calculation unit 103 is used to perform target detection on the image with motion change of the target object to obtain the motion change trend of the target object; the wake-up and sleep control unit 104 is used to control the electronic device to wake up or sleep according to the motion change trend of the target object. The electronic device includes a laptop computer, a mobile phone, etc.

[0117] Figure 2 Flow chart of the control method of the present invention. Figure 2 The control method is applied to an electronic device to control the wake-up and sleep of the electronic device, and the control method is implemented by the control system. The control method includes the following steps:

[0118] S1: Acquire video stream data, detect a target object in each frame of the video stream data, and acquire an image in which the target object has motion changes;

[0119] S2: performing target detection on the image in which the target object has motion changes, so as to obtain the motion change trend of the target object;

[0120] S3: Controlling the electronic device to wake up or sleep according to the movement change trend of the target object.

[0121] In some embodiments, the person detection includes at least one of face frame detection and human shape frame detection.

[0122] In some embodiments, face detection is performed using 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 face pictures that have undergone normalization preprocessing 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 a 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. The training method of the neural network model for human shape detection is the same as the training method of the neural network model for face detection, and face detection and human shape detection can also be performed by other methods. The methods of face detection and human shape detection are not specifically limited here.

[0123] In some embodiments, the method of acquiring video stream data, detecting the target object in each frame image of the video stream data, and acquiring an image in which the target object has motion changes includes: extracting multiple frames of images from the video stream data, and detecting whether the target object exists in the images; comparing two adjacent frames of images in which the target object exists to determine whether the target object has motion changes; if it is determined that the target object has motion changes, acquiring an image in which the target object has motion changes.

[0124] In some embodiments, comparing two adjacent frames of images in which the target object exists to determine whether the target object has any motion change includes: comparing two adjacent frames of images in which the target object exists to determine the difference between the two adjacent frames of images in which the target object exists; comparing the difference with a difference threshold to determine whether the difference is less than or equal to the difference threshold; if it is determined that the difference is less than or equal to the difference threshold, then it is determined that there is no motion change in the target object; if the difference is greater than the difference threshold, then it is determined that there is motion change in the target object.

[0125] Figure 3 is a schematic diagram of a first frame image in some embodiments of the present invention, Figure 4 is the second frame image in some embodiments of the present invention. Figure 3 and Figure 4The first frame image 300 and the second frame image 400 are two adjacent frame images. The first frame image 300 and the second frame image 400 are detected to determine whether there is a target object in either the first frame image 300 or the second frame image 400.

[0126] Figure 5 FIG. 1 is a schematic diagram of a third frame image in some embodiments of the present invention. Figure 4 and Figure 5 , the third frame image 500 is the current frame image, the second frame image 400 is the previous frame image of the third frame image 500, that is, the second frame image 400 and the third frame image 500 are two adjacent frame images, the third frame image 500 is detected, and it is detected that there is an image of 20% of the foot 501 in the third frame image 500, that is, there is a target object in the third frame image 500, the second frame image 400 and the third frame image 500 are compared, and it is determined that the difference between the second frame image 400 and the third frame image 500 is 52, and the difference threshold is 50, the difference between the second frame image 400 and the third frame image 500 is greater than the difference threshold, and the third frame image 500 is determined to be an image with motion changes of the target object.

[0127] Figure 6 FIG. 4 is a schematic diagram of a fourth frame image in some embodiments of the present invention. Figure 5 and Figure 6 , the fourth frame image 600 is the current frame image, the third frame image 500 is the previous frame image of the fourth frame image 600, that is, the third frame image 500 and the fourth needle image 600 are two adjacent frame images, the fourth frame image 600 is detected, and it is detected that there is an 80% image of the foot 501 in the fourth frame image 600, that is, there is a target object in the fourth frame image 600, the third frame image 500 and the fourth frame image 600 are compared, and it is determined that the difference between the third frame image 500 and the fourth frame image 600 is 55, and the difference threshold is 50, the difference between the third frame image 500 and the fourth frame image 600 is greater than the difference threshold, and the fourth frame image 600 is determined to be an image with motion changes of the target object.

[0128] Figure 7 FIG. 5 is a schematic diagram of a fifth frame image in some embodiments of the present invention. Figure 6 and Figure 7, the fifth frame image 700 is the current frame image, the fourth frame image 600 is the previous frame image of the fifth frame image 700, that is, the fourth frame image 600 and the fifth frame image 700 are two adjacent frame images, the fifth frame image 700 is detected, and it is detected that there is an image of 80% of the human body 701 in the fifth frame image 700, that is, there is a target object in the fifth frame image 700, the fourth frame image 600 and the fifth frame image 700 are compared, and it is determined that the difference between the fourth frame image 600 and the fifth frame image 700 is 300, and the difference threshold is 50, the difference between the fourth frame image 600 and the fifth frame image 700 is greater than the difference threshold, and it is determined that the fifth frame image 700 is an image with motion changes of the target object.

[0129] Figure 8 FIG. 6 is a schematic diagram of the sixth frame image in some embodiments of the present invention. Figure 7 and Figure 8 , the sixth frame image 800 is the current frame image, the fifth frame image 700 is the previous frame image of the sixth frame image 800, that is, the fifth frame image 700 and the sixth frame image 800 are two adjacent frame images, the sixth frame image 800 is detected, and it is detected that there is a 100% image of the human body 701 in the sixth frame image 800, that is, there is a target object in the sixth frame image 800, the fifth frame image 700 and the sixth frame image 800 are compared, and it is determined that the difference between the fifth frame image 700 and the sixth frame image 800 is 400, and the difference threshold is 50, the difference between the fifth frame image 700 and the sixth frame image 800 is greater than the difference threshold, and the sixth frame image 800 is determined to be an image with motion changes of the target object.

[0130] Fig. 9 FIG. 1 is a schematic diagram of the seventh frame image in some embodiments of the present invention. Figure 8 and Fig. 9, the seventh frame image 900 is the current frame image, the sixth frame image 800 is the previous frame image of the seventh frame image 900, that is, the sixth frame image 800 and the seventh frame image 900 are two adjacent frame images, the seventh frame image 900 is detected, and it is detected that there is a 100% image of the human body 701 in the seventh frame image 900, that is, there is a target object in the seventh frame image 900, the sixth frame image 800 and the seventh frame image 900 are compared, and the seventh frame image 900 moves forward relative to the image of the human body 701 in the sixth frame image 800, and it is determined that the difference between the sixth frame image 800 and the seventh frame image 900 is 600, and the difference threshold is 50, the difference between the sixth frame image 800 and the seventh frame image 900 is greater than the difference threshold, and it is determined that the seventh frame image 900 is an image with motion changes of the target object.

[0131] In some embodiments, target detection is performed on images in which the target object has motion changes to obtain the motion change trend of the target object, including: performing face detection on the images in which the target object has motion changes in sequence according to the sorting order of the images in which the target object has motion changes in the video stream data to obtain face frames; and obtaining the motion change trend of the target object based on the change trend of the face frames.

[0132] In some embodiments, face detection is performed on the images in which the target object has motion changes in sequence according to the sorting order of the images in the video stream data to obtain face frames, including: face detection is performed on each frame of the image in which the target object has motion changes in sequence to determine whether there is a face in each frame of the image in which the target object has motion changes, when a face exists in the image, a face frame is obtained from the image, the frame count is increased by 1 to obtain a new frame count, and the frame count is replaced by the new frame count to obtain at least one face frame.

[0133] Reference Figure 5 , the frame count is 0, face detection is performed on the third frame image 500, and it is determined that there is no face in the third frame image 500, and a face frame cannot be obtained from the third frame image 500. The frame count remains unchanged and is maintained at 0.

[0134] Reference Figure 6 , the frame count is 0, face detection is performed on the fourth frame image 600, and it is determined that there is no face in the fourth frame image 600, and a face frame cannot be obtained from the fourth frame image 600. The frame count remains unchanged and is maintained at 0.

[0135] Reference Figure 7, the frame count is 0, face detection is performed on the fifth frame image 700, it is determined that a face exists in the fifth frame image 700, and the first face frame 702 in the fifth frame image 700 is obtained, then the frame count is added by 1, that is, 0 plus 1 equals 1, and the new frame count is 1, and the frame count is replaced by the new frame count, then the frame count is 1.

[0136] Reference Figure 8 , the frame count is 1, face detection is performed on the sixth frame image 800, it is determined that a face exists in the sixth frame image 800, and a second face frame 801 in the sixth frame image 800 is obtained, then the frame count is added by 1, that is, 1 plus 1 equals 2, and the new frame count is 2, and the frame count is replaced by the new frame count, then the frame count is 2.

[0137] Reference Fig. 9 , the frame count is 2, face detection is performed on the seventh frame image 902, it is determined that there is a face in the seventh frame image 900, and the third face frame 901 in the seventh frame image 900 is obtained, then the frame count is increased by 1, that is, 2 plus 1 equals 3, and the new frame count is 3, and the frame count is replaced by the new frame count, then the frame count is 3.

[0138] In some embodiments, obtaining the movement change trend of the target object based on the change trend of the face frame includes: comparing the sizes of adjacent face frames in sequence according to the order in which the face frames are acquired; multiplying a first calculated value by a first enlargement threshold or a first reduction threshold based on 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 movement change trend of the target object.

[0139] 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. Specifically, in the adjacent face frames, when the size of the face frame in the latter order is larger than the size of the face frame in the former order, the first calculated value is multiplied by the first enlargement threshold; when the size of the face frame in the image in the latter order is smaller than the size of the face frame in the image in the former order, the first calculated value is multiplied by the first reduction threshold.

[0140] In some embodiments, comparing the new first calculated value with the first judgment threshold to obtain the change trend of the face frame, and then obtaining the motion change trend of the target object, includes: comparing the new first calculated value with the first judgment threshold to obtain the change trend of the face frame; if the new first calculated value is greater than the first judgment threshold, then judging that the change trend of the face frame is increasing, and then obtaining the motion change trend of the target object is approaching the electronic device; if the new first calculated value is less than the first judgment threshold, then judging that the change trend of the face frame is decreasing, and then obtaining the motion change trend of the target object is moving away from the electronic device.

[0141] In some embodiments, the first determination threshold is equal to the first calculated value.

[0142] Reference Figure 7 to Figure 9 , the preset first calculation value is 20, the first judgment threshold is 20, the first enlargement threshold is 1.1, the first reduction threshold is 0.9, the four vertex coordinates of the first face frame 702 are (10, 11), (15, 11), (10, 6) and (15, 6), and the four vertex coordinates of the second face frame 801 are (9.75, 11.25), (15.25, 11.25), (9.75, 5.75) and (15.25, 5.75), the four vertex coordinates of the third face frame 901 are respectively (9.5, 11.5), (15.5, 11.5), (9.5, 5.5) and (15.5, 5.5), that is, the length of the first face frame 702 is 5, the height of the first face frame 702 is 5, the length of the second face frame 801 is 5.5, the height of the second face frame 801 is 5.5, the length of the third face frame 901 is 6, and the height of the third face frame 901 is 6. If it is determined that the size of the second face frame 801 is larger than the size of the first face frame 702, the first calculated value and the first enlargement threshold are multiplied, that is, 20×1.1=22, the new first calculated value is 22, and the first calculated value becomes 22; if it is determined that the size of the third face frame 901 is larger than the size of the second face frame 801, the first calculated value and the first enlargement threshold are multiplied, that is, 22×1.1=24.2, the new first calculated value is 24.2, and the first calculated value becomes 24.2. If it is determined that the first calculated value is greater than the first judgment threshold, it is determined that the change trend of the face frame is getting larger and larger, and then it can be obtained that the target movement trend is approaching the electronic device, and then the electronic device is controlled to wake up.

[0143] In some embodiments, the control method also includes: when it is judged that the change trend of the face frame is getting larger, the new first calculated value is compared with the wake-up threshold, and if the new first calculated value is greater than the wake-up threshold, the electronic device is controlled to wake up; when it is judged that the change trend of the face frame is getting smaller, the new first calculated value is compared with the sleep threshold, and if the new first calculated value is less than the wake-up threshold, the electronic device is controlled to sleep.

[0144] In some embodiments, obtaining the motion change trend of the target object based on the change trend of the face frame includes: determining whether the new frame count is less than a frame count threshold; if it is determined that the new frame count is less than the frame count threshold, comparing the sizes of adjacent face frames in the order in which the face frames are acquired; based on the comparison result of the sizes of adjacent face frames, multiplying the first calculated value by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then replacing the first calculated value with the new first calculated value.

[0145] In some embodiments, obtaining the motion change trend of the target object based on the change trend of the face frame also includes: if it is determined that the new frame count is greater than or equal to a frame count threshold, obtaining an average frame of all the face frames acquired before the new frame count is equal to the frame count threshold; comparing the size of the average frame with the size of the most recently obtained face frame, and based on the comparison result of the average frame with the size of the most recently obtained face frame, multiplying a second calculated value by a second enlargement threshold or a second reduction threshold to obtain a new second calculated value, and then replacing the second calculated value with the new second calculated value; performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a comparison result value; comparing the comparison result value with a second judgment threshold to obtain the change trend of the face frame, and then obtaining the motion change trend of the target object.

[0146] In some embodiments, comparing the comparison result value with a second judgment threshold to obtain a change trend of the face frame, and then obtaining a motion change trend of the target object, includes: comparing the comparison result value with a second judgment threshold to obtain a change trend of the face frame; if the comparison result value is greater than the second judgment threshold, then judging that the change trend of the face frame is increasing, and then obtaining a motion change trend of the target object is approaching the electronic device; if the comparison result value is less than the second judgment threshold, then judging that the change trend of the face frame is decreasing, and then obtaining a motion change trend of the target object is moving away from the electronic device.

[0147] In some embodiments, the first enlargement threshold and the second enlargement threshold are both greater than 1 and less than 2, the first reduction threshold and the second reduction threshold are both less than 1 and greater than 0, and the sum of the first enlargement threshold and the first reduction threshold is 2, and the sum of the second enlargement threshold and the second reduction threshold is 2. For example, the first enlargement threshold is 1.1, and the first reduction threshold is 0.9; for example, the second enlargement threshold is 1.3, and the second reduction threshold is 0.7. The control method also includes: when it is judged that the change trend of the face frame is getting bigger and bigger, the comparison result value is compared with the wake-up threshold, if the comparison result value is greater than the wake-up threshold, the electronic device is controlled to wake up; when it is judged that the change trend of the face frame is getting smaller and smaller, the comparison result value is compared with the sleep threshold, if the comparison result value is less than the wake-up threshold, the electronic device is controlled to sleep.

[0148] In some embodiments, target detection is performed on images in which the target object has motion changes to obtain the motion change trend of the target object, including: performing human shape detection on the images in which the target object has motion changes in sequence according to the sorting order of the images in which the target object has motion changes in the video stream data to obtain human shape frames; and obtaining the motion change trend of the target object based on the change trend of the human shape frame.

[0149] In some embodiments, the human figure detection is performed on the images in which the target object has motion changes in sequence according to the sorting order of the images in the video stream data to obtain a human figure frame, including: performing human figure detection on each frame image in which the target object has motion changes in sequence to determine whether there is a human figure in each frame image in which the target object has motion changes, when a human figure exists in the image, a human figure frame is obtained from the image, then the frame count is increased by 1 to obtain a new frame count, and the frame count is replaced by the new frame count to obtain at least one human figure frame.

[0150] In some embodiments, obtaining the movement change trend of the target object according to the change trend of the human-shaped frame includes: comparing the sizes of adjacent human-shaped frames in sequence according to the order in which the human-shaped frames are obtained; 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 human-shaped 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 human-shaped frame, and then obtaining the movement change trend of the target object.

[0151] In some embodiments, comparing the new first calculated value with the first judgment threshold to obtain the change trend of the human-shaped frame, and then obtaining the motion change trend of the target object, includes: comparing the new first calculated value with the first judgment threshold to obtain the change trend of the human-shaped frame; if the new first calculated value is greater than the first judgment threshold, then judging that the change trend of the human-shaped frame is getting larger and larger, and then obtaining the motion change trend of the target object is getting closer to the electronic device; if the new first calculated value is less than the first judgment threshold, then judging that the change trend of the human-shaped frame is getting smaller and smaller, and then obtaining the motion change trend of the target object is getting away from the electronic device.

[0152] The control method also includes: when it is judged that the change trend of the human-shaped frame is getting larger, the new first calculated value is compared with the wake-up threshold, and if the new first calculated value is greater than the wake-up threshold, the electronic device is controlled to wake up; when it is judged that the change trend of the human-shaped frame is getting smaller, the new first calculated value is compared with the sleep threshold, and if the new first calculated value is less than the wake-up threshold, the electronic device is controlled to sleep.

[0153] In some embodiments, obtaining the movement change trend of the target object according to the change trend of the human-shaped frame includes: determining whether the new frame count is less than a frame count threshold; if it is determined that the new frame count is less than the frame count threshold, comparing the sizes of the human-shaped frames in adjacent images in sequence according to the sorting order of the images in the video stream data; based on the comparison result of the sizes of the human-shaped frames in adjacent images, multiplying the first calculated value by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then replacing the first calculated value with the new first calculated value.

[0154] In some embodiments, obtaining the motion change trend of the target object according to the change trend of the human-shaped frame also includes: if it is determined that the new frame count is greater than or equal to a frame count threshold, obtaining an average value frame of all the human-shaped frames obtained before the new frame count is equal to the frame count threshold; comparing the size of the average value frame with the size of the most recently obtained human-shaped frame, and based on the comparison result of the average value frame with the size of the most recently obtained human-shaped frame, multiplying a second calculated value by a second enlargement threshold or a second reduction threshold to obtain a new second calculated value, and then replacing the second calculated value with the new second calculated value; performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a comparison result value; comparing the comparison result value with a second judgment threshold to obtain the change trend of the human-shaped frame, and then obtaining the motion change trend of the target object.

[0155] In some embodiments, the comparing the comparison result value with the second judgment threshold to obtain the change trend of the human-shaped frame, and then obtain the motion change trend of the target object, includes: comparing the new comparison result value with the second judgment threshold to obtain the change trend of the human-shaped frame; if the comparison result value is greater than the second judgment threshold, then judging that the change trend of the human-shaped frame is getting bigger and bigger, and then obtaining the motion change trend of the target object is getting closer to the electronic device; if the comparison result value is less than the second judgment threshold, then judging that the change trend of the human-shaped frame is getting smaller and smaller, and then obtaining the motion change trend of the target object is getting away from the electronic device.

[0156] In some embodiments, the first enlargement threshold and the second enlargement threshold are both greater than 1 and less than 2, the first reduction threshold and the second reduction threshold are both less than 1 and greater than 0, and the sum of the first enlargement threshold and the first reduction threshold is 2, and the sum of the second enlargement threshold and the second reduction threshold is 2. For example, the first enlargement threshold is 1.1, and the first reduction threshold is 0.9; for example, the second enlargement threshold is 1.3, and the second reduction threshold is 0.7. The control method also includes: when it is judged that the change trend of the human-shaped frame is getting bigger and bigger, the comparison result value is compared with the wake-up threshold, if the comparison result value is greater than the wake-up threshold, the electronic device is controlled to wake up; when it is judged that the change trend of the human-shaped frame is getting smaller and smaller, the comparison result value is compared with the sleep threshold, if the comparison result value is less than the wake-up threshold, the electronic device is controlled to sleep.

[0157] In some embodiments, target detection is performed on the image in which the target object has motion changes to obtain the motion change trend of the target object, including: performing face detection and human shape detection on the image in which the target object has motion changes in sequence according to the sorting order of the image in which the target object has motion changes in the video stream data to obtain a face frame and a human shape frame; and obtaining the motion change trend of the target object based on the change trend of the face frame and the change trend of the human shape frame.

[0158] In some embodiments, face detection and human shape detection are performed on the images in which the target object has motion changes in the order in which they are sorted in the video stream data to obtain face frames and human shape frames, including: face detection and human shape detection are performed on each frame of the image in which the target object has motion changes to determine whether both a face and a human shape exist in each frame of the image in which the target object has motion changes; when both a face and a human shape exist in the image, a face frame and a human shape frame are obtained from the image, the frame count is increased by 1 to obtain a new frame count, and the frame count is replaced by the new frame count to obtain at least one face frame and at least one human shape frame.

[0159] In some embodiments, obtaining the motion change trend of the target object according to the change trend of the face frame and the change trend of the human-shaped frame includes: comparing the sizes of adjacent face frames in sequence according to the acquisition order of the face frames, and comparing the sizes of adjacent human-shaped frames in sequence according to the acquisition order of the human-shaped frames; 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; multiplying a second calculated value by a second enlargement threshold or a second reduction threshold according to the comparison result of the sizes of adjacent human-shaped frames to obtain a new second calculated value, and then replacing the second calculated value with the new second calculated value; performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a first comparison result value; comparing the first comparison result value with a first judgment threshold to obtain the change trend of the face frame and the change trend of the human-shaped frame, and then obtaining the motion change trend of the target object.

[0160] In some embodiments, the comparing the first comparison result value with the first judgment threshold to obtain the change trend of the face frame and the change trend of the human-shaped frame, and then obtaining the motion change trend of the target object, includes: comparing the first comparison result value with the first judgment threshold to obtain the change trend of the face frame; if the first comparison result value is greater than the first judgment threshold, then it is judged that the change trend of the face frame is getting bigger and bigger, and the change trend of the human-shaped frame is getting bigger and bigger, and then it can be obtained that the motion change trend of the target object is approaching the electronic device; if the first comparison result value is less than the first judgment threshold, then it is judged that the change trend of the face frame is getting smaller and smaller, and the change trend of the human-shaped frame is getting smaller and smaller, and then it can be obtained that the motion change trend of the target object is moving away from the electronic device.

[0161] In some embodiments, obtaining the motion change trend of the target object according to the change trend of the face frame and the change trend of the human-shaped frame includes: determining whether the new frame count is less than a frame count threshold; if it is determined that the new frame count is less than the frame count threshold, comparing the sizes of adjacent face frames in sequence according to the acquisition order of the face frames, and comparing the sizes of adjacent human-shaped frames in sequence according to the acquisition order of the human-shaped frames; 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; multiplying a second calculated value by a second enlargement threshold or a second reduction threshold according to the comparison result of the sizes of adjacent human-shaped frames to obtain a new second calculated value, and then replacing the second calculated value with the new second calculated value; and performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a first comparison result value.

[0162] In some embodiments, obtaining the movement change trend of the target object according to the change trend of the face frame and the change trend of the human-shaped frame also includes: if it is determined that the new frame count is greater than or equal to a frame count threshold, obtaining the average value frame of all the face frames and the average value frame of all the human-shaped frames obtained before the new frame count is equal to the frame count threshold; comparing the size of the average value frame of all the face frames with the size of the latest face frame, and based on the comparison result of the average value frame of all the face frames with the size of the latest face frame, multiplying the third calculated value by a third enlargement threshold or a third reduction threshold to obtain a new third calculated value, and then replacing the third calculated value with the new third calculated value; comparing all the human-shaped frames The fourth calculated value is multiplied by a fourth enlargement threshold or a fourth reduction threshold according to a comparison result of the average value frame of all the human-shaped frames and the size of the latest obtained human-shaped frame to obtain a new fourth calculated value, and then the fourth calculated value is replaced by the new fourth calculated value; a weighted average calculation is performed on the new third calculated value and the new fourth calculated value to obtain a second comparison result value; a weighted average is performed on the first comparison result and the second comparison result value to obtain a third comparison result value; the third comparison result value is compared with the second judgment threshold to obtain a change trend of the human face frame and a change trend of the human-shaped frame, and then a motion change trend of the target object is obtained.

[0163] In some embodiments, comparing the third comparison result value with the second judgment threshold to obtain the change trend of the face frame and the change trend of the human-shaped frame, and then obtaining the motion change trend of the target object, includes: comparing the third comparison result value with the second judgment threshold to obtain the change trend of the face frame and the change trend of the human-shaped frame; if the third comparison result value is greater than the second judgment threshold, then it is judged that the change trend of the face frame is getting bigger and bigger, and the change trend of the human-shaped frame is getting bigger and bigger, and then it can be obtained that the motion change trend of the target object is approaching the electronic device; if the third comparison result value is less than the second judgment threshold, then it is judged that the change trend of the face frame is getting smaller and smaller, and the change trend of the human-shaped frame is getting smaller and smaller, and then it can be obtained that the motion change trend of the target object is moving away from the electronic device.

[0164] In some embodiments, the first enlargement threshold, the second enlargement threshold, the third enlargement threshold, and the fourth enlargement threshold are all greater than 1 and less than 2, the first reduction threshold, the second reduction threshold, the third reduction threshold, and the fourth reduction threshold are all less than 1 and greater than 0, and the sum of the first enlargement threshold and the first reduction threshold is 2, the sum of the second enlargement threshold and the second reduction threshold is 2, the sum of the third enlargement threshold and the third reduction threshold is 2, and the sum of the fourth enlargement threshold and the fourth reduction threshold is 2. For example, the first enlargement threshold is 1.1, and the first reduction threshold is 0.9; for example, the second enlargement threshold is 1.3, and the second reduction threshold is 0.7; for example, the third enlargement threshold is 1.1, and the third reduction threshold is 0.9; for example, the fourth enlargement threshold is 1.2, and the fourth reduction threshold is 0.8.

[0165] In some embodiments, the control method also includes: when it is judged that the changing trend of the human face frame is getting bigger and bigger, and the changing trend of the human shape frame is getting bigger and bigger, the third comparison result value is compared with the wake-up threshold, if the third comparison result value is greater than the wake-up threshold, the electronic device is controlled to wake up; when it is judged that the changing trend of the human face frame is getting smaller and smaller, and the changing trend of the human shape frame is getting smaller and smaller, the third comparison result value is compared with the sleep threshold, if the third comparison result value is less than the wake-up threshold, the electronic device is controlled to sleep.

[0166] In some embodiments, in the control method, if the number of face frames in the same image is greater than 1, only the face frame closest to the center point of the image is obtained. Selecting a suitable face frame to avoid mutual interference between multiple face frames can also reduce the complexity of control; if the number of human-shaped frames in the same image is greater than 1, only the human-shaped frame closest to the center point of the image is obtained. Selecting a suitable human-shaped frame to avoid mutual interference between multiple human-shaped frames can also reduce the complexity of control.

[0167] Fig.10 FIG. 1 is a schematic diagram of two face frames appearing in one frame of an image according to the present invention. Fig.10 , 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.

[0168] 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: Applied to electronic devices to control the wake-up and sleep of electronic devices, including: Acquire video stream data, detect a target object in each frame of the video stream data, and acquire an image in which the target object has motion changes; Performing target detection on the image in which the target object has motion changes to obtain the motion change trend of the target object; wherein, According to the sorting order of the images with motion changes of the target object in the video stream data, face detection is performed on the images with motion changes of the target object in sequence to obtain face frames; According to the change trend of the face frame, the movement change trend of the target object is obtained; wherein, according to the acquisition order of the face frame, the sizes of adjacent face frames are compared in sequence; according to the comparison result of the sizes of adjacent face frames, the first calculated value is multiplied by the first enlargement threshold or the first reduction threshold to obtain a new first calculated value, and then the first calculated value is replaced by the new first calculated value; 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; In the adjacent face frames, when the size of the face frame in the latter order is larger than the size of the face frame in the former order, the first calculated value is multiplied by the first enlargement threshold; when the size of the face frame in the image in the latter order is smaller than the size of the face frame in the image in the former order, the first calculated value is multiplied by the first reduction threshold; Comparing the new first calculated value with the first judgment threshold to obtain a change trend of the face frame, and then obtaining a movement change trend of the target object; According to the movement change trend of the target object, the electronic device is controlled to wake up or sleep.

2. The control method according to claim 1, characterized in that: The step of acquiring video stream data, detecting a target object in each frame of the video stream data, and acquiring an image in which the target object has motion changes includes: Extracting multiple frames of images from the video stream data, and detecting whether there is a target object in the images; Comparing two adjacent frames of images containing the target object to determine whether the target object has motion changes; If it is determined that the target object has motion changes, an image of the target object having motion changes is acquired.

3. The control method according to claim 2, characterized in that: The step of comparing two adjacent frames of images containing the target object to determine whether the target object has a motion change includes: Comparing two adjacent frames of images containing the target object to determine the difference between the two adjacent frames of images containing the target object; Comparing the difference with a difference threshold to determine whether the difference is less than or equal to the difference threshold; If it is determined that the difference is less than or equal to the difference threshold, it is determined that there is no motion change in the target object; If the difference is greater than the difference threshold, it is determined that there is a motion change in the target object.

4. The control method according to claim 1, characterized in that: The step of performing face detection on the images with motion changes of the target object in sequence according to the sorting order of the images with motion changes of the target object in the video stream data to obtain face frames includes: Face detection is performed on each frame image in which the target object has motion changes in sequence to determine whether there is a face in each frame image in which the target object has motion changes. When a face exists in the image, a face frame is obtained from the image, the frame count is increased by 1 to obtain a new frame count, and the frame count is replaced by the new frame count to obtain at least one face frame.

5. The control method according to claim 1, characterized in that: The comparing the new first calculated value with the first judgment threshold to obtain the change trend of the face frame and further obtain the movement change trend of the target object includes: Comparing the new first calculated value with the first judgment threshold to obtain a change trend of the face frame; 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 movement change trend of the target object is close to the electronic device; If the new first calculated value is less than the first judgment threshold, it is determined that the change trend of the face frame is getting smaller and smaller, and then the movement change trend of the target object is obtained to be away from the electronic device.

6. The control method according to claim 4, characterized in that: The step of obtaining the movement change trend of the target object according to the change trend of the face frame includes: Determining whether the new frame count is less than a frame count threshold; If it is determined that the new frame count is less than the frame count threshold, comparing the sizes of adjacent face frames in sequence according to the acquisition order of the face frames; According to the comparison result of the sizes of the adjacent face frames, the first calculated value is multiplied by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then the first calculated value is replaced by the new first calculated value.

7. The control method according to claim 6, characterized in that: The step of obtaining the movement change trend of the target object according to the change trend of the face frame further includes: If it is determined that the new frame count is greater than or equal to the frame count threshold, then obtaining an average frame of all the face frames acquired before the new frame count is equal to the frame count threshold; comparing the size of the average value frame with the size of the most recently obtained face frame, and multiplying the second calculated value by a second enlargement threshold or a second reduction threshold according to the comparison result of the size of the average value frame with the size of the most recently obtained face frame to obtain a new second calculated value, and then replacing the second calculated value with the new second calculated value; Performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a comparison result value; The comparison result value is compared with a second judgment threshold value to obtain a change trend of the face frame, and further obtain a movement change trend of the target object.

8. The control method according to claim 7, characterized in that: The comparing the comparison result value with the second judgment threshold value to obtain the change trend of the face frame, and then obtain the movement change trend of the target object, includes: Comparing the comparison result value with a second judgment threshold value to obtain a change trend of the face frame; If the comparison result value is greater than the second judgment threshold, it is judged that the change trend of the face frame is getting larger, and then the movement change trend of the target object is close to the electronic device; If the comparison result value is less than the second judgment threshold, it is determined that the change trend of the face frame is getting smaller and smaller, and then the movement change trend of the target object is obtained to be away from the electronic device.

9. The control method according to claim 1, characterized in that: The performing target detection on the image in which the target object has motion changes to obtain the motion change trend of the target object includes: According to the sorting order of the images with motion changes of the target object in the video stream data, sequentially perform human shape detection on the images with motion changes of the target object to obtain human shape frames; According to the change trend of the human-shaped frame, the movement change trend of the target object is obtained.

10. The control method according to claim 9, characterized in that: The step of performing human shape detection on the images with motion changes of the target object in sequence according to the sorting order of the images with motion changes of the target object in the video stream data to obtain human shape frames includes: Human figure detection is performed on each frame image in which the target object has motion changes in turn to determine whether there is a human figure in each frame image in which the target object has motion changes. When a human figure exists in the image, a human figure frame is obtained from the image, the frame count is increased by 1 to obtain a new frame count, and the frame count is replaced by the new frame count to obtain at least one human figure frame.

11. The control method according to claim 9 or 10, characterized in that: The step of obtaining the movement change trend of the target object according to the change trend of the human-shaped frame includes: According to the order in which the human-shaped frames are obtained, the sizes of the adjacent human-shaped frames are compared in sequence; According to the comparison result of the sizes of the adjacent human-shaped frames, multiply the first calculated value by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then replace the first calculated value with the new first calculated value; The new first calculated value is compared with the first judgment threshold to obtain the change trend of the human-shaped frame, and then to obtain the movement change trend of the target object.

12. The control method according to claim 11, characterized in that: The step of comparing the new first calculated value with the first judgment threshold to obtain a change trend of the human-shaped frame and further obtain a movement change trend of the target object includes: Compare the new first calculated value with the first judgment threshold to obtain a change trend of the human-shaped frame; If the new first calculated value is greater than the first judgment threshold, it is judged that the change trend of the human-shaped frame is getting larger, and then the movement change trend of the target object is close to the electronic device; If the new first calculated value is less than the first judgment threshold, it is determined that the change trend of the human-shaped frame is getting smaller and smaller, and then the movement change trend of the target object is obtained to be away from the electronic device.

13. The control method according to claim 12, characterized in that: The step of obtaining the movement change trend of the target object according to the change trend of the human-shaped frame includes: Determine whether the new frame count is less than the frame count threshold; If it is determined that the new frame count is less than the frame count threshold, comparing the sizes of the human-shaped frames in the adjacent images in sequence according to the sorting order of the images in the video stream data; According to the comparison result of the sizes of the human-shaped frames in the adjacent images, the first calculated value is multiplied by the first enlargement threshold or the first reduction threshold to obtain a new first calculated value, and then the first calculated value is replaced by the new first calculated value.

14. The control method according to claim 13, characterized in that: The step of obtaining the movement change trend of the target object according to the change trend of the human-shaped frame further includes: If it is determined that the new frame count is greater than or equal to the frame count threshold, then obtaining an average value frame of all the human-shaped frames acquired before the new frame count is equal to the frame count threshold; Comparing the sizes of the average value frame and the most recently obtained human-shaped frame, multiplying the second calculated value by a second enlargement threshold or a second reduction threshold according to the comparison result of the sizes of the average value frame and the most recently obtained human-shaped frame to obtain a new second calculated value, and then replacing the second calculated value with the new second calculated value; Performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a new comparison result value; The comparison result value is compared with the second judgment threshold value to obtain the change trend of the human-shaped frame, and then obtain the movement change trend of the target object.

15. The control method according to claim 14, characterized in that: The step of comparing the comparison result value with the second judgment threshold value to obtain the change trend of the human-shaped frame and further obtain the movement change trend of the target object includes: Compare the new comparison result value with the second judgment threshold to obtain a change trend of the human-shaped frame; If the comparison result value is greater than the second judgment threshold, it is judged that the change trend of the human-shaped frame is getting larger, and then the movement change trend of the target object is close to the electronic device; If the comparison result value is less than the second judgment threshold, it is determined that the change trend of the human-shaped frame is getting smaller and smaller, and then the movement change trend of the target object is obtained to be away from the electronic device.

16. The control method according to claim 1, characterized in that: The performing target detection on the image in which the target object has motion changes to obtain the motion change trend of the target object includes: According to the sorting order of the images of the target object with motion changes in the video stream data, face detection and human shape detection are sequentially performed on the images of the target object with motion changes to obtain face frames and human shape frames; The movement change trend of the target object is obtained according to the change trend of the face frame and the change trend of the human shape frame.

17. The control method according to claim 14, characterized in that: The step of performing face detection and human shape detection on the images with motion changes of the target object in sequence according to the sorting order of the images with motion changes of the target object in the video stream data to obtain a face frame and a human shape frame includes: Perform face detection and human shape detection on each frame image in which the target object has motion changes in sequence to determine whether a face and a human shape exist simultaneously in each frame image in which the target object has motion changes. When a face and a human shape exist simultaneously in the image, a face frame and a human shape frame are obtained from the image, then the frame count is increased by 1 to obtain a new frame count, and the frame count is replaced by the new frame count to obtain at least one face frame and at least one human shape frame.

18. The control method according to claim 16 or 17, characterized in that: The obtaining the movement change trend of the target object according to the change trend of the face frame and the change trend of the human-shaped frame includes: According to the acquisition order of the face frames, the sizes of the adjacent face frames are compared in sequence, and according to the acquisition order of the human-shaped frames, the sizes of the adjacent human-shaped frames are compared in sequence; According to the comparison result of the sizes of the adjacent face frames, multiply the first calculated value by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then replace the first calculated value with the new first calculated value; According to the comparison result of the sizes of the adjacent human-shaped frames, multiply the second calculated value by a second enlargement threshold or a second reduction threshold to obtain a new second calculated value, and then replace the second calculated value with the new second calculated value; Performing weighted average calculation on the new first calculated value and the new second calculated value to obtain a first comparison result value; The first comparison result value is compared with a first judgment threshold value to obtain a change trend of the face frame and a change trend of the human shape frame, and further obtain a motion change trend of the target object.

19. The control method according to claim 18, characterized in that: The comparing the first comparison result value with the first judgment threshold value to obtain the change trend of the face frame and the change trend of the human shape frame, and then obtain the movement change trend of the target object, includes: Compare the first comparison result value with a first judgment threshold to obtain a change trend of the face frame; If the first comparison result value is greater than the first judgment threshold, it is determined that the change trend of the face frame is getting bigger and bigger, and the change trend of the human shape frame is getting bigger and bigger, and then the movement change trend of the target object is close to the electronic device; If the first comparison result value is less than the first judgment threshold, it is determined that the change trend of the face frame is getting smaller and smaller, and the change trend of the human shape frame is getting smaller and smaller, and then the movement change trend of the target object is getting away from the electronic device.

20. The control method according to claim 17, characterized in that: The obtaining the movement change trend of the target object according to the change trend of the face frame and the change trend of the human-shaped frame includes: Determining whether the new frame count is less than a frame count threshold; If it is determined that the new frame count is less than the frame count threshold, comparing the sizes of adjacent face frames in sequence according to the acquisition order of the face frames, and comparing the sizes of adjacent human-shaped frames in sequence according to the acquisition order of the human-shaped frames; According to the comparison result of the sizes of the adjacent face frames, multiply the first calculated value by a first enlargement threshold or a first reduction threshold to obtain a new first calculated value, and then replace the first calculated value with the new first calculated value; According to the comparison result of the sizes of the adjacent human-shaped frames, multiply the second calculated value by a second enlargement threshold or a second reduction threshold to obtain a new second calculated value, and then replace the second calculated value with the new second calculated value; A weighted average calculation is performed on the new first calculated value and the new second calculated value to obtain a first comparison result value.

21. The control method according to claim 20, characterized in that: The step of obtaining the movement change trend of the target object according to the change trend of the face frame and the change trend of the human-shaped frame further includes: If it is determined that the new frame count is greater than or equal to the frame count threshold, then obtaining an average value frame of all the face frames and an average value frame of all the human shape frames acquired before the new frame count is equal to the frame count threshold; comparing the size of the average frame of all the face frames with the size of the most recently obtained face frame, and multiplying the third calculated value by a third enlargement threshold or a third reduction threshold according to the comparison result of the average frame of all the face frames with the size of the most recently obtained face frame to obtain a new third calculated value, and then replacing the third calculated value with the new third calculated value; Comparing the size of the average value frame of all the human-shaped frames with the size of the most recently obtained human-shaped frame, multiplying the fourth calculated value by a fourth enlargement threshold or a fourth reduction threshold according to the comparison result of the average value frame of all the human-shaped frames with the size of the most recently obtained human-shaped frame to obtain a new fourth calculated value, and then replacing the fourth calculated value with the new fourth calculated value; Performing weighted average calculation on the new third calculated value and the new fourth calculated value to obtain a second comparison result value; Performing a weighted average on the first comparison result and the second comparison result value to obtain a third comparison result value; The third comparison result value is compared with the second judgment threshold value to obtain the change trend of the face frame and the change trend of the human shape frame, and then obtain the movement change trend of the target object.

22. The control method according to claim 21, characterized in that: The comparing the third comparison result value with the second judgment threshold value to obtain the change trend of the face frame and the change trend of the human shape frame, and then obtain the movement change trend of the target object, includes: Compare the third comparison result value with the second judgment threshold value to obtain a change trend of the face frame and a change trend of the human shape frame; If the third comparison result value is greater than the second judgment threshold, it is determined that the change trend of the face frame is getting bigger and bigger, and the change trend of the human shape frame is getting bigger and bigger, and then the movement change trend of the target object is close to the electronic device; If the third comparison result value is less than the second judgment threshold, it is determined that the change trend of the face frame is getting smaller and smaller, and the change trend of the human shape frame is getting smaller and smaller, and then the movement change trend of the target object is getting away from the electronic device.

23. A control system for implementing the control method according to any one of claims 1 to 22, characterized in that: The control system includes a video stream data acquisition unit, a motion detection unit, a motion trend calculation unit, and a wake-up and sleep control unit, wherein the video stream data acquisition unit is used to acquire video stream data; the motion detection unit is used to detect the target object in each frame image of the video stream data, and acquire an image in which the target object has motion changes; the motion trend calculation unit is used to perform target detection on the image in which the target object has motion changes, so as to obtain the motion change trend of the target object; the wake-up and sleep control unit is used to control the electronic device to wake up or sleep according to the motion change trend of the target object.

Citation Information

Patent Citations

  • Method and system for intelligently turning off set-top box by identifying human action

    CN107809675A

  • Wake-up method of electronic equipment, storage medium and robot

    CN109976506A