Human body posture recognition method and detection system
By using the coordinates of the shoulder, hip and knee to calculate the angle difference and height difference in embedded devices, combined with the MediaPipePose model for human posture recognition, the real-time problem caused by the large amount of calculation of embedded devices is solved, and fast and accurate posture detection and safety alerts are achieved.
Patent Information
- Application Number
- CN202510268381.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-08-01
AI Technical Summary
The existing high-precision human posture detection algorithm has a large amount of calculation in embedded devices and is difficult to meet real-time requirements. Especially in real-time applications such as safety detection for the elderly and children, it is necessary to improve the real-time and computing efficiency of the algorithm while ensuring the detection accuracy.
Image preprocessing and feature extraction methods are used to calculate the angle difference and height difference using the coordinates of the shoulder, hip and knee, and combined with the MediaPipePose model for posture recognition. It is suitable for embedded devices with low computing power, and can quickly judge postures through the server, and trigger alarms or linkage devices when a specific posture is detected.
Fast and accurate posture recognition is achieved in embedded devices, improving recognition speed and detection efficiency, and able to trigger alarms in a timely manner to improve safety.
Smart Images

Figure CN120412007A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and particularly relates to a human body posture recognition method and a detection system. Background Art
[0002] With the rapid development of computer vision and artificial intelligence technologies, human body posture detection technology has been widely applied in multiple fields, such as intelligent security, sports analysis, virtual reality, medical rehabilitation, etc. The goal of human body posture detection is to capture human body images or videos through a camera, and then use algorithms to analyze the positions and postures of key points of the human body in the images, so as to achieve real-time monitoring and analysis of human body movements.
[0003] Patent CN202411384365.9 provides a human body posture recognition method, which can complete the recognition of unstable data based on the existing accelerometers and gyroscopes in the acquisition device without adding additional hardware, and only send stable data into the posture recognition model for posture recognition, effectively improving the recognition accuracy of the model.
[0004] Patent CN202210607020.X provides a method, device and electronic device for correcting the reading postures of teenagers and children, and uses question type data for posture estimation.
[0005] High-precision human body posture detection algorithms usually have a large amount of calculation and high requirements for hardware resources, and it is difficult to meet the real-time requirements in embedded devices. In some real-time application scenarios, such as the safety detection of the elderly and children, it is necessary to improve the real-time performance and calculation efficiency of the algorithm while ensuring the detection accuracy. Summary of the Invention
[0006] The purpose of the present invention is to propose a human body posture recognition method and a detection system for the problems existing in the prior art, and this method aims to solve the problems of recognition speed and accuracy existing in the existing posture recognition methods.
[0007] To achieve the above object, the present invention provides the following technical solutions.
[0008] A human body posture recognition method includes the following steps:
[0009] The server performs image preprocessing before feature extraction on the received frame images, including: noise removal, histogram equalization, and normalization;
[0010] Perform feature extraction on it to obtain the coordinates of key parts of the human body, including: the left and right coordinates of the shoulders, ears, hips, and knees;
[0011] Calculate the necessary body angles according to the coordinates of the key parts, perform normalization processing on the coordinate data, and enter the posture judgment; the judgment method includes the following steps:
[0012] θ = arctan2(A3[1] - A2[1], A3[0] - A2[0]) - arctan2(A1[1] - A2[1], A1[0] - A2[0])
[0013] A1[0] and A1[1] represent the abscissa and ordinate of the shoulder respectively, A2[0] and A2[1] represent the abscissa and ordinate of the hip respectively, and A3[0] and A3[1] represent the coordinates and ordinate of the knee respectively;
[0014] Judging the posture by the difference between the left θ angle and the right θ angle enables fast posture recognition in embedded devices with low computing power.
[0015] Furthermore, this patent also includes the step of judging the posture by the height difference between the left and right target points, enabling the recognition of more postures.
[0016] Preferably, the θ angle and the method for judging the height difference of the target points have a numerical range:
[0017] (1) If it is judged that the left θ angle of the human body is not equal to the right θ angle and the left θ or right θ angle is greater than 160°, then proceed to the next judgment (2); otherwise, the current posture is considered a standing posture;
[0018] Y = |y1 - y2|
[0019] y1 and y2 are the ordinates of the left and right target points respectively;
[0020] (2) Judge whether the vertical difference Y between the left and right shoulders is less than 0.04. If it is less than 0.04, then proceed to the next judgment (3); otherwise, proceed to (21);
[0021] (21) Judge whether the vertical difference Y between the left ear and the left shoulder or the right ear and the right shoulder is less than 0.1. If it is less than 0.1, then it is determined as a wrestling posture; otherwise, the posture is determined as a bending posture;
[0022] (3) Judge whether the vertical difference Y between the left shoulder and the left hip or the right shoulder and the right hip is less than 0.03. If it is less than 0.03, then proceed to the next judgment (4); otherwise, judge the posture as a bending posture;
[0023] (4) Judge whether the vertical difference between the left ear and the left shoulder or the right ear and the right shoulder is less than 0.1. If it is less than 0.1, it indicates that the current posture is a wrestling posture; otherwise, the posture is determined as a bending posture.
[0024] This patent can also be embodied as a human posture detection system, including: an electronic camera capable of communication, used to acquire and transmit video data; a processor and a memory storing a computer program, which implements the posture detection method described in any one of claims 1 - 3 when executed.
[0025] Preferably, calculate and detect the angles on the analyzed images, draw key points and connecting lines, and visualize the data, enabling developers to better optimize the program.
[0026] Preferably, trigger an alarm when a specific human posture is detected to enhance practicality. For example, an alarm can be issued when the elderly or children fall.
[0027] Preferably, when the alarm is triggered, execute the instructions of the linkage device. For example, call the emergency contact through the smart home central control and send a message to improve the response speed of the administrator after perceiving danger.
[0028] Preferably, when in a specific posture, save the content before and after the camera video stream for convenient event tracing.
[0029] The human posture detection method provided by the embodiments of this application solves the problem of insufficient computing power of embedded devices by putting the analysis and calculation process into a computer device with higher performance, and improves the speed of recognition and detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention, but do not constitute a limitation to the present invention.
[0031] Figure 1 It is a schematic diagram of the pre-detection preparation process
[0032] Figure 2 It is a diagram of the posture judgment steps
[0033] Figure 3 It is a code logic diagram DETAILED DESCRIPTION OF THE EMBODIMENTS
[0034] The present invention will be described in detail below with reference to the drawings and embodiments. The following embodiments are only used to illustrate the technical solutions of the present invention more clearly, so they are only examples and cannot be used to limit the protection scope of the present invention.
[0035] Unless otherwise specified, the technical terms or scientific terms used in this application should have the ordinary meaning understood by those skilled in the art. The terms "first", "second", etc. used in this specification, claims and drawings are used to distinguish similar objects and do not indicate a specific order or priority. In the following description, the normalized coordinates are relative to the image size, x = 0 represents the leftmost side of the image, x = 1 represents the rightmost side of the image, y = 0 represents the top of the image, and y = 1 represents the bottom of the image. The x coordinate is accessed through the [0] index, the y coordinate is accessed through the [1] index, and np is the numpy library.
[0036] An embodiment of the present application provides a posture detection method, including:
[0037] Select a suitable camera. According to the application scenario and performance requirements, select a camera with appropriate resolution, frame rate, and interface type.
[0038] Connect the camera to the computer, such as a USB interface and a web camera. In this embodiment, STM32H723ZG on the Plc circuit board is used for communication.
[0039] The computer program is initialized and, as Figure 1 shown, establish a connection with the camera, enable the server to establish a communication connection with the video transmission module, and start listening for messages. The camera takes pictures, and the camera sends the video stream to the server through the video transmission module; after obtaining the camera frame, perform image preprocessing, and after preprocessing, obtain the human feature points. In this embodiment, the MediaPipePose model is used to identify and obtain the positions of human feature points. If the acquisition fails, use the next frame of image for identification. If the acquisition is successful, perform posture detection.
[0040] Use the shoulder, hip, and knee position information to enter the following steps as Figure 2 :
[0041] θ = arctan2(A3[1] - A2[1], A3[0] - A2[0]) - arctan2(A1[1] - A2[1], A1[0] - A2[0])
[0042] A1[0] and A1[1] respectively represent the abscissa and ordinate of the shoulder, A2[0] and A2[1] respectively represent the abscissa and ordinate of the hip, and A3[0] and A3[1] respectively represent the coordinates and ordinate of the knee;
[0043] (1) If it is determined that the left θ angle is not equal to the right θ angle and the left θ or right θ angle is greater than 160°, then enter the next judgment (2). Otherwise, it is considered that the current posture is a standing posture;
[0044] [[ID=?]]Y = |y1 - y2|
[0045] y 1、 y2 are respectively the ordinates of the two points where the vertical difference needs to be calculated;
[0046] (2) Determine whether the vertical difference Y between the left and right shoulders is less than 0.04. If it is less than 0.04, then enter the next judgment (3). Otherwise, enter (21);
[0047] (21) Determine whether the vertical difference Y between the left ear and the left shoulder or the right ear and the right shoulder is less than 0.1. If it is less than 0.1, then it is determined as a wrestling. Otherwise, it is determined that the posture is a bending posture;
[0048] (3) Determine whether the vertical difference Y between the left shoulder and the left hip or the right shoulder and the right hip is less than 0.03. If it is less than 0.03, proceed to the next judgment (4); otherwise, determine that the posture is a bent waist.
[0049] (4) Determine whether the vertical difference between the left ear and the left shoulder or the right ear and the right shoulder is less than 0.1. If it is less than 0.1, it indicates that the current posture is a fall; otherwise, determine that the posture is a bent waist.
[0050] In an implementation case, on the analyzed image, use the OpenCV library to display the calculation and detection results of the angles, draw key points and connection lines, and perform data visualization to enable developers to better optimize the program.
[0051] In an implementation case, trigger an alarm when a specific human posture is detected to improve practicality. For example, an alarm can be issued when the elderly or children fall.
[0052] In an implementation case, when the alarm is triggered, execute the instructions of the linkage device. For example, send a message to the emergency contact through the smart home central control.
[0053] In an implementation case, when in a specific posture, use the camera and the OpenCV library to save the content before and after the video stream for convenient event tracing.
[0054] A human posture detection system, comprising: an electronic camera capable of communication, used to acquire and transmit video data; a processor and a memory storing a computer program, which when executed implements the human posture recognition method described in any one of claims 1-3.
[0055] The human posture detection method provided by the example of this application solves the problem of insufficient computing power of embedded devices by placing the analysis and calculation process in a computer device with higher performance, and improves the speed of recognition and detection.
Claims
1. A human body posture recognition method, characterized in that, It includes the following steps: The server performs image preprocessing on the received frame image before feature extraction, including: noise removal, histogram equalization, and normalization; Perform feature extraction on it to obtain the coordinates of key human body parts, including: the left and right coordinates of the shoulders, ears, hips, and knees; Calculate the necessary body angles based on the coordinates of the key parts, normalize the coordinate data, and enter the posture judgment; The judgment method includes the following steps: θ = arctan2(A3[1] - A2[1], A3[0] - A2[0]) - arctan2(A1[1] - A2[1], A1[0] - A2[0]) A1[0] and A1[1] respectively represent the abscissa and ordinate of the shoulder, A2[0] and A2[1] respectively represent the abscissa and ordinate of the hip, and A3[0] and A3[1] respectively represent the coordinates and ordinate of the knee; Use the difference between the left θ angle and the right θ angle to judge the posture.
2. The human body posture recognition method according to claim 1, characterized in that, It also includes the step of using the height difference between the left and right target points to judge the posture.
3. The human body posture recognition method according to claim 2, wherein The judgment methods for the θ angle and the target point height difference are as follows: (1) If it is judged that the left θ angle of the human body is not equal to the right θ angle and the left θ or right θ angle is greater than 160°, then enter the next judgment (2), otherwise it is considered that the current posture is a standing posture; Y = |y1 - y2| y 1、 y2 are the ordinates of the left and right target points respectively; (2) Judge whether the vertical difference Y between the left and right shoulders is less than 0.
04. If it is less than 0.04, then enter the next judgment (3), otherwise enter (21); (21) Judge whether the vertical difference Y between the left ear and the left shoulder or the right ear and the right shoulder is less than 0.
1. If it is less than 0.1, it is determined as a fall, otherwise the posture is determined as bending over; (3) Judge whether the vertical difference Y between the left shoulder and the left hip or the right shoulder and the right hip is less than 0.
03. If it is less than 0.03, then enter the next judgment (4), otherwise judge the posture as bending over; (4) Judge whether the vertical difference between the left ear and the left shoulder or the right ear and the right shoulder is less than 0.
1. If it is less than 0.1, it means that the current posture is a fall, otherwise the posture is determined as bending over.
4. A human body posture detection system, characterized in that, It includes: An electronically communicable camera for acquiring and transmitting video data; A processor and a memory storing a computer program, which when executed implements the posture detection method described in any one of claims 1 - 3.
5. A human body posture detection system according to claim 4, characterized in that, Display the calculation and detection results of the angle on the analyzed image and draw key points and connection lines.
6. The human body posture detection system according to claim 4, characterized in that, Trigger an alarm when a specific human body posture is detected.
7. The human body posture detection system according to claim 6, characterized in that When triggering the alarm, send a prefabricated instruction to the linked device.
8. A human body posture detection system according to claim 4, characterized in that, Save the content before and after the video stream captured by the camera in a specific posture.
Citation Information
Patent Citations
Method and device for correcting reading postures of teenagers and children and electronic equipment
CN115035548A
Posture recognition method
CN119357613A