A method for fall detection and a computer device
By obtaining detection videos and determining the detection tag group, the problems of complex fall detection calculations and difficult real-time monitoring in the prior art are solved, and fast and real-time fall detection is achieved.
Patent Information
- Application Number
- CN202010996042.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-21
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2040-09-21
AI Technical Summary
In the prior art, the fall detection method implemented by computer vision is complex in calculations and large in calculations, making it difficult to realize real-time monitoring.
By obtaining the detection video of the object to be detected, the detection tags of each video frame are determined, and the detection tag group is formed, and whether the object to be detected has fallen based on the detection tag group. This method does not require complex calculations, has fast classification speed and can realize real-time detection.
Fast and real-time fall detection is achieved, reducing the computational complexity and calculation amount, and greatly improving the detection speed and efficiency.
Smart Images

Figure CN114283490B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to a fall detection method and computer equipment. Background Art
[0002] Falling has become a major cause of endangerment to human life safety. If timely rescue is not provided after a fall, the golden time for saving lives may be lost. Therefore, methods and equipment for fall detection have become widely needed.
[0003] At present, fall detection can be achieved through computer vision. Cameras are installed indoors to detect whether a fall occurs within the monitoring range. Specifically, the skeletal node distribution characteristics, height characteristics, and inertia characteristics of various actions are extracted to form behavioral characteristics. Then, whether a human body falls is determined based on the behavioral characteristics. The calculation method is complex and the amount of calculation is large. Usually, a fall detection can only be completed at intervals of several minutes or even longer, making it difficult to achieve real-time monitoring of falls.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0005] In order to solve the above technical problems, the main purpose of the present invention is to provide a method and computer device for fall detection, which method does not require complex calculations, has a fast classification speed, and can achieve real-time detection.
[0006] In a first aspect, the present invention provides a method for fall detection, the method comprising:
[0007] Acquire a detection video of the object to be detected, wherein the detection video includes a plurality of video frames;
[0008] Determine the detection labels corresponding to each video frame to obtain a detection label group corresponding to the detection video, wherein the detection label corresponding to the video frame reflects the position of the object to be detected corresponding to the video frame;
[0009] The fall detection result of the object to be detected is determined according to the detection tag group.
[0010] As a further improved technical solution, the step of obtaining a detection video of the object to be detected specifically includes:
[0011] Acquire a detection video shot by an imaging system that moves along with the object to be detected.
[0012] As a further improved technical solution, the step of determining the detection labels corresponding to the respective video frames specifically includes:
[0013] For each video frame, obtaining a pitch angle when the imaging system captures the video frame;
[0014] A detection label corresponding to the video frame is determined according to the pitch angle.
[0015] As a further improved technical solution, the imaging system includes a rotatable camera; the pitch angle of the imaging system when shooting the video frame is obtained, specifically including:
[0016] Obtaining a rotation angle in a vertical direction of the rotatable camera when shooting the video frame, wherein the rotation angle is an angle of the rotatable camera relative to a preset zero position when shooting the video frame;
[0017] The obtained rotation angle is used as the pitch angle.
[0018] As a further improved technical solution, the step of determining the detection label corresponding to the video frame according to the pitch angle specifically includes:
[0019] Determining the angle interval in which the pitch angle is located;
[0020] An angle label corresponding to the angle interval is obtained, and the angle label is used as a detection label of the video frame.
[0021] As a further improved technical solution, the step of determining the detection label corresponding to the video frame according to the pitch angle specifically includes:
[0022] The value corresponding to the pitch angle is used as the detection label corresponding to the video frame.
[0023] As a further improved technical solution, the step of determining the fall detection result of the object to be detected according to the detection tag group specifically includes:
[0024] Obtaining several reference label groups corresponding to the detection video from several preset sample label groups, wherein each reference label group in the several reference label groups corresponds to a reference video, and the video duration corresponding to each reference video is the same as the video duration corresponding to the detection video, and the number of reference video frames in each reference video is equal to the number of video frames in the detection video;
[0025] A fall detection result of the object to be detected is determined according to the plurality of reference tag groups and the detection tag group.
[0026] As a further improved technical solution, the step of determining the fall detection result of the object to be detected according to the plurality of reference tag groups and the detection tag group specifically includes:
[0027] respectively determining the distances between the detection tag group and the plurality of reference tag groups to obtain a distance set;
[0028] Selecting a number of target distances from the distance set according to a preset condition, wherein the preset condition is: the number of target distances is a preset number of distances in a distance queue, and the distance queue is obtained by arranging the distances in the distance set in ascending order;
[0029] The fall detection result is determined according to the plurality of target distances.
[0030] As a further improved technical solution, the plurality of reference tag groups each have a corresponding reference result; the step of determining the fall detection result according to the plurality of target distances specifically includes:
[0031] Obtaining reference results corresponding to each of the plurality of target distances;
[0032] The fall detection result is determined according to the reference results respectively corresponding to each of the target tag groups.
[0033] As a further improved technical solution, the preset number is an odd number, and the reference result includes falling or not falling; the reference results corresponding to each of the target tag groups specifically include:
[0034] Determining, among the reference results corresponding to each of the target tag groups, a first number of reference results for falling and a second number of reference results for not falling;
[0035] If the first number is greater than the second number, determining that the fall detection result is a fall;
[0036] If the first number is less than the second number, the fall detection result is determined to be no fall.
[0037] As a further improved technical solution, before obtaining the detection video of the object to be detected, the method further includes:
[0038] Obtaining a number of sample videos and reference results corresponding to each of the sample videos;
[0039] For each sample video, determining the pitch angles corresponding to each sample video frame in the sample video, and determining a sample label group corresponding to the sample video according to each pitch angle;
[0040] The sample label group corresponding to each sample video and the reference result corresponding to each sample video are associated and saved.
[0041] In a second aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the following steps when executing the computer program:
[0042] Acquire a detection video of the object to be detected, wherein the detection video includes a plurality of video frames;
[0043] Determine the detection labels corresponding to each video frame to obtain a detection label group corresponding to the detection video, wherein the detection label corresponding to the video frame reflects the position of the object to be detected corresponding to the video frame;
[0044] The fall detection result of the object to be detected is determined according to the detection tag group.
[0045] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0046] Acquire a detection video of the object to be detected, wherein the detection video includes a plurality of video frames;
[0047] Determine the detection labels corresponding to each video frame to obtain a detection label group corresponding to the detection video, wherein the detection label corresponding to the video frame reflects the position of the object to be detected corresponding to the video frame;
[0048] The fall detection result of the object to be detected is determined according to the detection tag group.
[0049] Compared with the prior art, the embodiments of the present invention have the following advantages:
[0050] In an embodiment of the present invention, a detection video of an object to be detected is obtained, wherein the detection video includes a plurality of video frames; the detection tags corresponding to each of the video frames are determined to obtain a detection tag group corresponding to the detection video, wherein the detection tags corresponding to the video frames reflect the position of the object to be detected corresponding to the video frames; and the fall detection result of the object to be detected is determined according to the detection tag group. In the present invention, a detection tag group corresponding to the detection video is determined, and each detection tag in the detection tag group reflects the position of the object to be detected in the video frame corresponding to the detection tag. Whether the object to be detected falls is then determined according to each detection tag group. The amount of data obtained is small, no complex calculations are required, and the classification speed is fast. After each detection video is obtained, the fall detection result corresponding to the detection video can be quickly obtained, and real-time detection can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a schematic diagram of an application scenario of a fall detection method in an embodiment of the present invention;
[0052] Figure 2 is a schematic diagram of a fall detection method in an embodiment of the present invention;
[0053] Figure 3 is a schematic diagram of a mobile robot in an embodiment of the present invention;
[0054] Figure 4 is a schematic diagram of the rotation angle of the mobile robot in an embodiment of the present invention;
[0055] Figure 5 Schematic diagram of angle intervals and detection tags in an embodiment of the present invention;
[0056] Figure 6 is a schematic diagram of sample videos stored in an embodiment of the present invention and reference results corresponding to each sample video;
[0057] Figure 7 is a flow chart of a method for fall detection when the present invention is implemented;
[0058] Figure 8 It is a diagram of the internal structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not 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.
[0060] The inventor has found through research that currently, fall detection can be achieved through computer vision. Cameras can be installed indoors to detect whether a fall occurs within the monitoring range. Specifically, the skeletal node distribution characteristics, height characteristics and inertia characteristics of various actions are extracted to form behavioral characteristics, and then whether a human body falls is judged based on the behavioral characteristics. The calculation method is complex and the amount of calculation is large. Usually, a fall detection can only be completed at intervals of several minutes or even longer, making it difficult to achieve real-time monitoring of falls.
[0061] In order to solve the above problems, in an embodiment of the present invention, a detection video of an object to be detected is obtained, wherein the detection video includes a plurality of video frames; the detection tags corresponding to each video frame are determined to obtain a detection tag group corresponding to the detection video, wherein the detection tag corresponding to the video frame reflects the position of the object to be detected corresponding to the video frame; and the fall detection result of the object to be detected is determined according to the detection tag group. In the present invention, a detection tag group corresponding to the detection video is determined, and each detection tag in the detection tag group reflects the position of the object to be detected in the video frame corresponding to the detection tag. Then, whether the object to be detected falls is determined according to each detection tag group. The amount of data obtained is small, no complex calculation is required, and the classification speed is fast. After each detection video is obtained, the fall detection result corresponding to the detection video can be quickly obtained, and real-time detection can be achieved.
[0062] A fall detection method provided in an embodiment of the present invention can be applied to electronic devices, such as PCs, servers, mobile phones, televisions, etc. In addition, the functions implemented by the method can be implemented by calling application code through processing in the electronic device. Of course, the program code can be stored in a computer storage medium. It can be seen that the electronic device at least includes a processor and a storage medium.
[0063] For example, the embodiments of the present invention can be applied to Figure 1 The scenario shown in the figure, in which, first, the terminal device 1 can obtain the detection video, and input the detection video into the terminal device 2, so that the terminal device 2 obtains the detection result according to the detection video. It can be understood that in the above application scenario, although the actions of the embodiments of the present invention are described as being partially performed by the terminal device 2 and partially performed by the terminal device 1, these actions can be performed entirely by the terminal device 1, and the present invention is not limited in terms of the execution subject, as long as the work disclosed in the embodiments of the present invention is performed.
[0064] Various non-limiting embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0065] See also Figure 2 , shows a method for fall detection in an embodiment of the present invention, the method comprising:
[0066] S1. Obtain a detection video of an object to be detected, wherein the detection video includes a plurality of video frames.
[0067] In the embodiment of the present invention, the detection video may be shot by a terminal device and processed by the terminal device, or sent by other devices to the terminal device and then processed by the terminal device, and the image of the detection video includes an object to be detected, and the object to be detected is a person, that is, the detection video is a video shot of a specific person. The detection video includes a plurality of video frames.
[0068] In an embodiment of the present invention, a detection video of the object to be detected is obtained at intervals of a preset duration, that is, the duration of the detection video is the preset duration. Specifically, if the terminal device captures the detection video, the terminal device continues to capture, and a detection video is acquired every time the preset duration is captured; if other devices capture the detection video, the terminal device acquires the detection video captured by other devices at intervals of a preset duration, and other devices continue to capture the detection video, or other devices send the captured video to the terminal device at intervals of a preset duration. For example, the preset duration can be set to 3 seconds, and the detection video can include 90 video frames.
[0069] In an embodiment of the present invention, obtaining a detection video of an object to be detected specifically includes: obtaining a detection video shot by an imaging system that moves with the object to be detected. The imaging system moves with the object to be detected so that the object to be detected is always in the picture shot by the imaging system. Specifically, a face image corresponding to the object to be detected can be pre-stored in the imaging system. When shooting starts, the imaging system determines the object to be detected in the shooting picture through face recognition, and follows the face in the shooting picture in real time so that the object to be detected is always in the shooting picture.
[0070] S2. Determine the detection labels corresponding to each video frame to obtain a detection label group corresponding to the detection video, wherein the detection label corresponding to the video frame reflects the position of the object to be detected corresponding to the video frame.
[0071] In an embodiment of the present invention, the imaging system includes a rotatable camera, so that the imaging system follows the object to be detected and shoots, and the object to be detected is always in the shooting picture of the imaging system, and the detection label corresponding to the video frame is determined by the angle of each video frame shot by the rotatable camera. The detection label can be expressed in numerical form, for example, the detection label corresponding to a video frame is 2, and 2 can also be used to reflect the angle of the rotatable camera when shooting the video frame. In other words, the detection label is related to the angle shot by the rotatable camera, and therefore, the detection label corresponding to the video frame reflects the position of the object to be detected corresponding to the video frame.
[0072] In order to make the obtained detection label more accurate, the imaging system can be set to follow and shoot the object to be detected, and the head of the object to be detected is always in the center of the shooting picture.
[0073] In the embodiment of the present invention, the imaging system may be a part of the terminal device. Figure 3 As shown, the terminal device can be a mobile robot, and the mobile robot can move with the object to be detected. As an example, a rotatable camera is provided on the mobile robot; the facial image corresponding to the object to be detected can be recorded into the mobile robot, and the mobile robot determines the object to be detected in the shooting picture through face recognition, and follows the face in the shooting picture in real time, so that the object to be detected is always in the center of the shooting picture; if the object to be detected is in a moving state, in order to make the object to be detected always in the center of the shooting picture, the rotatable camera will rotate the shooting angle, and determine the detection label corresponding to the video frame according to the angle when the rotatable camera shoots the video frame. In an embodiment of the present invention, the detection video is obtained by shooting by following the object to be detected by the mobile robot, and the mobile robot has flexibility and can monitor from multiple angles and in all directions, and the robot can collect richer information such as video and sound.
[0074] In addition, fall detection can also be achieved through computer vision (such as image processing detection method); specifically, a pre-installed camera can be used to collect image data including portraits, and based on the position changes of the portraits in the collected image data, it is possible to detect whether a fall event occurs within the monitoring range, wherein the pitch angle and shooting direction of the camera used to collect video can be fixed.
[0075] Next, a method of obtaining a detection video by following the object to be detected by a mobile robot to determine the detection label corresponding to the video frame will be described in detail. Specifically, step S2 includes:
[0076] S21. For each video frame, obtain the pitch angle of the imaging system when shooting the video frame.
[0077] In an embodiment of the present invention, in order to detect whether the object to be detected falls, in the event of a fall, the position of the body part of the object to be detected will change in the direction perpendicular to the horizontal plane, for example, during the fall, a body part of the object to be detected will change in the direction perpendicular to the horizontal plane. In one example, the body part can be the upper body of the object to be detected, and the upper body of the object to be detected is followed and photographed by the imaging system, so that the upper body of the object to be detected is always in the picture, and when the position of the upper body of the object to be detected changes, the angle of the imaging system shooting will also change. The body part can be the head of the object to be detected, and during the fall, the position of the head of the object to be detected will also change in the direction perpendicular to the horizontal plane, for example, when the object to be detected falls while standing, the height of the head of the object to be detected when standing is necessarily higher than the height of the head of the object to be detected after falling. The face of the object to be detected can be recognized by face recognition, and the imaging system follows and photographs the face of the object to be detected, so that the head of the object to be detected is always in the shooting picture of the imaging system, and when the position of the head of the object to be detected changes, the pitch angle in the direction perpendicular to the horizontal plane will change when the imaging system photographs the object to be detected.
[0078] Specifically, step S21 includes:
[0079] S211, obtaining a rotation angle of the rotatable camera in a vertical direction when shooting the video frame, wherein the rotation angle is an angle of the rotatable camera relative to a preset zero position when shooting the video frame;
[0080] S212: Use the acquired rotation angle as the pitch angle.
[0081] In an embodiment of the present invention, a rotatable camera is provided on the imaging system, and the vertical direction is a direction perpendicular to the horizontal plane. Specifically, the preset zero position of the rotatable camera is pre-calibrated, and the rotation angle of the rotatable camera for shooting a video frame relative to the preset zero position is obtained, and the obtained rotation angle is used as the pitch angle. The angle corresponding to the preset zero position is 0 degrees, and the angle when the main optical axis of the rotatable camera is parallel to the horizontal plane can be set to 0 degrees, and the main light passes through the center of the mirror of the rotatable camera and is perpendicular to the mirror; or, the angle when the main optical axis of the rotatable camera is at a preset angle with the horizontal plane can be set to 0 degrees, for example, the preset angle is 30 degrees, that is, when the angle between the main optical axis of the rotatable camera and the horizontal plane is 30 degrees, the rotatable camera is in the preset zero position, and at this time, the angle corresponding to the rotatable camera is 0 degrees.
[0082] In an embodiment of the present invention, the pitch angle includes a depression angle or an elevation angle, and the rotation angle is represented by a numerical value. When the numerical value is a positive number, the pitch angle is an elevation angle; when the numerical value is a negative number, the pitch angle is a depression angle; when the numerical value is 0, it is a preset zero position, which can be used as a zero-degree elevation angle or a zero-degree depression angle.
[0083] For example, for a video frame, when the imaging system captures the video frame, the camera can be rotated. If the obtained rotation angle is 10 degrees, the pitch angle corresponding to the video frame is 10 degrees of elevation; if the obtained rotation angle is -10 degrees, the pitch angle corresponding to the video frame is 10 degrees of depression.
[0084] S22. Determine a detection label corresponding to the video frame according to the pitch angle.
[0085] In an embodiment of the present invention, various angle intervals and detection labels corresponding to each angle interval are preset. First, the angle interval in which the pitch angle corresponding to the video frame is located is determined, and then the detection label of the video frame is determined based on the correspondence between the angle interval and the detection label.
[0086] Specifically, step S22 includes:
[0087] S221, determining the angle interval in which the pitch angle is located;
[0088] S222: Obtain an angle label corresponding to the angle interval, and use the angle label as a detection label for the video frame.
[0089] In an embodiment of the present invention, the angle interval is pre-set, and -180° to 180° is divided into multiple angle intervals, for example, each change of 10° is divided into an angle interval. In order to obtain a more accurate detection result, the angle change range included in the angle interval can be set to be smaller, for example, each change of 5° is set to be divided into an angle interval. Each angle interval has its corresponding angle label, and the angle label can be represented by a numerical value. The larger the numerical value corresponding to the angle label, the larger the pitch angle corresponding to the angle label.
[0090] For example, see Figure 4 and Figure 5, every 10° change is divided into an angle interval, the pitch angle is 0° (preset zero position) corresponding to the angle label is 0, (0°, 10°] is an angle interval, the angle label corresponding to (0°, 10°] is 1; (10°, 20°] is an angle interval, the angle label corresponding to (10, 20] is 2, [-10°, 0°) is an angle interval, the angle label corresponding to [-10°, 0°) is -1; that is, when the pitch angle of a video frame is 10°, the angle interval of 10° is (0°, 10°], then the angle label corresponding to the video frame is 1, then the detection label of the video frame is determined to be 1.
[0091] In an embodiment of the present invention, the angle interval in which the pitch angle is located is determined, and the angle tag corresponding to the angle interval in which the pitch angle is located is used as the detection tag corresponding to the pitch angle. For example, in the above example, the pitch angle when shooting the video frame f1 is 55°, the angle interval corresponding to 55° is [50°, 60°], and the angle tag corresponding to the angle interval [50°, 60°] is 6, and then the detection tag corresponding to the video frame f1 is determined to be 6.
[0092] In an embodiment of the present invention, since a detection video includes multiple video frames, each video frame has its corresponding detection tag, therefore, a detection video corresponds to a detection tag group (including multiple detection tags), and the number of detection tags in the detection tag group is equal to the number of video frames in the detection video; for a detection tag in the detection tag group, the position number of the detection tag in the detection tag group is the same as the position number of the video frame corresponding to the detection tag in the detection video. For example, the detection video has 90 video frames, and the detection tag group corresponding to the detection video includes 90 detection tags. For the detection tag ranked third, the video frame corresponding to the detection tag is the video frame ranked third in the detection video.
[0093] The picture corresponding to each video frame in the detection video includes the object to be detected. The movement of the object to be detected can be reflected by detecting each video frame in the detection video. The label corresponding to each video frame in the detection video is determined, and the movement of the object to be detected can be reflected by each detection label in the detection label group; when the object to be detected falls, a body part of the object to be detected will move in a direction perpendicular to the horizontal plane. For example, the head of the object to be detected will move in a direction perpendicular to the horizontal plane, and the height of the head (the distance in the direction perpendicular to the horizontal plane) will change.
[0094] Since the imaging system follows a part of the human body to shoot, when the height of the body part from the ground changes, the shooting angle of the imaging system will change; that is, when the value corresponding to the detection tag is larger, it means that the height of the part of the human body from the ground is larger, and when the value corresponding to the detection tag is smaller, it means that the height of the part of the human body from the ground is smaller.
[0095] For example, the detection label group corresponding to a detection video is: 7,7,3,3,3,..., which means that when shooting the first video frame of the object to be detected, the pitch angle of the imaging system corresponds to an angle interval of 7, when shooting the second video frame of the object to be detected, the pitch angle of the imaging system corresponds to an angle interval of 7, and when shooting the third video frame of the object to be detected, the pitch angle of the camera corresponds to an angle interval of 3. If the imaging system follows the head of the object to be detected to shoot the detection video (the head is always in the center of the shooting screen), the height of the head from the ground in the first video frame does not change much from the height of the head from the ground in the second video frame; the height of the head from the ground in the second video frame is greater than the height of the head from the ground in the third video frame.
[0096] In the embodiment of the present invention, the value corresponding to the pitch angle can also be used as the detection label corresponding to the video frame, that is, if the pitch angle when the imaging system shoots a video frame is 10°, the value corresponding to the pitch angle is 10, and the detection label of the video frame is 10. If the pitch angle when the imaging system shoots a video frame is -23°, the value corresponding to the pitch angle is -23, and the detection label of the video frame is -23.
[0097] S3. Determine a fall detection result of the object to be detected according to the detection tag group.
[0098] In an embodiment of the present invention, when the object to be detected falls, the position of the head of the object to be detected will change, specifically, the height of the head of the object to be detected will change. Through step S2, the detection tag group is used to represent the height change of the head of the object to be detected in the detection video; if the detection tags in the detection tag group are the same, it means that the head of the object to be detected has not been displaced in the up and down directions in the detection video. For example, if the object to be detected always remains in an upright state, the detection tags in the detection video are the same; if the detection tags in the detection tag group are different, it means that the head of the object to be detected has been displaced in the up and down directions in the detection video.
[0099] In an embodiment of the present invention, in order to determine the fall detection result through the detection video, the duration of the detection video should be set to be close to the actual duration of the fall. In theory, the actual duration of the fall is 2-4 seconds. The duration of the video to be detected can be set to 3 seconds, so that when a fall occurs in the video to be detected, the captured detection video can include the process of the fall. If the detection video includes the process of the fall, the pitch angle of the imaging system changes. For example, the pitch angle of the imaging system when shooting the first video frame of the detection video is 70°, and the pitch angle when shooting the last video frame of the detection video is -5°. Furthermore, each detection tag in the detection tag group includes values from 7 and -1, and intermediate values from 7 to -1. Therefore, the fall detection result can be reflected by the detection tag group.
[0100] In an embodiment of the present invention, the fall detection result is determined by a K-nearest neighbors (KNN) algorithm. The K-nearest neighbors algorithm is a non-parametric statistical method for classification and regression. The principle of the K-nearest neighbors algorithm is: for a sample to be tested and K reference samples, each reference sample has a corresponding category. If most of the K reference samples belong to the same category, the sample to be tested is considered to belong to the category corresponding to the majority of the reference samples.
[0101] For example, for a sample to be tested and K=23 reference samples, among the 23 reference samples: there are 2 reference samples belonging to the orange category, 3 reference samples belonging to the green category, 4 reference samples belonging to the pink category, and 14 reference samples belonging to the black category, then it is determined that the sample to be tested belongs to the black category.
[0102] Specifically, step S3 includes:
[0103] S31. Obtaining several reference label groups corresponding to the detection video from several preset sample label groups.
[0104] In an embodiment of the present invention, a plurality of sample label groups are pre-saved, and each sample label group corresponds to a sample video, and the sample video is a video of a human body falling, or a video of a human body not falling. Each sample video corresponds to a reference result. If the sample video is a video of a human body falling, the reference result corresponding to the sample video is falling; if the sample video is a video of a human body not falling, the reference result corresponding to the sample video is not falling. The sample label group includes sample labels corresponding to each of the plurality of sample video frames, and each sample label can reflect the pitch angle when the sample video frame was shot.
[0105] Specifically, before step S1, the following steps are included:
[0106] M1. Obtain several sample videos and reference results corresponding to each of the sample videos.
[0107] In an embodiment of the present invention, the same type of imaging system is used to obtain sample videos. When the imaging system is a mobile robot, the same type of mobile robot is used to obtain sample videos. The sample video is a video of a human body falling during a real test, or a video of a human body not falling during a real test. Each sample video corresponds to a reference result. If the sample video is a video of a human body falling, the reference result corresponding to the sample video is falling; if the sample video is a video of a human body not falling, the reference result corresponding to the sample video is not falling.
[0108] M2. For each sample video, determine the pitch angles corresponding to each sample video frame in the sample video, and determine a sample label group corresponding to the sample video according to each pitch angle.
[0109] In an embodiment of the present invention, for each sample video, the pitch angle of each sample video frame of the sample video is obtained when the imaging system shoots the sample video, and the sample label corresponding to the sample video frame is determined according to the pitch angle to obtain the sample label group corresponding to the sample video. Among them, the specific process of obtaining the pitch angle of each sample video frame of the sample video when the imaging system shoots the sample video is the same as the process of step S21, and further, the specific process of obtaining the pitch angle of each sample video frame of the sample video when the imaging system shoots the sample video can refer to the description of step S21; the specific process of determining the sample label corresponding to the sample video frame according to the pitch angle to obtain the sample label group corresponding to the sample video is the same as the process of step S22, and further, the specific process of determining the sample label corresponding to the sample video frame according to the pitch angle to obtain the sample label group corresponding to the sample video can refer to the description of step S22.
[0110] M3. Associate and save the sample label group corresponding to each sample video and the reference result corresponding to each sample video.
[0111] In an embodiment of the present invention, each sample video and the reference result corresponding to each sample video can be saved in the terminal device. After the terminal device obtains the detection video taken by the imaging system, the fall detection result corresponding to the detection video is determined based on each sample video and the reference result corresponding to each sample video that are pre-saved.
[0112] For example, see Figure 6, saving files including falls (falls) and no falls (Notfalls), where falls includes multiple sample videos with reference results of "falls", namely fall-01, fall-02 and fall-03; Notfalls includes multiple sample videos with reference results of "no falls", namely Notfall-01 and Notfall-02.
[0113] In the embodiment of the present invention, each of the reference tag groups corresponds to a reference video, and the video duration corresponding to each reference video is the same as the video duration corresponding to the detection video, that is, a sample video with the same video duration as the detection video is used as the reference video. The number of reference tags included in each reference tag group is the same as the number of detection tags in the detection video.
[0114] For example, the reference label group 1 (6,6,7,..., 4,5,5,5) obtained has a corresponding reference result of no fall, and the reference label group 2 (7,7,7,..., 0,0,-1,-1) has a corresponding reference result of fall.
[0115] S32: Determine a fall detection result of the object to be detected according to the plurality of reference tag groups and the detection tag group.
[0116] In an embodiment of the present invention, in order to determine the fall detection result corresponding to the detection tag group, the distance between the detection tag group and each reference tag group is first determined, and the target tag group closest to the detection tag group in distance is selected, and the fall detection result is determined according to the reference results corresponding to each target tag group.
[0117] Specifically, step S32 includes:
[0118] S321, respectively determining the distances between the detection tag group and each reference tag group to obtain a distance set, wherein the number of reference tags in each reference tag group is equal to the number of detection tags in the detection tag group;
[0119] In the embodiment of the present invention, the distance between the detection tag group and the reference tag group can be calculated by using the calculation formula of the Euclidean distance (Hamming distance). As shown in formula (1):
[0120]
[0121] Among them, x1 is the first detection label in the detection label group, y1 is the first reference label in the reference label group, x2 is the second detection label in the detection label group, y2 is the second reference label in the reference label group, xn is the nth detection label in the detection label group, and yn is the nth reference label in the reference label group.
[0122] In the embodiment of the present invention, the distance set includes a plurality of distances, and the number of distances in the distance set is the same as the number of reference tag groups.
[0123] S322. Selecting a number of target distances from the distance set according to a preset condition, wherein the preset condition is: the number of target distances are the first preset number of distances in a distance queue, and the distance queue is obtained by arranging the distances in the distance set in ascending order.
[0124] In an embodiment of the present invention, each distance in the distance set can be sorted in order from large to small to obtain a distance queue. The so-called from large to small is to determine the size of the distance according to the corresponding numerical value of the distance. If the numerical value corresponding to the distance is large, the distance is larger, and if the numerical value corresponding to the distance is small, the distance is smaller. Arrange the distance with a small numerical value before the distance with a large numerical value to obtain a distance queue. The smaller the distance between the detection label group and the sample label group, the higher the similarity between the detection label group and the sample label group, and the larger the distance between the detection label group and the sample label group, the lower the similarity between the detection label group and the sample label group. For example, the distance between the detection label group X and the sample label group Y1 is 2, and the distance between the detection label group X and the sample label group Y2 is 3. Then, relative to the sample label group Y2, the similarity between the detection label group X and the sample label group Y1 is higher.
[0125] In an embodiment of the present invention, a preset number (K) of distances in the distance queue are selected as the target distances to obtain a target distance set. That is, the similarity between the sample label group and the detection label group corresponding to each target distance in the target distance set is greater than the similarity between the sample label group and the detection label group corresponding to any non-target distance, and the non-target distance is the distance in the distance queue other than the target distance.
[0126] S323. Determine the fall detection result according to the plurality of target distances.
[0127] In an embodiment of the present invention, the reference result includes falling or not falling. The reference results corresponding to each target distance are obtained, and the fall result is determined according to each reference result. If there are more no-fall results in the reference results corresponding to each target distance, the fall detection result is determined to be no-fall; if there are more fall results in the reference results corresponding to each target distance, the fall detection result is determined to be a fall.
[0128] Specifically, step S323 includes:
[0129] S3231, obtaining reference results corresponding to the plurality of target distances respectively;
[0130] In an embodiment of the present invention, several target distances are selected from distances calculated from several reference tag groups and tag groups to be detected. First, the reference tag groups corresponding to the several target distances are determined, and then the reference results corresponding to the determined reference tag groups are obtained.
[0131] S3232: Determine the fall detection result according to the reference results corresponding to each of the target tag groups.
[0132] In an embodiment of the present invention, the number of the preset number can be an odd number, that is, the number of the several target distances is an odd number. In this way, the number of reference results of "fall" and the number of reference results of "no fall" will be different; if the number of "falls" in the reference results corresponding to each target label group is greater than the number of "no falls", the fall detection result is determined to be a fall; if the number of "no falls" in the reference results corresponding to each target label group is greater than the number of "falls", the fall detection result is determined to be no fall.
[0133] Specifically, a first number of reference results for falling and a second number of reference results for not falling are determined among the reference results corresponding to each of the target tag groups; if the first number is greater than the second number, the fall detection result is determined to be a fall; if the first number is less than the second number, the fall detection result is determined to be no fall.
[0134] For example, if the preset number is 21, there are 21 target tag groups, among which there are 16 target tag groups with reference results as fall results and 5 target tag groups with reference results as no fall results, then the first number is greater than the second number, and the fall detection result is fall. If there are 5 target tag groups with reference results as fall results and 16 target tag groups with reference results as no fall results, then the first number is less than the second number, and the fall detection result is no fall.
[0135] In an embodiment of the present invention, the preset number may also be an even number, that is, the number of the target distances is an even number, so that the number of reference results of "falling" and "not falling" may be the same. If the number of reference results of "falling" and "not falling" is the same, a voice prompt may be set to inquire whether the target has fallen and whether an alarm is needed; if the number of target distances is an even number, the number of reference results of "falling" and "not falling" may be different. If the number of "falling" in the reference results corresponding to each target tag group is more than the number of "not falling", the fall detection result is determined to be a fall. If the number of "not falling" in the reference results corresponding to each target tag group is more than the number of "falling", the fall detection result is determined to be a fall. That is to say, in the embodiment of the present invention, the preset number may not be limited (the preset number is not limited to an odd number or an even number).
[0136] The specific implementation is, see Figure 7 The process of a fall detection method provided by the present invention includes:
[0137] 1. Obtain the detection video, which includes several video frames;
[0138] 2. Determine the detection label corresponding to each video frame to obtain the detection label group corresponding to the video to be detected;
[0139] 3. Obtain several reference label groups corresponding to the detection label group, wherein the number of reference labels in each reference label group is equal to the number of detection labels in the detection label group;
[0140] 4. Input the detection label group and several reference label groups into the K-nearest neighbor algorithm classifier, and the K-nearest neighbor algorithm classifier determines the fall detection result corresponding to the detection video according to the distance between the detection label group and the several reference label groups.
[0141] In the embodiment of the present invention, if the detection result of the detection video is determined to be a fall, a voice prompt is issued to ask whether the target has fallen and whether an alarm is needed. If no fall has occurred, the subject to be detected can reply that no fall has occurred to prevent false detection; if the subject to be detected has fallen and can reply to confirm the fall, relatives can be notified immediately and an alarm can be processed. If the subject to be detected is unconscious and unable to respond after receiving the voice prompt, an automatic alarm can be set 3 minutes after the voice prompt is issued.
[0142] In an embodiment of the present invention, the mobile robot can process the detection video by itself to obtain the fall detection result; the mobile robot can also send the detection video to the terminal device, that is, the mobile robot is only responsible for collecting the detection video, and the terminal device processes the detection video to obtain the fall detection result; the terminal device can be a television, and the reference tag group corresponding to the reference video and the reference result corresponding to the reference video are associated and stored in the television. After receiving the detection video, the television obtains the detection result according to the detection video, the reference tag group corresponding to the reference video, and the reference result corresponding to the reference video, and can display the detection result on the television, and perform operations such as alarming.
[0143] In an embodiment of the present invention, a detection video of an object to be detected is obtained, wherein the detection video includes a plurality of video frames; the detection tags corresponding to each of the video frames are determined to obtain a detection tag group corresponding to the detection video, wherein the detection tags corresponding to the video frames reflect the position of the object to be detected corresponding to the video frames; and the fall detection result of the object to be detected is determined according to the detection tag group. In the present invention, a detection tag group corresponding to the detection video is determined, and each detection tag in the detection tag group reflects the position of the object to be detected in the video frame corresponding to the detection tag. Whether the object to be detected falls is then determined according to each detection tag group. The amount of data obtained is small, no complex calculations are required, and the classification speed is fast. After each detection video is obtained, the fall detection result corresponding to the detection video can be quickly obtained, and real-time detection can be achieved.
[0144] Based on the above-mentioned fall detection method, an embodiment of the present invention further provides a computer device, which may be a terminal, and the internal structure is as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for fall detection is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0145] Those skilled in the art will understand that Figure 8What is shown is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0146] An embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the following steps when executing the computer program:
[0147] Acquire a detection video of the object to be detected, wherein the detection video includes a plurality of video frames;
[0148] Determine the detection labels corresponding to each video frame to obtain a detection label group corresponding to the detection video, wherein the detection label corresponding to the video frame reflects the position of the object to be detected corresponding to the video frame;
[0149] The fall detection result of the object to be detected is determined according to the detection tag group.
[0150] The embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0151] Acquire a detection video of the object to be detected, wherein the detection video includes a plurality of video frames;
[0152] Determine the detection labels corresponding to each video frame to obtain a detection label group corresponding to the detection video, wherein the detection label corresponding to the video frame reflects the position of the object to be detected corresponding to the video frame;
[0153] The fall detection result of the object to be detected is determined according to the detection tag group.
[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0155] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
[0156] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for fall detection, characterized in that: The method comprises: Acquire a detection video of the object to be detected, wherein the detection video includes a plurality of video frames; Determine the detection labels corresponding to each video frame to obtain a detection label group corresponding to the detection video, wherein the detection label corresponding to the video frame reflects the position of the object to be detected corresponding to the video frame; Determining a fall detection result of the object to be detected according to the detection tag group; Determining the detection labels corresponding to the respective video frames specifically includes: for each video frame, obtaining the pitch angle when the imaging system shoots the video frame; and determining the detection label corresponding to the video frame according to the pitch angle; Determining the detection tag corresponding to the video frame according to the pitch angle specifically includes: determining the angle interval in which the pitch angle is located; obtaining the angle tag corresponding to the angle interval, and using the angle tag as the detection tag of the video frame.
2. The method for fall detection according to claim 1, characterized in that: The step of obtaining the detection video of the object to be detected specifically includes: Acquire a detection video shot by an imaging system that moves along with the object to be detected.
3. The method for fall detection according to claim 1, characterized in that: The imaging system includes a rotatable camera; the pitch angle of the imaging system when shooting the video frame specifically includes: Obtaining a rotation angle in a vertical direction of the rotatable camera when shooting the video frame, wherein the rotation angle is an angle of the rotatable camera relative to a preset zero position when shooting the video frame; The obtained rotation angle is used as the pitch angle.
4. The method for fall detection according to claim 1, characterized in that: The step of determining the detection label corresponding to the video frame according to the pitch angle specifically includes: The value corresponding to the pitch angle is used as the detection label corresponding to the video frame.
5. The method for fall detection according to claim 1, characterized in that: The step of determining the fall detection result of the object to be detected according to the detection tag group specifically includes: Obtaining several reference label groups corresponding to the detection video from several preset sample label groups, wherein each reference label group in the several reference label groups corresponds to a reference video, and the video duration corresponding to each reference video is the same as the video duration corresponding to the detection video, and the number of reference video frames in each reference video is equal to the number of video frames in the detection video; A fall detection result of the object to be detected is determined according to the plurality of reference tag groups and the detection tag group.
6. The method for fall detection according to claim 5, characterized in that: The step of determining the fall detection result of the object to be detected according to the plurality of reference tag groups and the detection tag group specifically includes: respectively determining the distances between the detection tag group and the plurality of reference tag groups to obtain a distance set; Selecting a number of target distances from the distance set according to a preset condition, wherein the preset condition is: the number of target distances is a preset number of distances in a distance queue, and the distance queue is obtained by arranging the distances in the distance set in ascending order; The fall detection result is determined according to the plurality of target distances.
7. The method for fall detection according to claim 6, characterized in that: The plurality of reference tag groups each have a corresponding reference result; and determining the fall detection result according to the plurality of target distances specifically includes: Obtaining reference results corresponding to each of the plurality of target distances; The fall detection result is determined according to the reference results respectively corresponding to each target tag group.
8. The method for fall detection according to claim 7, characterized in that: The preset number is an odd number, and the reference result includes falling or not falling; the reference results corresponding to each target tag group specifically include: Determining, among the reference results corresponding to each of the target tag groups, a first number of reference results for falling and a second number of reference results for not falling; If the first number is greater than the second number, determining that the fall detection result is a fall; If the first number is less than the second number, the fall detection result is determined to be no fall.
9. The method for fall detection according to any one of claims 5 to 8, characterized in that: Before obtaining the detection video of the object to be detected, the method further includes: Obtaining a number of sample videos and reference results corresponding to each of the sample videos; For each sample video, determining the pitch angles corresponding to each sample video frame in the sample video, and determining a sample label group corresponding to the sample video according to each pitch angle; The sample label group corresponding to each sample video and the reference result corresponding to each sample video are associated and saved.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the fall detection method according to any one of claims 1 to 9 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the fall detection method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Human body fall detection method based on three-dimensional camera
CN107506706A
Object 6D posture prediction method based on RGB image and coordinate system transformation
CN110660101A
Monitoring method and device and storage medium
CN111510667A