Attitude detection method, computer equipment and storage medium
By obtaining the relative positional relationship between the target person and the lectern area, and utilizing the height difference and overlap between the human body bounding box and the standing body bounding box, the problem of insufficient accuracy in teacher posture recognition in educational recording systems was solved, and accurate posture detection was achieved even when the lectern was obstructed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-04-03
AI Technical Summary
In existing educational recording systems, the accuracy of recognizing teachers' standing or sitting postures is insufficient, especially when the teacher's desk obscures the view, making misjudgments easy.
By obtaining the relative positional relationship between the target person and the lectern area, and utilizing the height difference between the human body bounding box and the standing body bounding box, combined with the overlap and confidence scores, the standing or sitting posture of the person can be determined.
It improves the accuracy of posture detection, especially when the lectern is obstructing the view, it can still accurately identify the posture of people and simplify the detection process.
Smart Images

Figure CN121789274A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and more particularly to pose detection methods, computer devices, and storage media. Background Technology
[0002] With the popularization of smart classrooms and high-quality course recording, educational recording systems have placed higher demands on teacher behavior analysis, including the accurate identification of various teaching postures such as standing to explain, sitting to correct, and writing on the blackboard.
[0003] Relying on high-definition cameras deployed in the recording system, computer vision algorithms are used to extract key points of the teacher's body, such as the head, neck, shoulders, waist, hips, knees, and ankles. Based on the position of these key points, the system determines whether the body is in a specific posture, such as standing or sitting. When a podium or table obstructs the view, it is difficult to extract key points below the waist, which may lead to misjudging a standing posture as a sitting posture, resulting in insufficient accuracy. Summary of the Invention
[0004] This application provides an attitude detection method, computer equipment, and storage medium, with the aim of improving the accuracy of attitude detection.
[0005] Firstly, a posture detection method is provided, including: Obtain a first target recognition result and a second target recognition result; the first target recognition result is used to indicate the location of the target person; the second target recognition result includes a region recognition result and a region object recognition result, the region recognition result is used to indicate the location of the target region, the target region is a region containing a lectern, and the region object recognition result is used to indicate the location of the lectern in the target region; Based on the first target recognition result and the second target recognition result, the relative positional relationship between the target person, the target area, and the lectern is determined; Based on the relative positional relationship, the posture recognition result of the target person is determined, and the posture recognition result is used to indicate whether the target person is in a standing posture or a sitting posture.
[0006] In this technical solution, a first target recognition result and a second target recognition result are obtained. The first target recognition result indicates the position of the target person, and the second target recognition result indicates the position of the target area containing the lectern and the position of the lectern within the target area. Then, based on the first and second target recognition results, the relative positional relationship between the target person, the target area, and the lectern within the target area is determined. Finally, based on the relative positional relationship, the posture recognition result of the target person is determined to indicate whether the target person is in a standing or sitting posture. Combining the relative positional relationship between the target person, the target area, and the lectern within the target area to determine the posture recognition result of the target person is beneficial for accurately identifying the standing or sitting posture of the person when the person's body is obscured by the lectern, improving the accuracy of posture detection, and simplifying the detection process.
[0007] In conjunction with the first aspect, in one possible implementation, the first target recognition result includes the current human bounding box corresponding to the target person; determining the pose recognition result of the target person based on the relative positional relationship includes: when the target person is located in the lectern area, determining the relative displacement of the current human bounding box and the standing bounding box in the height direction, the lectern area being a sub-region within the target area including the lectern, and the standing bounding box being the human bounding box corresponding to the person in a standing posture; and determining the pose recognition result of the target person based on the relative displacement.
[0008] When the target person is located in the lectern area, it indicates that the person's body may be obscured by the lectern. Based on the relative displacement of the human body bounding box and the standing body bounding box in the height direction, the person's posture recognition result is determined. The posture recognition result is not affected by the body occlusion, and the recognition method is accurate and simple.
[0009] In conjunction with the first aspect, in one possible implementation, determining the relative displacement of the current human bounding box and the standing bounding box in the height direction includes: determining the height corresponding to the upper boundary of the current human bounding box to obtain a first height; determining the height corresponding to the upper boundary of the standing bounding box to obtain a second height; and determining the absolute value of the height difference between the first height and the second height as the relative displacement of the current human bounding box and the standing bounding box in the height direction.
[0010] The upper boundary of the human body bounding box is usually higher than the height of the lectern, so that the body can still be recognized even when it is obscured by the lectern, maintaining high recognition accuracy. The absolute value of the height difference between the upper boundary of the human body bounding box and the upper boundary of the standing body bounding box is used as the relative displacement required to determine the posture recognition result of the person, which helps to accurately determine the posture recognition result of the person. In conjunction with the first aspect, in one possible implementation, determining the posture recognition result of the target person based on the relative displacement includes: if the relative displacement is greater than a displacement threshold, determining the posture recognition result of the target person as a first recognition result, the first recognition result being used to indicate that the target person is in a seated posture; the displacement threshold is obtained based on the height of the human body bounding box; if the displacement is less than or equal to the displacement threshold, determining the posture recognition result of the target person as a second recognition result, the second recognition result being used to indicate that the target person is in a standing posture.
[0011] The relative displacement of the human body bounding box and the standing body bounding box in the height direction is compared with a displacement threshold to determine the posture recognition result of the person. The recognition method is accurate and simple.
[0012] In conjunction with the first aspect, in one possible implementation, determining the posture recognition result of the target person based on the relative positional relationship further includes: when the target person is located in the target area but not in the lectern area, determining the posture recognition result of the target person as a second recognition result, wherein the second recognition result is used to indicate that the target person is in a standing posture.
[0013] In conjunction with the first aspect, in one possible implementation, the method further includes: updating the standing body bounding box based on the current human body bounding box when the target person is located in the target area but not in the lectern area.
[0014] When a person is located in the target area but not in the lectern area, it indicates that the person is in a standing posture. Updating the standing body bounding box based on the current human body bounding box allows the standing body bounding box to adapt to the individual attributes of the person (such as height, posture, etc.), which helps to accurately determine the person's posture.
[0015] In conjunction with the first aspect, in one possible implementation, the first target recognition result includes the current human bounding box corresponding to the target person, the region recognition result includes the region bounding box corresponding to the target region, and the region object recognition result includes the object bounding box corresponding to the lectern; determining the relative positional relationship between the target person, the target region, and the lectern based on the first target recognition result and the second target recognition result includes: determining the center point of the current human bounding box; if the center point is within the region bounding box and within the object bounding box, determining that the target person is located in the lectern region; if the center point is within the region bounding box and outside the object bounding box, determining that the target person is located in the target region and not in the lectern region.
[0016] By determining the relationship between the center point of the human body bounding box and the bounding box of the region representing the target area and the bounding box of the object representing the lectern, the relative positional relationship between the target person and the target area and the lectern in the target area can be determined, which helps to quickly determine the relative positional relationship between the target person and the target area and the lectern in the target area.
[0017] In conjunction with the first aspect, in one possible implementation, the first target recognition result includes the current human bounding box corresponding to the target person, the region recognition result includes the region bounding box corresponding to the target region, and the region object recognition result includes the object bounding box corresponding to the lectern; determining the relative positional relationship between the target person, the target region, and the lectern based on the first target recognition result and the second target recognition result includes: determining a first overlap degree and a second overlap degree, wherein the first overlap degree is the overlap degree between the current human bounding box and the region bounding box, and the second overlap degree is the overlap degree between the current human bounding box and the object bounding box; if the first overlap degree is greater than a first overlap degree threshold and the second overlap degree is greater than a second overlap degree threshold, determining that the target person is located in the lectern region; if the first overlap degree is greater than the first overlap degree threshold and the second overlap degree is less than or equal to the second overlap degree threshold, determining that the target person is located in the target region but not in the lectern region.
[0018] By determining the degree of overlap between the bounding box representing the person, the bounding box representing the target area, and the bounding box representing the lectern, the relative positional relationship between the target person and the target area and the lectern within the target area can be determined, which helps to quickly determine the relative positional relationship between the target person and the target area and the lectern within the target area.
[0019] Secondly, an attitude detection device is provided, comprising: A location recognition module is used to acquire a first target recognition result and a second target recognition result; the first target recognition result is used to indicate the location of the target person; the second target recognition result includes a region recognition result and a region object recognition result, the region recognition result is used to indicate the location of the target region, the target region is a region containing a lectern, and the region object recognition result is used to indicate the location of the lectern in the target region; The relative position determination module is used to determine the relative positional relationship between the target person, the target area, and the lectern based on the first target recognition result and the second target recognition result; The posture recognition module is used to determine the posture recognition result of the target person based on the relative position relationship. The posture recognition result is used to indicate whether the target person is in a standing posture or a sitting posture.
[0020] Thirdly, a computer device is provided, including a memory and a processor, the memory being connected to the processor, the processor being configured to execute one or more computer programs stored in the memory, wherein when the processor executes the one or more computer programs, the computer device implements the attitude detection method of the first aspect described above.
[0021] Fourthly, a computer-readable storage medium is provided, which stores a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the attitude detection method of the first aspect.
[0022] This application can achieve the following technical effects: by combining the relative positional relationship between the target person and the target area and the lectern in the target area, the posture recognition result of the target person can be determined. This is beneficial for accurately identifying the standing or sitting posture of the person when the person's body is obscured by the lectern, improving the accuracy of posture detection, and simplifying the detection process. Attached Figure Description To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A schematic flowchart of the attitude detection method provided in the embodiments of this application; Figure 2 A schematic diagram of the image corresponding to the podium area provided in the embodiments of this application; Figure 3 A flowchart illustrating the process of determining the posture recognition result of a target person according to an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an attitude detection device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0025] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. Moreover, the terms "first," "second," and "third" used in this application do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0026] The technical solution of this application is applicable to posture detection scenarios, used to detect whether a target person is standing or sitting, thereby analyzing the person's behavior. For example, the technical solution of this application can be used in a smart classroom scenario to analyze whether the teacher is standing or sitting on the podium, thereby determining whether the teacher is giving a standing lecture or grading assignments while seated.
[0027] In some feasible technical solutions, human keypoint extraction algorithms (such as OpenPose, MediaPipePose, etc.) are used to extract human keypoints from human images. These keypoints are then used to determine whether the person in the image is standing or sitting. For example, after obtaining the left and right hip keypoints, left and right knee keypoints, left and right ankle keypoints, and waist keypoints from the human keypoints, the midpoint of the left and right hip keypoints is denoted as p1(x1, y1), the midpoint of the left and right knee keypoints is denoted as p2(x2, y2), the midpoint of the left and right ankle keypoints is denoted as p3(x3, y3), and the waist keypoint is denoted as p4(x4, y4). Then, D1, D2, D3, and D4 are calculated, where D1 = y1 - y2, D2 = y2 - y3, and D3 = y4 - y1. If D1 / D2 ≤ 0.7 and D3 / D1 ≤ 0.6, the person in the image is determined to be in a seated posture; if D2 / D2 > 0.7 and D3 / D1 > 0.6, the person in the image is determined to be in a standing posture. When the person in the image is occluded by an object, such as a teacher being obscured by a table on a lectern, it is difficult to extract key points below the waist, resulting in insufficient accuracy in posture recognition.
[0028] Therefore, this application proposes a posture detection scheme that uses the podium and the table on it as references to determine the relative positional relationship between the target person and the podium area and the table on it. The relative positional relationship between the target person and the podium area and the table on it can reflect whether the target person is obscured by the table on the podium. Based on the relative positional relationship between the target person and the podium area and the table on it, it can be determined whether the target person is in a standing or sitting posture. This is beneficial for accurately identifying the standing or sitting posture of a person when their body is obscured by the podium table, improving the accuracy of posture detection, and simplifying the detection process.
[0029] The technical solution of this application can be applied to computer equipment, including but not limited to interactive whiteboards, recording and broadcasting machines (referring to computer equipment used for recording audio and video), and smart all-in-one machines. The computer equipment has a built-in camera, or the computer equipment is connected to a camera. The camera is used to capture images of the podium area to obtain the target image. The camera can be positioned above the podium area to capture images of the podium area from a top-down angle to obtain the target image; the camera can also be positioned behind or to the side of the space where the podium is located (such as a classroom, conference room, etc.), facing the podium, to capture images of the podium area and obtain the target image. This application does not impose any limitations on this.
[0030] See Figure 1 , Figure 1 This is a flowchart illustrating the attitude detection method provided in the embodiments of this application, as shown below. Figure 1 As shown, the method includes the following steps: S101, Obtain the first target recognition result and the second target recognition result.
[0031] Here, the first target recognition result is used to indicate the location of the target person. The target person is the person whose posture is to be detected. The target person can be a teacher in a classroom scene, a speaker or presenter in a meeting scene, etc.
[0032] The first target recognition result includes the current human body bounding box, which represents the position of the target person in the current target image; the target image refers to the image corresponding to the podium area, that is, the image content includes the podium area; the current target image refers to the target image acquired at the current time.
[0033] The second target recognition result includes region recognition result and region object recognition result.
[0034] The region recognition result is used to represent the location of the target region, which is the area containing the lectern. For example, the target region could be the podium area in a space such as a classroom, conference room, or studio. The region recognition result includes the region bounding box corresponding to the target region, which is used to represent the location of the target region in the target image.
[0035] The region object recognition result is used to represent the position of the lectern within the target region. The region object recognition result includes the object bounding box corresponding to the lectern in the target region, which represents the position of the lectern in the target image.
[0036] In this application, the current human bounding box, the region bounding box, and the object bounding box are all rectangular boxes. In one example, the rectangular box can be represented as (x, y, w, h), where (x, y) represents the vertex coordinates of the rectangle. These vertex coordinates can be the coordinates of the top-left corner, the top-right corner, the bottom-left corner, or the bottom-right corner of the rectangle. w represents the width of the rectangle, and h represents its height. The rectangular box can also have other representations; for example, it can be represented as {(x1, y1), (x2, y2)}, where (x1, y1) and (x2, y2) represent the coordinates of the two diagonal vertices of the rectangle. This application does not impose any limitations on this representation.
[0037] Optionally, the first target recognition result may further include the confidence score corresponding to the current human body bounding box, which indicates the probability that the current human body bounding box contains the target person; the region recognition result may further include the confidence score corresponding to the region bounding box, which indicates the probability that the region bounding box contains the target region; the region object recognition result may further include the confidence score corresponding to the object bounding box, which indicates the probability that the object bounding box contains the lectern. Wherein, the higher the confidence score, the greater the probability, and the lower the confidence score, the lower the probability.
[0038] In one specific implementation, a static image corresponding to the target area can be acquired. For example, the first 30 seconds of footage captured by a camera of the target area can be used as the static image corresponding to the target area. A semantic segmentation model is then used to perform semantic segmentation and target extraction on the static image to obtain a second target recognition result. The semantic segmentation model is a pre-trained model used to segment and extract the target area and the lectern within the target area. Semantic segmentation models include, but are not limited to, PSPNet, U-Net, or MobileNet.
[0039] In one specific implementation, a real-time image corresponding to the target area can be acquired. For example, the image obtained by a camera capturing the target area in real time can be used as the real-time image corresponding to the target area. A human detection model is then used to extract human targets from the real-time image to obtain a first target recognition result. Human detection models include, but are not limited to, YOLOv8, MobileNet-SSD, or EfficientDet-Lite.
[0040] S102, based on the first target recognition result and the second target recognition result, determine the relative positional relationship between the target person and the target area and the lectern in the target area.
[0041] Here, the relative positional relationship between the target person and the target area, and between the target person and the lectern within the target area, includes the relative positional relationship between the target person and the target area, and the relative positional relationship between the target person and the lectern area. The lectern area is a sub-region within the target area that includes the lectern itself. (The target image is shown below.) Figure 2 As shown in the example, the target region corresponds to the target image. Figure 2 Q1 in the image corresponds to the lectern area in the target image. Figure 2 Q2 in the text.
[0042] The relative positional relationship between the target person and the target area is divided into the target person being within the target area and the target person being outside the target area. The relative positional relationship between the target person and the lectern area is also divided into the target person being within the lectern area and the target person being outside the lectern area.
[0043] In one feasible implementation, the relative positional relationships between the target person, the target area, and the lectern in the target area can be determined through the following steps A1-A3: A1. Determine the center point of the current human body bounding box.
[0044] Here, the center point of the current human body bounding box is the intersection point between the two diagonals of the current human body bounding box.
[0045] Given a bounding box represented as (x, y, w, h) and (x, y) representing the coordinates of the top-left corner of the bounding box, the center point of the current human body bounding box can be represented as (x, y, w, h). r +w r / 2,y r +h r / 2), (x r y r ) represents the coordinates of the top-left corner of the current human bounding box, w r h represents the width of the current human body bounding box. r This indicates the height of the current human body bounding box.
[0046] Given a rectangle represented as {(x1, y1), (x2, y2)}, the center point of the current human bounding box can be represented as ((x1, y1), (x2, y2)}. r1 +x r1 ) / 2, (y r1 +y r2 ) / 2, (x r1 y r1 ) and (x r2 y r2 () represents the coordinates of the two vertices on the diagonal of the current human bounding box.
[0047] A2. If the center point of the current human body bounding box is within the region bounding box and the object bounding box, determine that the target person is located in the lectern area.
[0048] Understandably, the fact that the target person is located in the lectern area implies that the target person is located within the target area.
[0049] A3. If the center point of the current human body bounding box is inside the region bounding box and outside the object bounding box, determine that the target person is located in the target region and not in the lectern region.
[0050] Specifically, the coordinate range corresponding to the region bounding box (hereinafter referred to as the first coordinate range) and the coordinate range corresponding to the object bounding box (hereinafter referred to as the second coordinate range) can be determined. If the center point of the current human bounding box is within the first coordinate range and within the second coordinate range, then the center point of the current human bounding box is determined to be within the region bounding box and within the object bounding box, that is, the target person is located within the lectern area. If the center point of the current human bounding box is within the first coordinate range but not within the second coordinate range, then the current human bounding box is determined to be within the region bounding box and outside the object bounding box, that is, the target person is located within the target area and outside the lectern area. If the center point of the current human bounding box is not within the first coordinate range, then the center point of the current human bounding box is determined to be outside the region bounding box, that is, the target person is outside the target area.
[0051] Given a rectangle represented as (x, y, w, h) and (x, y) representing the coordinates of the top-left corner of the rectangle, the first coordinate range can be represented as (x, y, w, h). j y j ;x j +w j y j + h j The second coordinate range can be represented as (x d y d ;x d +w d y d + h d ); (x jy j ) represents the coordinates of the top-left corner of the region's bounding box, w j h represents the width of the region bounding box. j Indicates the height of the region's bounding box; (x d y d ) represents the coordinates of the top-left corner of the object's bounding box, w d h represents the width of the object's bounding box. d This indicates the height of the object's bounding box.
[0052] In steps A1-A3 above, by determining the relationship between the center point of the human body bounding box and the bounding box of the region representing the target area and the bounding box of the object representing the lectern, the relative positional relationship between the target person and the target area and the lectern in the target area can be determined, which helps to quickly determine the relative positional relationship between the target person and the target area and the lectern in the target area.
[0053] In another feasible implementation, the relative positional relationship between the target person, the target area, and the lectern in the target area can also be determined through the following steps B1-B3: B1. Determine the first degree of overlap and the second degree of overlap.
[0054] The first overlap is the overlap between the current human bounding box and the region bounding box, and the second overlap is the overlap between the current human bounding box and the object bounding box.
[0055] Specifically, the intersection overunion (IoU) ratio between the current human bounding box and the region bounding box can be used as the first degree of overlap, and the IoU ratio between the current human bounding box and the object bounding box can be used as the second degree of overlap.
[0056] B2. If the first overlap degree is greater than the first overlap degree threshold and the second overlap degree is greater than the second overlap degree threshold, the target person is determined to be located in the lectern area.
[0057] B3. If the first overlap degree is greater than the first overlap degree threshold and the second overlap degree is less than or equal to the second overlap degree threshold, determine that the target person is located in the target area and not in the lectern area.
[0058] Optionally, if the first overlap degree is less than or equal to the first overlap degree threshold and the second overlap degree is less than or equal to the second overlap degree threshold, the target person is determined to be outside the target area.
[0059] In steps B1-B3 above, by determining the degree of overlap between the human body bounding box representing the person, the region bounding box representing the target area, and the object bounding box representing the lectern, the relative positional relationship between the target person and the target area and the lectern in the target area can be determined, which helps to quickly determine the relative positional relationship between the target person and the target area and the lectern in the target area.
[0060] S103, based on the relative positional relationship between the target person and the target area and the lectern in the target area, determine the pose recognition result of the target person.
[0061] Here, the pose recognition result of the target person is used to indicate whether the target person is standing or sitting.
[0062] In some embodiments, by Figure 3 The process steps shown determine the pose recognition result of the target person, including the following steps C1-C5: C1. Determine whether the target person is located in the lectern area.
[0063] If the target person is within the lectern area, proceed to step C2; if the target person is outside the lectern area, proceed to step C4.
[0064] C2. Determine the relative displacement of the current human bounding box and the standing bounding box in the height direction.
[0065] Here, the height direction refers to the direction reflecting the direction of gravity in the target image. The relative displacement of the current human bounding box and the standing bounding box in the height direction reflects the displacement of the current human bounding box relative to the standing bounding box in the height direction.
[0066] The standing bounding box is the bounding box corresponding to the human body of a person in a standing posture. The standing bounding box can be a pre-defined human bounding box. For example, based on the camera's deployment location, the position of a person standing on the platform in the image captured by the camera can be determined in advance, and the position of the person in the standing posture in the image can be pre-marked to obtain the human bounding box. The standing bounding box can also be obtained based on the target person's human bounding box. For example, the human bounding boxes of the target person in a standing posture from historical time periods can be obtained; alternatively, the average or clustering of multiple human bounding boxes of the target person in a standing posture from historical time periods can also be used to obtain the standing bounding box. Since the standing bounding box is based on the target person's human bounding box, it accurately reflects the height of the target person in a standing state in the image, thus facilitating the accurate determination of the target person's posture recognition results.
[0067] In one feasible implementation, the relative displacement in the height direction between the current human bounding box and the standing bounding box can be determined through the following steps C21-C23: C21. Determine the height corresponding to the upper boundary of the current human body bounding box to obtain the first height.
[0068] Here, the height corresponding to the upper boundary of the current human bounding box is denoted as h1. When the rectangle is represented as (x, y, w, h) and (x, y) represents the coordinates of the top-left corner of the rectangle, h1 = y r .
[0069] C22. Determine the height corresponding to the upper boundary of the standing body bounding box to obtain the second height.
[0070] Here, the height corresponding to the upper boundary of the standing bounding box is denoted as h2. When the rectangle is represented as (x, y, w, h) and (x, y) represents the coordinates of the upper left corner of the rectangle, h2 = y. s , (x s y s () represents the coordinates of the top left corner of the standing bounding box.
[0071] C23. The absolute value of the height difference between the first height and the second height is determined as the relative displacement of the current human body bounding box and the standing body bounding box in the height direction.
[0072] The relative displacement of the current human bounding box and the standing bounding box in the height direction is represented by Δh, where Δh = |h1 - h2|.
[0073] In steps C21-C23 above, the upper boundary of the human body bounding box is usually higher than the height of the lectern, so that the body can still be recognized even when it is obscured by the lectern, maintaining a high recognition accuracy. The absolute value of the height difference between the upper boundary of the human body bounding box and the upper boundary of the standing body bounding box is used as the relative displacement required to determine the posture recognition result of the person, which helps to accurately determine the posture recognition result of the person. Optionally, the absolute value of the height difference between the horizontal centerline of the current human bounding box (referring to the centerline parallel to the upper and lower boundaries) and the horizontal centerline of the standing bounding box, or the absolute value of the height difference between the center of the current human bounding box and the center of the standing bounding box, can be determined as the relative displacement of the current human bounding box and the standing bounding box in the height direction. This application does not impose any limitations on this.
[0074] C3. Determine the pose recognition result of the target person based on the relative displacement of the current human body bounding box and the standing body bounding box in the height direction.
[0075] In one feasible implementation, it can be determined whether the relative displacement of the current human bounding box and the standing bounding box in the height direction is greater than a displacement threshold. If the relative displacement of the current human bounding box and the standing bounding box in the height direction is greater than the displacement threshold, the posture recognition result of the target person is determined as the first recognition result, which indicates that the target person is in a seated posture. If the relative displacement of the current human bounding box and the standing bounding box in the height direction is greater than the displacement threshold but less than or equal to the displacement threshold, the posture recognition result of the target person is determined as the second recognition result, which indicates that the target person is in a standing posture.
[0076] The displacement threshold is derived from the height of the human bounding box, which can be expressed as k×H, where H represents the height of the human bounding box, and k is less than 1. The height of the human bounding box can be a preset height. For example, based on the camera's deployment location, the area of the person on the platform captured by the camera can be determined in advance, resulting in a person region. The average height of this region can then be calculated and used as the height of the human bounding box. Alternatively, the height of the human bounding box can be derived from the target person's human bounding box. For instance, the average height of the target person's bounding box in a standing posture over historical time periods can be obtained and used as the height of the human bounding box. Setting the displacement threshold based on the target person's human bounding box allows it to adaptively change with the person's height, facilitating accurate judgment of the displacement of the current human bounding box relative to the standing bounding box in the height direction, thereby accurately determining the person's posture.
[0077] The relative displacement of the human body bounding box and the standing body bounding box in the height direction is compared with a displacement threshold to determine the posture recognition result of the person. The recognition method is accurate and simple.
[0078] In steps C1-C3 above, when the target person is located in the lectern area, it indicates that the person's body may be obscured by the lectern. Based on the relative displacement of the human body bounding box and the standing body bounding box in the height direction, the person's posture recognition result is determined. The posture recognition result is not affected by the body occlusion, and the recognition method is accurate and simple.
[0079] C4. Determine whether the target person is located in the target area.
[0080] If the target person is located in the target area, it means that the target person is in the target area but not in the lectern area and is within the detection range, so proceed to step C5; if the target person is located outside the target area (i.e., the target person is not in the target area), it means that the target person has left the detection range, so proceed to step C1, or exit the pose recognition process.
[0081] Optionally, if the target person is located within the target area but not within the lectern area, the standing bounding box can be updated based on the current human bounding box.
[0082] This can be achieved by using the current human bounding box as the standing bounding box. Alternatively, the average of the current human bounding box and the standing bounding box can be calculated and used as the updated standing bounding box. In one example, the updated standing bounding box can be represented as (x' s y' s w' s ,h' s (x') s y' s w' represents the coordinates of the top-left corner of the updated standing bounding box. s h' represents the width of the updated standing bounding box. s x' represents the height of the updated standing bounding box. s = (x r +x s ) / 2, y' s = (y r +y s ) / 2,w' s = (w r +w s ) / 2,h' s = (h) r +h s Alternatively, the current human bounding box can be added to the set of human bounding boxes to be clustered. This set includes multiple historical standing bounding boxes. The standing bounding boxes in the set are then clustered to obtain the updated standing bounding boxes. This application does not restrict the specific implementation of updating the standing bounding boxes.
[0083] When a person is located in the target area but not in the lectern area, it indicates that the person is in a standing posture. Updating the standing body bounding box based on the current human body bounding box allows the standing body bounding box to adapt to the individual attributes of the person (such as height, posture, etc.), which helps to accurately determine the person's posture.
[0084] C5. Determine the pose recognition result of the target person as the second recognition result.
[0085] In the above Figure 1In the corresponding technical solution, a first target recognition result and a second target recognition result are obtained. The first target recognition result is used to indicate the position of the target person, and the second target recognition result is used to indicate the position of the target area containing the lectern and the position of the lectern in the target area. Then, based on the first target recognition result and the second target recognition result, the relative positional relationship between the target person and the target area and the lectern in the target area is determined. Finally, based on the relative positional relationship, the posture recognition result of the target person is determined to indicate whether the target person is in a standing or sitting posture. Combining the relative positional relationship between the target person and the target area and the lectern in the target area to determine the posture recognition result of the target person is beneficial for accurately identifying the standing or sitting posture of the person when the person's body is obscured by the lectern, improving the accuracy of posture detection, and simplifying the detection process.
[0086] The method of this application has been described above; the apparatus of this application will be described below.
[0087] See Figure 4 , Figure 4 This is a schematic diagram of the structure of an attitude detection device provided in an embodiment of this application, as shown below. Figure 4 As shown, the attitude detection device 20 includes: The location recognition module 201 is used to acquire a first target recognition result and a second target recognition result; the first target recognition result is used to indicate the location of the target person; the second target recognition result includes a region recognition result and a region object recognition result, the region recognition result is used to indicate the location of the target region, the target region is a region containing a lectern, and the region object recognition result is used to indicate the location of the lectern in the target region; The relative position determination module 202 is used to determine the relative positional relationship between the target person, the target area, and the lectern based on the first target recognition result and the second target recognition result; The posture recognition module 203 is used to determine the posture recognition result of the target person based on the relative position relationship, and the posture recognition result is used to indicate that the target person is in a standing posture or a sitting posture.
[0088] It should be noted that the attitude detection device 20 described above can execute the attitude detection method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in the embodiments can be found in the attitude detection method provided in the embodiments of this application.
[0089] See Figure 5 , Figure 5This is a schematic diagram of the structure of a computer device 30 provided in an embodiment of this application. The computer device 30 includes a processor 301 and a memory 302. The memory 302 is connected to the processor 301, for example, via a bus.
[0090] Processor 301 is configured to support the computer device 30 in performing the corresponding functions in the methods described in the above method embodiments. Processor 301 may be a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof. The aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0091] Memory 302 is used to store program code, etc. Memory 302 may include volatile memory (VM), such as random access memory (RAM); memory 302 may also include non-volatile memory (NVM), such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); memory 302 may also include combinations of the above types of memory.
[0092] The memory 302 is used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the attitude detection method in the embodiments of this application. The processor executes various functional applications and data processing of the attitude detection method by running the non-volatile software programs, instructions, and modules stored in the memory, thereby realizing the functions of the attitude detection method provided in the above method embodiments.
[0093] Memory 302 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function. The data storage area may store data created based on the use of the attitude detection device. In some embodiments, the memory may include memory remotely located relative to the processor, which can be connected to the attitude detection device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0094] The one or more modules are stored in the memory. When executed by the one or more processors, they perform the attitude detection method in any of the above method embodiments. For example, they perform the method steps described in the above method embodiments to realize the functions of the modules described in the above device embodiments.
[0095] This application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the method described in the foregoing embodiments.
[0096] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0097] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. An attitude detection method, characterized in that, include: Obtain the first target recognition result and the second target recognition result; The first target recognition result is used to indicate the location of the target person; The second target recognition result includes a region recognition result and a region object recognition result. The region recognition result is used to indicate the location of the target region, which is a region containing a lectern. The region object recognition result is used to indicate the location of the lectern in the target region. Based on the first target recognition result and the second target recognition result, the relative positional relationship between the target person, the target area, and the lectern is determined; Based on the relative positional relationship, the posture recognition result of the target person is determined, and the posture recognition result is used to indicate whether the target person is in a standing posture or a sitting posture.
2. The method according to claim 1, characterized in that, The first target recognition result includes the current human body bounding box corresponding to the target person; The determination of the pose recognition result of the target person based on the relative positional relationship includes: When the target person is located in the lectern area, the relative displacement of the current human body bounding box and the standing body bounding box in the height direction is determined. The lectern area is a sub-region of the target area that includes the lectern. The standing body bounding box is the human body bounding box corresponding to the person in a standing posture. Based on the relative displacement, the posture recognition result of the target person is determined.
3. The method according to claim 2, characterized in that, Determining the relative displacement of the current human bounding box and the standing bounding box in the height direction includes: Determine the height corresponding to the upper boundary of the current human body bounding box to obtain the first height; Determine the height corresponding to the upper boundary of the standing body bounding box to obtain the second height; The absolute value of the height difference between the first height and the second height is determined as the relative displacement of the current human body bounding box and the standing body bounding box in the height direction.
4. The method according to claim 2, characterized in that, The step of determining the pose recognition result of the target person based on the relative displacement includes: If the relative displacement is greater than a displacement threshold, the posture recognition result of the target person is determined as the first recognition result, which indicates that the target person is in a seated posture; the displacement threshold is obtained based on the height of the human body bounding box. If the displacement is less than or equal to the displacement threshold, the posture recognition result of the target person is determined as the second recognition result, which indicates that the target person is in a standing posture.
5. The method according to claim 2, characterized in that, The determination of the pose recognition result of the target person based on the relative positional relationship further includes: If the target person is located in the target area but not in the lectern area, the posture recognition result of the target person is determined as the second recognition result, which indicates that the target person is in a standing posture.
6. The method according to claim 5, characterized in that, The method further includes: If the target person is located in the target area but not in the lectern area, update the standing body bounding box based on the current human body bounding box.
7. The method according to any one of claims 1-6, characterized in that, The first target recognition result includes the current human body bounding box corresponding to the target person, the region recognition result includes the region bounding box corresponding to the target region, and the region object recognition result includes the object bounding box corresponding to the lectern. Determining the relative positional relationship between the target person, the target area, and the lectern based on the first target recognition result and the second target recognition result includes: Determine the center point of the current human body bounding box; If the center point is within the boundary frame of the area and within the boundary frame of the object, the target person is determined to be located in the lectern area. If the center point is within the region boundary frame and outside the object boundary frame, the target person is determined to be located in the target region and not in the lectern region.
8. The method according to any one of claims 1-6, characterized in that, The first target recognition result includes the current human body bounding box corresponding to the target person, the region recognition result includes the region bounding box corresponding to the target region, and the region object recognition result includes the object bounding box corresponding to the lectern. Determining the relative positional relationship between the target person, the target area, and the lectern based on the first target recognition result and the second target recognition result includes: Determine a first degree of overlap and a second degree of overlap, wherein the first degree of overlap is the degree of overlap between the current human bounding box and the region bounding box, and the second degree of overlap is the degree of overlap between the current human bounding box and the object bounding box; If the first overlap degree is greater than the first overlap degree threshold and the second overlap degree is greater than the second overlap degree threshold, the target person is determined to be located in the lectern area. If the first overlap degree is greater than the first overlap threshold and the second overlap degree is less than or equal to the second overlap threshold, it is determined that the target person is located in the target area and not in the lectern area.
9. A computer device, characterized in that, The device includes a memory and a processor, the memory being connected to the processor, the processor being configured to execute one or more computer programs stored in the memory, the processor causing the computer device to perform the method as described in any one of claims 1-8 when executing the one or more computer programs.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-8.