Attitude detection method and device, equipment, medium and program product
By intercepting key video clips from sports videos and combining them with depth map analysis, high-precision, real-time evaluation of sports performance is achieved, solving the problem of difficulty in achieving accuracy and real-time analysis in traditional technology, and optimizing sports performance and strategy adjustment.
Patent Information
- Application Number
- CN202410742009.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-08-30
AI Technical Summary
It is difficult to achieve high-precision, real-time analysis of sports performance with existing technology. Traditional methods rely on manual observation and subsequent data processing, which is time-consuming and labor-intensive and difficult to achieve accuracy and real-time performance.
By intercepting the key video clips of the static posture in the sports video, combining the depth map and the depth value of the target key point, the indicator value of the static posture is calculated to achieve automated and real-time motion performance evaluation.
It improves the efficiency and accuracy of sports data recording, reduces the time and effort of evaluation, optimizes sports performance and strategy adjustment, and provides accurate posture analysis.
Smart Images

Figure CN118570703A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, specifically to technical fields such as computer vision, deep learning, and AIGC, and can be applied to scenarios such as smart sports. Background Art
[0002] With the development of computer technology and network technology, the application of artificial intelligence is becoming more and more extensive, and artificial intelligence has made breakthrough progress in various fields. For example, in the field of computer vision, deep learning models can be used to analyze collected images or videos.
[0003] In the field of sports, although the concept of smart sports has been proposed, how to combine artificial intelligence with specific needs remains to be studied. Due to the growing demand for high-precision, real-time sports performance analysis, it will be a general trend to combine artificial intelligence with specific needs in the field of sports. Summary of the invention
[0004] The present disclosure aims to provide a posture detection method, device, equipment, medium and program product that can accurately and real-time detect static posture.
[0005] According to a first aspect of the present disclosure, a posture detection method is provided, comprising: based on the key points of the target object in each video frame included in the motion video, intercepting at least one key video segment reflecting the static posture of the target object from the motion video; each key video segment reflects a static posture; for each key video segment, based on the depth map corresponding to each key video segment and the target key points of the target object in each key video segment, determining the depth value corresponding to the target key point; and determining the index value of the static posture reflected by each key video segment based on the depth value and the pixel position of the target key point in each key video segment.
[0006] According to a second aspect of the present disclosure, a posture detection device is provided, comprising: a segment capture module, for capturing at least one key video segment embodying a static posture of a target object from a motion video based on the key points of the target object in each video frame included in the motion video; each key video segment embodies a static posture; a depth value determination module, for determining, for each key video segment, a depth value corresponding to a target key point based on a depth map corresponding to each key video segment and a target key point of the target object in each key video segment; and an index value determination module, for determining an index value of the static posture embodied by each key video segment based on the depth value and the pixel position of the target key point in each key video segment.
[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the posture detection method provided by the present disclosure.
[0008] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the posture detection method provided by the present disclosure.
[0009] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program / instruction, wherein the computer program / instruction is stored on at least one of a readable storage medium and an electronic device, and wherein the computer program / instruction implements the posture detection method provided by the present disclosure when executed by a processor.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0012] Figure 1 is a schematic diagram of an application scenario of the posture detection method and device according to an embodiment of the present disclosure;
[0013] Figure 2 is a flow chart of a posture detection method according to an embodiment of the present disclosure;
[0014] Figure 3 is a schematic diagram of the principle of determining key points of a target object in a video frame according to an embodiment of the present disclosure;
[0015] Figure 4 is a schematic diagram of the principle of intercepting a key video clip embodying a static posture according to the first embodiment of the present disclosure;
[0016] Figure 5 is a schematic diagram of the principle of intercepting a key video clip embodying a static posture according to the second embodiment of the present disclosure;
[0017] Figure 6 is a schematic diagram of the principle of determining a depth value corresponding to a target key point according to an embodiment of the present disclosure;
[0018] Figure 7 is a schematic diagram of the principle of determining the body tilt angle of a target object according to an embodiment of the present disclosure;
[0019] Figure 8 is a structural schematic diagram of a posture detection device according to an embodiment of the present disclosure; and
[0020] Fig. 9 It is a block diagram of an electronic device used to implement the posture detection method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0022] In the field of sports or fitness, there is a growing demand for high-precision, real-time analysis of sports performance. This demand stems from athletes' constant pursuit of performance optimization. For example, athletes pursue projects such as accurate analysis of technical details, timely adjustment of sports strategies, and effective management of injury prevention. Traditional technologies for analyzing sports performance often rely on manual observation and subsequent processing of collected data, which is not only time-consuming and labor-intensive, but also difficult to achieve the required accuracy and real-time performance.
[0023] The present disclosure aims to solve the key technical problems existing in the conventional technology, so as to improve the efficiency and accuracy of recording sports data. For example, the present disclosure aims to use advanced vision and artificial intelligence technologies to capture and analyze the movements of sports participants in real time, accurately and automatically.
[0024] In order to solve the problems existing in the conventional technology, the present disclosure provides a posture detection method, device, equipment, medium and program product. Figure 1 The application scenarios of the method and device provided by the present disclosure are described.
[0025] Figure 1 It is a schematic diagram of an application scenario of the posture detection method and device according to an embodiment of the present disclosure.
[0026] like Figure 1 As shown, the application scenario 100 may include an electronic device 110 and a collection device 120. The collection device 120 may be connected to the electronic device 110 via a network to communicate with the electronic device 110 so as to transmit the collected data to the electronic device 110.
[0027] The electronic device 110 may be any electronic device with processing capability, such as a smart phone, a tablet computer, a portable computer, a desktop computer or a server. The acquisition device 120 may include one or more image acquisition devices to acquire sports videos of a target object 130 (eg, an athlete or a bodybuilder).
[0028] The electronic device 110 may, for example, analyze the motion video collected by the collection device 120. For example, the static posture of the target object in the motion video may be analyzed, and the static posture may be evaluated to obtain an index value of the static posture.
[0029] In one embodiment, there may be one or more acquisition devices, and the acquisition device may not only acquire motion video, but also synchronously acquire depth images, and transmit the synchronously acquired motion video and depth images to the electronic device 110. For example, the electronic device 110 may refer to the depth map and the motion video to evaluate the static posture of the target object. For example, the acquisition device may include a depth camera and a color camera, etc., which is not limited in the present disclosure.
[0030] When capturing sports videos, the target object 130 may, for example, participate in sports such as rings, weightlifting, and horizontal bar exercises, or perform fitness exercises such as plank support.
[0031] The application scenario may not only be a scenario involved in the professional sports field, but also a scenario involved in school sports activities or business sports activities, or a scenario involved in a gym, etc., and the present disclosure does not limit this.
[0032] It should be noted that the posture detection method provided by the present disclosure can be executed by the electronic device 110. Accordingly, the posture detection device provided by the present disclosure can be set in the electronic device 110.
[0033] It should be understood that Figure 1 The number and type of the electronic devices 110 and the collection devices 120 in the embodiment are only for illustration. According to the implementation requirements, any number and type of the electronic devices 110 and the collection devices 120 may be provided.
[0034] The following will be combined Figure 2~Figure 7 The posture detection method provided by the present disclosure is described in detail.
[0035] Figure 2 It is a flowchart of a posture detection method according to an embodiment of the present disclosure.
[0036] like Figure 2 As shown, the posture detection method 200 of this embodiment may include operations S210 to S230.
[0037] In operation S210, at least one key video segment reflecting a static posture of the target object is captured from the motion video based on key points of the target object in each video frame included in the motion video.
[0038] Each key video clip represents a static posture, and each key video clip includes at least two video frames, in which the target object has the static posture represented by the key video clip.
[0039] According to an embodiment of the present disclosure, key point detection of the target object can be performed on each video frame to obtain the key points of the target object in each video frame. The key points of the target object in each video frame can be obtained by real-time detection, or they can be pre-detected and stored in a predetermined storage space. For example, key point detection can be performed based on the idea of template matching, or a posture estimation method based on deep learning can be used to perform key point detection. For example, a posture estimation method based on deep learning can be implemented by relying on a neural network model, and the neural network model can include a mask-based recurrent-convolutional neural network (Mask R-CNN) model, an AlphaPose model, a MobilePose model, etc., which is not limited by the present disclosure.
[0040] In one embodiment, the key points of the target object detected can be understood as skeleton key points, and the number of key points detected for each target object can be 15, 16, 18 or 25, etc., which is not limited in the present disclosure.
[0041] In this embodiment, the position difference of the key points of the target object in two adjacent video frames can be compared. If the position difference is less than a predetermined difference (e.g., close to 0), it is determined that the two adjacent video frames belong to the same key video segment. All adjacent video frames in the motion video can be traversed, and at least one key video segment is obtained after the traversal is completed.
[0042] According to an embodiment of the present disclosure, the sports video may be collected when the target object participates in sports training or competition, or when the target object performs fitness exercises, etc. This embodiment can collect sports videos in real time, and perform real-time static posture detection on the sports videos collected in real time.
[0043] In operation S220, for each key video segment, a depth value corresponding to a target key point is determined based on a depth map corresponding to each key video segment and a target key point of a target object in each key video segment.
[0044] According to an embodiment of the present disclosure, when each video frame in a motion video is acquired, a depth map can be acquired synchronously, that is, each video frame corresponds to a depth map, and each video frame can have the same timestamp as the corresponding depth map. The depth map corresponding to each key video clip can include at least two depth maps corresponding to at least two video frames included in each key video clip. This embodiment can determine, for each video frame in the key video clip, the depth value at the corresponding position in the depth map corresponding to each video frame based on the position of the target key point of the target object in each video frame. In this way, for each key video clip, a depth value corresponding to each target key point of the target object in each video frame can be obtained.
[0045] For example, for each target key point, its position in the video frame can be set to be represented by a coordinate value (x, y), and the corresponding depth value determined is represented by z. Then, for each key video segment, at least two coordinate values and at least two depth values of each target key point can be obtained. In this embodiment, the average value of the at least two coordinate values can be used as the pixel position of each target key point in each key video segment, and the average value of the at least two depth values can be used as the depth value corresponding to each target key point for each key video segment.
[0046] The target key points may be, for example, key points of the head, key points of the limbs, etc., and the target key points may be specifically set according to the type of exercise performed by the target object. For example, if the exercise in which the target object participates is a ring exercise, the target key points may be key points of the limbs of the target object, and may specifically include key points of the hands and / or key points of the feet. If the exercise in which the target object participates is a plank support, the target key points may include key points of the shoulders, key points of the hips, and key points of the feet.
[0047] In operation S230 , an index value of a static posture represented by each key video segment is determined based on the depth value and the pixel position of the target key point in each key video segment.
[0048] According to an embodiment of the present disclosure, the index value reflecting the accuracy of the static posture may include, for example, body inclination, limb extension angle, body curvature, limb curvature, etc. For example, if the index value includes limb curvature, the pixel position (x, y) of each key point of the limb in each key video clip and the corresponding depth value z may constitute the three-dimensional coordinate value (x, y, z) of each key point of the limb, and according to the three-dimensional coordinate values of two adjacent key points among the multiple key points of the limb, a vector representing the connection between the two adjacent key points is obtained, for example, at least two vectors may be obtained for each limb, and the limb curvature may be determined according to the angle between the adjacent vectors among the at least two vectors.
[0049] It can be understood that, for different static postures of different sports, the corresponding index values may be different, and the index value reflecting each static posture may be one or more, and the index value is mainly calculated based on the three-dimensional coordinate values of at least two key points.
[0050] The method of the disclosed embodiment can realize automatic and real-time evaluation of static posture, and realize rapid processing and analysis of data without relying on manual operation, by first cutting out a video clip that reflects static posture from a sports video, then determining the depth value corresponding to the key point of the target object in the video clip in combination with the depth map, and determining the index value of static posture according to the depth value and pixel position of the key point. Thus, the accuracy of evaluation can be guaranteed and the time and effort of evaluation can be reduced. It is beneficial to optimize the sports performance of the target object and optimize the strategy of sports competition.
[0051] Figure 3 It is a schematic diagram of the principle of determining the key points of a target object in a video frame according to an embodiment of the present disclosure.
[0052] According to an embodiment of the present disclosure, when detecting key points of a target object in each video frame, the interfering background may be removed from each video frame first, so as to improve the detection accuracy of the key points.
[0053] For example, the depth interval can be set in advance according to the distance between the athlete's position and the acquisition device during the exercise, and the information of pixels whose corresponding depth values in each video frame are not within the predetermined depth interval is eliminated, for example, the pixel values of these pixels are set to 0, thereby eliminating the background information.
[0054] like Figure 3 As shown, in the embodiment 300, a depth map 320 aligned with each video frame 310 included in the motion video may be determined first. For example, a depth map having the same timestamp as the video frame 310 may be used as the depth map 320. Subsequently, a target pixel having a depth value in a predetermined depth interval in the depth map 320 is determined. Subsequently, a mask process may be performed on each video frame 310 based on the position of the target pixel in the depth map 320 to obtain a masked video frame 330.
[0055] For example, a mask image 340 may be generated according to the position of the target pixel in the depth map 320 in the depth map 320. In the mask image 340, the pixel value of the pixel corresponding to the target pixel is 1, and the pixel value of the pixel corresponding to other pixels except the target pixel is 0. Subsequently, this embodiment may perform mask processing on each video frame 310 based on the mask image 340. For example, the mask image 340 may be multiplied pixel by pixel with each video frame 310 to obtain a masked video frame 330.
[0056] It is understandable that the pixel values of pixels corresponding to other pixels except the target pixel in each video frame 310 may also be directly set to 0, thereby obtaining the masked video frame 330 .
[0057] After obtaining the masked video frame 330 , key points of the target object may be detected on the masked video frame 330 , and the key points 350 obtained by the detection are used as the key points of the target object in each video frame 310 .
[0058] For example, the masked video frame 330 may be first subjected to target detection, and then the detected target object may be subjected to key point extraction, thereby obtaining the key points of the target object. For example, the key points of the target object may be obtained by detecting the skeleton key point detection model 360 from top to bottom or from bottom to top. For example, the masked video frame 330 may be input into the skeleton key point detection model 360, and the skeleton key point detection model 360 may output the pixel positions of the key points of the target object, thereby completing the detection of the key point 350.
[0059] Among them, the skeleton key point detection model 360 is a neural network model, for example, it can be the aforementioned mask-based recurrent-convolutional neural network (Mask R-CNN) model, AlphaPose model, MobilePose model, etc., and the present disclosure does not limit this.
[0060] Figure 4 It is a schematic diagram of the principle of capturing a key video clip embodying a static posture according to the first embodiment of the present disclosure.
[0061] According to an embodiment of the present disclosure, a predetermined distance condition and a comparison length (e.g., m video frames) may be set in the capture of a key video segment. Only when the distance between a key point of a target object in a certain video frame and a key point of a target object in m previous video frames satisfies the predetermined distance condition, is it determined that the certain video frame and the m previous video frames belong to the same key video segment. The m previous video frames and the certain video frame may be continuous video frames at the time of acquisition.
[0062] The predetermined distance condition may be, for example, that the distance between the key points of the target object in two video frames is less than a predetermined distance. Alternatively, the predetermined distance condition may also be that the average value of the m distances between the key point of the target object in the certain video frame and the key points of the target object in the m previous video frames is less than a predetermined distance. Alternatively, the predetermined distance condition may also be that among the m distances between the key point of the target object in the certain video frame and the key points of the target object in the m previous video frames, the proportion of the distances less than the predetermined distance is greater than the predetermined proportion, etc., and the present disclosure does not limit this.
[0063] Here, m can be determined based on a minimum duration of a static posture in a motion in which the target object participates, which is obtained in advance by statistics, and the present disclosure does not limit this.
[0064] The present disclosure can solve the problem of inaccurate key video clips captured due to the instability of the neural network model for detecting key points by setting a predetermined distance condition. By comprehensively considering the distance between a certain video frame and the key points in the m previous video frames, the influence of inaccurate key point extraction in one or more video frames caused by the instability of the neural network model can be weakened, thereby improving the accuracy of the captured key video clips. The predetermined distance can be set according to the stability and accuracy of the neural network model, which is not limited by the present disclosure.
[0065] In one embodiment, a video frame whose distance to the key points of the target object in the m previous video frames meets a predetermined condition may be set as the target video frame. Figure 4 As shown, in one embodiment 400, when capturing key video clips, the target video frame and non-target video frame in the motion video can be determined first. For example, an identifier 1 can be added to the target video frame, and an identifier 0 can be added to the non-target video frame. The target video frame can be identified in advance or in real time, and the present disclosure does not limit this. For example, for the motion video 410, the identifiers of each video frame included therein can constitute an identification segment {0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1} 420. It can be understood that the identification segment is only used as an example to facilitate understanding of the present disclosure, and the present disclosure does not limit this.
[0066] Subsequently, the embodiment can determine the non-target video segment composed of continuous non-target video frames. Among them, the number of non-target video frames in the non-target video segment is greater than or equal to n. n is a natural number greater than or equal to 2, and the value of n can be set according to actual needs. For example, n can be the number of video frames that can be collected within a duration of 0.5s, and the present disclosure does not limit this. For example, if n is set to 3, then in the motion video 410 corresponding to the identification segment 420, the eighth to eleventh video frames arranged from early to late according to the collection time can constitute a second video segment 431.
[0067] In one embodiment, the preceding video frames of the first target video frame arranged from the earliest to the latest in the motion video may also constitute a first video segment, and the first video segment may be used as a non-target video segment. Then, the motion video 410 corresponding to the identification segment 420 includes a first video segment 432 consisting of the first to third video frames arranged from the earliest to the latest in the motion video. The first video segment 432 and the second video segment 431 both belong to the non-target video segment 430.
[0068] After obtaining the non-target video segment 430, the embodiment 400 can use the video segment between two adjacent non-target video segments as a target video segment. For example, in the motion video 410 corresponding to the identification segment 420, the target video segment includes a third video segment consisting of the fourth to seventh video frames arranged from the earliest to the latest in terms of acquisition time.
[0069] In one embodiment, considering that the target object usually leaves the motion area after participating in the motion, if the video of the target object leaving the motion area is collected, the latest several video frames of the motion video can constitute a non-target video segment. If the video of the target object leaving the motion area is not collected, considering that the target object usually stays in the motion area for a certain period of time after performing the motion action, the fourth video segment between the two target videos with the largest interval after the latest non-target video segment can be used as a target video segment. For example, in the motion video 410 corresponding to the identification segment 420, the target video segment includes a video segment consisting of the fourth to seventh video frames, and a video segment consisting of the twelfth to sixteenth video frames.
[0070] After obtaining the target video segment, this embodiment can construct a key video segment for each target video segment with the target video segment and m preceding video frames of the target video segment. For example, if the value of m is 2, then in the motion video 410 corresponding to the identification segment 420, the second to seventh video frames can constitute a key video segment 441, and the ninth to sixteenth video frames can constitute a key video segment 442, and a total of two key video segments can be extracted from the motion video 410 corresponding to the identification segment 420.
[0071] Figure 5 It is a schematic diagram of the principle of capturing a key video clip embodying a static posture according to the second embodiment of the present disclosure.
[0072] According to an embodiment of the present disclosure, the above-described method can be adopted to determine whether each video frame in the motion video is a target video frame or a non-target video frame according to the identifier added to the video frame. Alternatively, it can also be determined whether each video frame is a target video frame according to the aforementioned predetermined distance condition.
[0073] like Figure 5 As shown, in an embodiment 500, after the target video frame is determined, the key video segment can be captured by traversing the video frames in the motion video.
[0074] For example, the qth video frame arranged from earliest to latest according to the acquisition time may be determined as the traversal starting point, that is, the qth video frame may be used as the first frame of the traversal 501. Then, operation S510 may be performed to traverse the video frames in the motion video. For example, q here may be the sum of the aforementioned m and 1.
[0075] Then, it can be determined whether the traversed video frame is the target video frame. If it is the target video frame, it can be determined whether the video frame is traversed for the first time. For example, operation S520 can be performed to determine whether the traversed video frame is the target video frame. If so, operation S530 is performed; otherwise, operation S560 is performed.
[0076] In operation S530, whether the traversed target video frame is the target video frame traversed for the first time, if yes, then operations S540 to S550 are performed; otherwise, only operation S550 is performed.
[0077] In operation S540, the start frame of the key video segment is recorded. For example, in response to the first traversal to the target video frame, the m video frames with the earliest acquisition time in the previous video frames of the traversed current video frame are used as the start frame of the key video segment. For example, if the current video frame is the i-th video frame, the frame number of the start frame can be recorded as Stillness strat =im.
[0078] In operation S550, the current video frame is recorded as a still frame. For example, in response to traversing to the target video frame, the traversed current video frame can be recorded as a still frame. For example, if the current video frame is the i-th video frame, the frame number of the still frame can be recorded as Stillness. now =i. After completing operation S550, for example, operation S510 may be returned to continue traversing the video frames in the motion video. It can be understood that operation S550 can be understood as a Stillness now Perform the update operation. As long as the currently traversed video frame is the target video frame, Stillness now Updated to the frame number of the current video frame.
[0079] In operation S560, the number of video frames that differ between the current video frame and the still frame is determined. For example, the number of video frames may be calculated in response to traversing to a non-target video frame. If the currently traversed video frame is the i-th video frame, the difference between the frame number of the i-th video frame and the frame number of the still frame may be calculated. outtime = (i-Stillness now ), and use the difference as the number of video frames.
[0080] After operation S560 is performed, operation S570 may be performed to determine whether the number of video frames is greater than or equal to n. If it is greater than or equal to n, operations S580 to S590 are performed, otherwise the process returns to operation S510 to continue traversing the video frames in the motion video.
[0081] In operation S580, the still frame is used as the end frame of the key video segment to obtain a key video segment. For example, operation S580 can be understood as setting a threshold value ThO, and the setting value of the threshold value ThO is equal to the value of n described above. Only when the number of consecutive frames of non-target video frames reaches the threshold value, the traversal process in the process of capturing a single key video segment is jumped out. That is, if the stillness is judged outtime ≥ThO, then the traversal process for a single key video segment is exited. At the same time, the frame number of the still frame is used as the frame number of the end frame in the key video segment currently traversed, that is, Stillness is set end =Stillness now Through the above process, we can traverse to a key video segment {Stillness start , Stillness end}, the starting frame number of the key video segment is Stillness start , the end frame number is Stillness end .
[0082] In operation S590, the traversed first frame is updated to the video frame with the earliest acquisition time among the video frames that have not been traversed. That is, after a key video segment is obtained, the traversed first frame is updated.
[0083] Through the embodiments of the present disclosure, one or more key video segments can be traversed. In order to distinguish different key video segments, for example, numbers can be assigned to the traversed key video segments in sequence according to the traversal order.
[0084] In one embodiment, after traversing to a key video segment, for example, the duration of the still posture reflected by the key video segment may be calculated. For example, the duration may be calculated in the following manner: end -Stillness start ) / f, where f is the frequency at which the acquisition device acquires video frames, and the unit of the frequency can be " / s".
[0085] The technical solution of the disclosed embodiment can effectively avoid the situation where the intercepted key video clip reflecting the static posture is inaccurate due to the instability of the neural network for detecting key points by setting m and n. It can effectively improve the accuracy of the determined key video clip, thereby facilitating the improvement of the accuracy of static posture analysis.
[0086] According to the embodiments of the present disclosure, it can be determined that the first m video frames in a motion video are all non-target video frames. Starting from the (m+1)th video frame, it is determined whether each video frame is a target video frame based on the positional relationship between each video frame and the key points of the target objects in the m previous video frames. In this way, it is possible to avoid the situation where the first m video frames are misjudged as target video frames due to insufficient reference objects.
[0087] For example, for the jth video frame after the first m video frames, the embodiment may first determine the distance between the key point of the target object in the jth video frame and the key point of the target object in the kth video frame to obtain the moving distance. Wherein, k∈[j-1, jm]. Considering that for the jth video frame, the reference object is m previous video frames, a total of m moving distances may be obtained.
[0088] In one embodiment, the average value of the m moving distances may be compared with a predetermined distance threshold. If the average value of the m moving distances is less than the predetermined distance, the jth video frame is determined to be the target video frame.
[0089] In one embodiment, the m moving distances may be compared with the distance threshold respectively. If the moving distance is greater than or equal to the distance threshold, the moving distance is determined to be the target distance. For example, the following formula (1) may be used to determine whether each of the m moving distances is the target distance.
[0090] Formula (1)
[0091] in, It is used to indicate whether the distance between the key point of the target object in the jth video frame and the key point of the target object in the kth video frame is the target distance. If it is the target distance, then The value of is 1, otherwise it is 0. is the distance threshold. is the value of the moving distance.
[0092] After determining the target distance among the m moving distances, it can be determined whether the proportion of the target distance among the m moving distances is greater than or equal to a proportion threshold. If it is greater than the proportion threshold, the jth video frame is determined to be the target video frame, otherwise, the jth video frame is determined to be a non-target video frame. For example, the following formula (2) can be used to determine whether the jth video frame is the target video frame.
[0093] Formula (2)
[0094] in, is the proportion of target distance in m moving distances. is the percentage threshold. If the judgment result of formula (2) is Greater than , that is, the judgment result is True, then the jth video frame can be determined to be the target video frame. If the judgment result of formula (2) is Less than or equal to , that is, the judgment result is False, then it can be determined that the jth video frame is a non-target video frame.
[0095] The disclosed embodiment determines whether a video frame is a target video frame by determining whether the proportion of distances greater than or equal to the target distance among the m distances between the key point in the j-th video frame and the key points in the m previous video frames is greater than a proportion threshold. This can avoid the situation where a static posture is not detected due to a large average value of the m distances caused by a large detection deviation of a neural network for detecting key points for a certain video frame. This can improve the accuracy of the captured key video clips.
[0096] In one embodiment, when there are multiple key points of the target object, the embodiment may first calculate multiple pixel distances between the pixel positions of multiple key points in the jth video frame and the pixel positions of multiple key points corresponding one to one in a previous video frame. The aforementioned moving distance is determined according to the average value of the multiple pixel distances or the sum of the multiple pixel distances. Specifically, the pixel distance between the pixel position of each key point in the jth video frame and the pixel position of each key point in the kth video frame may be determined for each key point of the target object as the distance for each key point. Subsequently, the moving distance is determined based on the distances for the multiple key points.
[0097] For example, assuming that the number of key points of the target object is L, the moving distance between the key point of the target object in the jth video frame and the key point of the target object in the kth video frame can be calculated using the following formula (3).
[0098] Formula (3)
[0099] in, is the value of the moving distance. is the pixel position of the lth key point of the target object in the jth video frame. is the pixel position of the lth key point of the target object in the kth video frame.
[0100] Figure 6 It is a schematic diagram of the principle of determining the depth value corresponding to the target key point according to an embodiment of the present disclosure.
[0101] like Figure 6As shown, in an embodiment 600, when determining the depth value corresponding to the target key point in each key video segment, the pixel position of the target key point 601 in each of the at least two video frames 611 included in each key video segment 610 may be determined first, to obtain at least two pixel positions 620. Subsequently, an average position 630 of the at least two pixel positions is determined. Subsequently, the depth value of the pixel corresponding to the average position 630 in at least two depth maps 641 corresponding to the at least two video frames 611 is determined, to obtain at least two depth values 650. Subsequently, the average value of the at least two depth values 650 is determined as the depth value 660 corresponding to the target key point.
[0102] For example, if the number of at least two video frames 611 is 3, then for the target key point 601, the at least two pixel positions obtained may include, for example, pixel positions (x1, y1), (x2, y2), and (x3, y3). Correspondingly, the at least two depth values 650 obtained may include depth values z1, z2, and z3.
[0103] According to the technical solution for determining the depth value of this embodiment, the depth value is obtained based on the average position after the average position of the target key point in the key video segment is determined. Therefore, the defect of insufficient accuracy of two-dimensional key point detection caused by the instability of the neural network can be compensated, thereby improving the accuracy of the obtained depth value.
[0104] It is understandable that, considering that the target object is stationary in the key video clip, it can be considered that the depth values corresponding to the target key point in the at least two depth maps corresponding to the at least two video frames are the same value. Therefore, in one embodiment, any one of the at least two depth values can also be used as the depth value corresponding to the target key point.
[0105] In one embodiment, the static posture of the target object can be embodied by, for example, the symmetrical limbs of the target object. For example, for weightlifting, the snatch state can be determined according to the bending angles of the two upper limbs, etc. For example, for the bending posture in gymnastics, the bending angle can be determined according to the direction of the vector connecting the center points of the two upper limbs and the center points of the two lower limbs.
[0106] For example, the target key points may include limb key points of the target object. Limb key points may include, for example, hand key points, foot key points, elbow key points, wrist key points, etc. The target object includes at least one pair of limbs distributed symmetrically. When determining the index value of the static posture embodied by each key video clip, the three-dimensional coordinates of the center point of each pair of limbs may be determined for each key video clip according to the depth value and pixel position of the key points of each pair of limbs. Among them, for each key video clip, the pixel position of the key point of the limb may be the average position of the pixel position of the aforementioned key point in at least two video frames, and the depth value may be the depth value determined in the manner described above. The depth value may constitute a three-dimensional coordinate with the pixel position. In this embodiment, the average value of the three-dimensional coordinate values of the two corresponding key points of each pair of limbs may be used as the three-dimensional coordinate of the center point of each pair of limbs. For example, if the corresponding key points of each pair of limbs are multiple pairs of key points, the obtained three-dimensional coordinates of the center point of each pair of limbs may be multiple three-dimensional coordinates.
[0107] Subsequently, the embodiment may determine the index value of the static posture based on the three-dimensional position of the center point of at least one pair of limbs determined for each video frame segment. For example, if multiple three-dimensional positions are obtained, the multiple three-dimensional positions may be connected in sequence, and the index value of the static posture may be determined based on the angle of the connecting line relative to a fixed plane.
[0108] For example, if the limbs include the upper left limb and the upper right limb, the target key points of each limb include the key points of the hand, the key points of the wrist, the key points of the elbow, and the key points of the shoulder. There are four center points obtained, and the corresponding three-dimensional coordinates are four. This embodiment can connect the four center points in sequence to obtain three vectors, and determine whether the postures of the upper left limb and the upper right limb in the static posture are symmetrical according to the angles between the three vectors. If they are symmetrical, the index value can be 1, otherwise the index value can be 0.
[0109] Figure 7 It is a schematic diagram of the principle of determining the body tilt angle of the target object according to an embodiment of the present disclosure.
[0110] In one embodiment, the static posture index value may include a body tilt angle of the target object, which may be determined, for example, based on an angle between a line between a hand center point and a foot center point and a vertical plane.
[0111] like Figure 7 As shown, in this embodiment 700, the limbs of the target object 710 include at least two pairs of limbs. The two pairs of limbs include a pair of upper limbs and a pair of lower limbs. The target key points include a key point 711 of the left upper limb, a key point 712 of the right upper limb, a key point 713 of the left lower limb, and a key point 714 of the right lower limb.
[0112] For example, taking the key points of the upper limbs as the hand key points and the key points of the lower limbs as the foot key points, the embodiment 700 can determine the center points of the two pairs of limbs for each key video clip, and obtain the center point 721 of the two hand key points and the center point 722 of the two foot key points. The embodiment can determine the vector representing the line connecting the two center points based on the two three-dimensional positions of the two center points 721 and 722. For example, if the three-dimensional position of the center point 721 is represented by the coordinates (x h ,y h , z h ) indicates that the three-dimensional position of the center point 722 is represented by the coordinates (x f ,y f , z f ), then the vector 730 connecting the two center points can be expressed as =(x f -x h ,y f -y h , z f -z h ). Subsequently, the embodiment may determine the body tilt angle of the target object in the static posture embodied in each key video clip based on the vector 730.
[0113] For example, the angle between the vector 730 and the vertical plane can be used as the body inclination angle.
[0114] In one embodiment, the vector 730 may be normalized, and the body inclination angle may be determined based on the value of the normalized ordinate. Figure 7 As shown in FIG. 1 , if the value of the normalized vertical coordinate is y_norm, the body inclination angle a can be calculated using the following formula (4).
[0115] a=acos(y_norm) formula (4)
[0116] For example, if for the pth key video clip, the three-dimensional coordinates of the key points of the left hand are , the three-dimensional coordinates of the key points on the right hand are , the three-dimensional coordinates of the key points of the left foot are , the three-dimensional coordinates of the key points of the right foot are , the body inclination a can be calculated using the following formula (5).
[0117] Formula (5)
[0118] Understandably, Figure 7The embodiments in the figure are only used as examples to facilitate understanding of the present disclosure. According to actual needs, the limbs included in the target object can be three or more pairs, and the key points of each pair of limbs can include multiple pairs of key points. When calculating the body inclination angle, the angle between the line between each two adjacent center points and a fixed plane can be calculated to obtain multiple angle values. The multiple angle values can all be used as index values of the static posture. It can be understood that the target key points of each limb can be selected according to actual needs, and the present disclosure does not limit this.
[0119] In one embodiment, the index value of the static posture may include, for example, the forward and backward deviation of the body of the target object in time when participating in the movement, referred to as body deviation for short.
[0120] For example, the target key points of the target object may include key points of at least one pair of limbs. The target key points of each limb in each pair of limbs may be one or more. For example, the target key points may include left hand key points and right hand key points. This embodiment may determine the three-dimensional position of the center point of the hand in the manner described above for each target video clip, for example, the center point of the left hand key points and the right hand key points may be determined to obtain the three-dimensional position of the center point. Subsequently, this embodiment may calculate the average three-dimensional position of the three-dimensional positions determined for at least one target video clip as the average three-dimensional position of the hand. Subsequently, the body deviation of the static posture embodied in each target video clip may be determined based on the difference between the average three-dimensional position and the three-dimensional position determined for each target video clip.
[0121] In one embodiment, only the body deviation in the depth direction may be considered. For example, assuming that the number of target video clips obtained is N, for the pth target video clip, the three-dimensional coordinates of the key points of the left hand are , the three-dimensional coordinates of the key points on the right hand are , then this embodiment can use formula (6) to determine the body deviation D of the static posture reflected by the p-th target video clip.
[0122] Formula (6)
[0123] in, , is the depth value of the key points of the left hand and the right hand in the pth target video clip, , is the depth value of the key points of the left hand and the right hand in the i-th target video clip.
[0124] It is understandable that the above formula (6) is only used as an example to facilitate the understanding of the present disclosure, and the present disclosure does not limit this. The above-mentioned embodiment in which the target key points include left hand key points and right hand key points is only used as an example to facilitate the understanding of the present disclosure. According to actual needs, the target key points can also be left foot key points and right foot key points, left elbow key points and right elbow key points, etc. In the case where there are multiple pairs of target key points, this embodiment can obtain a body deviation based on each pair of key points, and use multiple body deviations as index values of static posture. The maximum value of the multiple body deviations obtained can also be used as an index value, and the present disclosure does not limit this.
[0125] For example, through the embodiments of the present disclosure, in the rings movement, the index values obtained may include the body inclination angle and the body deviation. In one embodiment, the duration of the aforementioned static posture may also be output as an index value. In one embodiment, the starting time point of the static posture (relative to the starting frame of the motion video, the time point of the first frame of the target video segment) may also be output as an index value. It is understandable that for different sports, specific index values can be set and selected according to actual needs, and the present disclosure does not limit this.
[0126] Based on the static posture detection method provided by the present disclosure, accurate posture analysis can be provided for coaches and athletes, which is conducive to improving training efficiency, facilitating athletes to more quickly identify and correct posture errors, and accelerating the improvement of skills. Furthermore, through the method provided by the present disclosure, accurate posture analysis can be achieved, which is convenient for athletes to refine the control of each static posture and high-precision posture, and is conducive to improving the overall quality and performance of the action. The method disclosed in the present disclosure can promote the application of advanced technology in sports and promote the innovation and development of sports training methods.
[0127] Based on the posture detection method provided by the present disclosure, the present disclosure also provides a posture detection device. Figure 8 The device is described in detail.
[0128] Figure 8 It is a structural block diagram of a posture detection device according to an embodiment of the present disclosure.
[0129] like Figure 8 As shown, the posture detection device 800 of this embodiment may include a segment interception module 810 , a depth value determination module 820 and an index value determination module 830 .
[0130] The segment interception module 810 is used to intercept at least one key video segment that reflects the static posture of the target object from the motion video based on the key points of the target object in each video frame included in the motion video. Each key video segment reflects a static posture. In one embodiment, the segment interception module 810 can be used to perform the operation S210 described above, which will not be repeated again.
[0131] The depth value determination module 820 is used to determine, for each key video segment, a depth value corresponding to a target key point based on a depth map corresponding to each key video segment and a target key point of a target object in each key video segment. In one embodiment, the depth value determination module 820 can be used to perform operation S220 described above, which will not be described in detail again.
[0132] The index value determination module 830 is used to determine the index value of the static posture embodied in each key video segment based on the depth value and the pixel position of the target key point in each key video segment. In one embodiment, the index value determination module 830 can be used to perform the operation S230 described above, which will not be repeated again.
[0133] According to an embodiment of the present disclosure, the above-mentioned posture detection device 800 may also include a target pixel determination module, a mask processing module and a key point detection module. The target pixel determination module is used to determine, for each video frame included in the motion video, a target pixel whose depth value is located in a predetermined depth interval in a depth map aligned with each video frame. The mask processing module is used to perform mask processing on each video frame based on the position of the target pixel in the depth map to obtain a masked video frame. The key point detection module is used to detect the key points of the target object in the masked video frame to obtain the key points of the target object in each video frame.
[0134] According to an embodiment of the present disclosure, the above-mentioned depth value determination module 820 may include an average position determination submodule, a first depth value determination submodule, and a second depth value determination submodule. The average position determination submodule is used to determine the average position of at least two pixel positions based on at least two pixel positions of the target key point in at least two video frames included in each key video clip. The first depth value determination submodule is used to determine the depth value of the pixel corresponding to the average position in at least two depth maps corresponding to at least two video frames included in each key video clip, and obtain at least two depth values. The second depth value determination submodule is used to determine the average value of at least two depth values as the depth value corresponding to the target key point.
[0135] According to an embodiment of the present disclosure, the above-mentioned segment interception module 810 may include a target frame determination submodule, a target segment determination submodule and a key segment determination submodule. The target frame determination submodule is used to determine the target video frame in the motion video; the distance between the key point of the target object in the target video frame and the key point of the target object in the m previous video frames meets a predetermined condition. The target segment determination submodule is used to determine the target video segment between two adjacent non-target video segments in the motion video; the non-target video segment includes a first video segment and a second video segment, and the number of non-target video frames included in the second video segment is greater than or equal to n. The key segment determination submodule is used to determine, for each target video segment, a key video segment consisting of the target video segment and the n previous video frames of the target video segment. Wherein, m and n are both natural numbers greater than or equal to 2; the first video segment is composed of the previous video frames of the first target video frame arranged from early to late according to the acquisition time in the motion video, and the second video segment is composed of all non-target video frames between the two target video frames.
[0136] According to an embodiment of the present disclosure, the above-mentioned segment interception module 810 may include a traversal submodule, a first recording submodule, a second recording submodule, a frame number determination submodule, a segment acquisition submodule and a first frame update submodule. The traversal submodule is used to traverse the video frames in the motion video with the qth video frame arranged from earliest to latest according to the acquisition time as the first frame of the traversal; the value of q is the sum of m and 1, and m is a natural number greater than or equal to 2. The first recording submodule is used to record the m video frames with the earliest acquisition time in the previous video frames of the current video frame as the starting frames of the key video segment in response to the first traversal to the target video frame; the distance between the key point of the target object in the target video frame and the key point of the target object in the m previous video frames meets a predetermined condition. The second recording submodule is used to record the current video frame as a still frame in response to the traversal to the target video frame. The frame number determination submodule is used to determine the number of video frames that differ between the current video frame and the still frame in response to the traversal to the non-target video frame. The segment acquisition submodule is used to obtain a key video segment by taking a still frame as the end frame of the key video segment in response to the number of video frames being greater than or equal to n, where n is a natural number greater than or equal to 2. The first frame update submodule is used to update the first frame to the earliest video frame collected in the untraversed video frames in response to obtaining a key video segment.
[0137] According to an embodiment of the present disclosure, the above-mentioned target segment determination submodule may include a key point distance determination unit, a target distance determination unit and a target frame determination unit. The key point distance determination unit is used to determine the distance between the key point of the target object in the jth video frame and the key point of the target object in the kth video frame for the jth video frame arranged from early to late according to the acquisition time in the motion video, and obtain the moving distance; k∈[j-1, jm], j≥m+1. The target distance determination unit is used to determine the target distance greater than or equal to the distance threshold among the m moving distances. The target frame determination unit is used to determine the jth video frame as the target video frame in response to the proportion of the target distance in the m moving distances being greater than the proportion threshold.
[0138] According to an embodiment of the present disclosure, there are multiple key points of the target object. The key point distance determination unit may include a first determination subunit and a second determination subunit. The first determination subunit is used to determine, for each key point of the target object, a pixel distance between a pixel position of each key point in the jth video frame and a pixel position of each key point in the kth video frame as a distance for each key point. The second determination subunit is used to determine a moving distance based on the distances for multiple key points.
[0139] According to an embodiment of the present disclosure, the target key points include limb key points of the target object; the limbs of the target object include at least one pair of limbs that are symmetrically distributed. The index value determination module 830 may include a center point determination submodule and an index determination submodule. The center point determination submodule is used to determine the three-dimensional position of the center point of each pair of limbs for each key video clip based on the depth value and pixel position of the key point of each pair of limbs. The index determination submodule is used to determine the index value of the static posture embodied in each key video clip based on the three-dimensional position of the center point of at least one pair of limbs determined for at least one key video clip.
[0140] According to an embodiment of the present disclosure, the limbs of the target object include at least two pairs of limbs. The above-mentioned indicator determination submodule may include a connection line determination unit and an angle determination unit. The connection line determination unit is used to determine the vector representing the connection line of the center points of at least two pairs of limbs based on at least two three-dimensional positions of the center points of at least two pairs of limbs determined for each key video clip. The angle determination unit is used to determine the body tilt angle of the target object in the static posture embodied in each key video clip based on the vector.
[0141] According to an embodiment of the present disclosure, the limbs of the target object include a pair of limbs. The above-mentioned indicator determination submodule may include an average position determination unit and a deviation determination unit. The average position determination unit is used to determine the average three-dimensional position of the pair of limbs for at least one key video segment based on at least one three-dimensional position of the center point of the pair of limbs determined for at least one key video segment. The deviation determination unit is used to determine the body deviation of the static posture embodied in each key video segment based on the difference between the average three-dimensional position and the three-dimensional position of the center point of the pair of limbs determined for each key video segment.
[0142] According to an embodiment of the present disclosure, the sports video is a video shot when the target object participates in any of the following sports: rings exercise, horizontal bar exercise, weightlifting exercise, plank exercise.
[0143] It should be noted that the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals. In the technical solution of this disclosure, the user's authorization or consent is obtained before obtaining or collecting user personal information.
[0144] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0145] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement the gesture detection method of an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0146] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0147] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0148] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the gesture detection method. For example, in some embodiments, the gesture detection method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the gesture detection method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the gesture detection method in any other appropriate manner (e.g., by means of firmware).
[0149] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0150] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0151] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0152] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0153] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0154] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. Among them, the server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0155] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0156] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A posture detection method, comprising: Based on key points of the target object in each video frame included in the motion video, extracting at least one key video clip reflecting a static posture of the target object from the motion video; each key video clip reflects a static posture; For each key video segment, based on the depth map corresponding to each key video segment and the target key point of the target object in each key video segment, determining a depth value corresponding to the target key point; as well as Based on the depth value and the pixel position of the target key point in each key video segment, an index value of the static posture embodied by each key video segment is determined.
2. The method according to claim 1, further comprising: For each video frame included in the motion video, determining a target pixel whose depth value is located in a predetermined depth range in a depth map aligned with each video frame; as well as Based on the position of the target pixel in the depth map, masking is performed on each of the video frames to obtain a masked video frame; as well as The key points of the target object in the masked video frame are detected to obtain the key points of the target object in each video frame.
3. The method according to claim 1 or 2, wherein: Determining the depth value corresponding to the target key point includes: Determine an average position of the at least two pixel positions of the target key point in the at least two video frames included in each key video segment based on the at least two pixel positions of the target key point in the at least two video frames included in each key video segment; Determine the depth value of the pixel corresponding to the average position in at least two depth maps corresponding to at least two video frames included in each key video segment, to obtain at least two depth values; and An average value of the at least two depth values is determined as a depth value corresponding to the target key point.
4. The method according to claim 1, wherein: Extracting at least one key video clip reflecting the static posture of the target object from the motion video comprises: Determine a target video frame in the motion video; the distance between the key point of the target object in the target video frame and the key points of the target object in m previous video frames meets a predetermined condition; Determine a target video segment between two adjacent non-target video segments in the motion video; the non-target video segments include a first video segment and a second video segment, and the number of non-target video frames included in the second video segment is greater than or equal to n; and For each target video segment, a key video segment consisting of the target video segment and m preceding video frames of the target video segment is determined. Among them, m and n are both natural numbers greater than or equal to 2; the first video segment is composed of the preceding video frame of the first target video frame in the motion video arranged from early to late according to the acquisition time, and the second video segment is composed of all non-target video frames between two target video frames.
5. The method according to claim 1, wherein: Extracting at least one key video clip reflecting the static posture of the target object from the motion video comprises: Taking the qth video frame arranged from earliest to latest according to the acquisition time as the first frame to be traversed, the video frames in the motion video are traversed; the value of q is the sum of m and 1, and m is a natural number greater than or equal to 2; In response to the first traversal to the target video frame, the m video frames with the earliest acquisition time in the previous video frames of the current video frame are recorded as the starting frames of the key video segment; the distance between the key point of the target object in the target video frame and the key points of the target object in the m previous video frames meets a predetermined condition; In response to traversing to the target video frame, recording the current video frame as a still frame; In response to traversing to the non-target video frame, determining the number of video frames that differ between the current video frame and the static frame; In response to the number of video frames being greater than or equal to n, taking the still frame as the end frame of the key video segment to obtain a key video segment; n is a natural number greater than or equal to 2; and In response to obtaining a key video segment, the first frame is updated to be the video frame with the earliest acquisition time among the video frames that have not been traversed.
6. The method according to claim 4, wherein: Determining the target video frame in the motion video comprises: For the j-th video frame arranged from earliest to latest according to the acquisition time in the motion video, determine the distance between the key point of the target object in the j-th video frame and the key point of the target object in the k-th video frame to obtain the moving distance; k∈[j-1,jm], j≥m+1; Determine a target distance among the m moving distances that is greater than or equal to a distance threshold; and In response to the proportion of the target distance in the m moving distances being greater than a proportion threshold, the j-th video frame is determined to be the target video frame.
7. The method according to claim 6, wherein: There are multiple key points of the target object; determining the distance between the key point of the target object in the jth video frame and the key point of the target object in the kth video frame includes: For each key point of the target object, determining a pixel distance between a pixel position of each key point in the j-th video frame and a pixel position of each key point in the k-th video frame as a distance for each key point; and The moving distance is determined based on distances for a plurality of key points.
8. The method according to claim 1, wherein: The target key points include limb key points of the target object; The limbs of the target object include at least one pair of limbs that are symmetrically distributed; Determining the index value of the static posture embodied by each key video clip includes: For each key video clip, determining the three-dimensional position of the center point of each pair of limbs according to the depth value and pixel position of the key point of each pair of limbs; as well as Based on the three-dimensional position of the center point of at least one pair of limbs determined for at least one key video segment, an index value of the static posture embodied by each key video segment is determined.
9. The method according to claim 8, wherein: The limbs of the target object include at least two pairs of limbs; and the index value for determining the static posture embodied by each key video clip includes: Determining a vector representing a line connecting the center points of the at least two pairs of limbs based on at least two three-dimensional positions of the center points of the at least two pairs of limbs determined for each key video segment; and Based on the vector, a body tilt angle of the target object in the static posture represented by each key video segment is determined.
10. The method according to claim 8, wherein: The limbs of the target object include a pair of limbs; and the index value for determining the static posture embodied by each key video clip includes: Determining an average three-dimensional position of the pair of limbs for at least one key video segment based on at least one three-dimensional position of center points of the pair of limbs determined for at least one key video segment; and Based on the difference between the average three-dimensional position and the three-dimensional position of the center points of the pair of limbs determined for each key video segment, a body deviation of the static posture represented by each key video segment is determined.
11. The method according to claim 1, wherein: The sports video is a video shot when the target object participates in any of the following sports: rings exercise, horizontal bar exercise, weightlifting exercise, and plank exercise.
12. A posture detection device, comprising: A segment capture module, configured to capture at least one key video segment reflecting a static posture of the target object from the motion video based on key points of the target object in each video frame included in the motion video; each key video segment reflects a static posture; A depth value determination module, configured to determine, for each key video segment, a depth value corresponding to the target key point based on a depth map corresponding to each key video segment and a target key point of the target object in each key video segment; as well as The index value determination module is used to determine the index value of the static posture embodied by each key video segment based on the depth value and the pixel position of the target key point in each key video segment.
13. The apparatus according to claim 12, further comprising: A target pixel determination module, configured to determine, for each video frame included in the motion video, a target pixel whose depth value is within a predetermined depth interval in a depth map aligned with each video frame; A mask processing module, configured to perform mask processing on each video frame based on the position of the target pixel in the depth map to obtain a masked video frame; as well as The key point detection module is used to detect the key points of the target object in the masked video frame to obtain the key points of the target object in each video frame.
14. The device according to claim 12 or 13, wherein: The depth value determination module comprises: an average position determination submodule, configured to determine an average position of at least two pixel positions of the target key point in at least two video frames included in each key video segment based on the at least two pixel positions of the target key point; A first depth value determination submodule is configured to determine the depth value of the pixel corresponding to the average position in at least two depth maps corresponding to at least two video frames included in each key video segment, to obtain at least two depth values; and The second depth value determination submodule is configured to determine an average value of the at least two depth values as a depth value corresponding to the target key point.
15. The device according to claim 12, wherein: The fragment interception module comprises: A target frame determination submodule is used to determine a target video frame in the motion video; the distance between the key point of the target object in the target video frame and the key points of the target object in m previous video frames meets a predetermined condition; a target segment determination submodule, configured to determine a target video segment between two adjacent non-target video segments in the motion video; the non-target video segments include a first video segment and a second video segment, and the number of non-target video frames included in the second video segment is greater than or equal to n; and The key segment determination submodule is used to determine, for each target video segment, a key video segment consisting of the target video segment and n previous video frames of the target video segment. Among them, m and n are both natural numbers greater than or equal to 2; the first video segment is composed of the preceding video frame of the first target video frame in the motion video arranged from early to late according to the acquisition time, and the second video segment is composed of all non-target video frames between two target video frames.
16. The device according to claim 12, wherein: The fragment interception module comprises: A traversal submodule, used for traversing the video frames in the motion video, taking the qth video frame arranged from earliest to latest according to the acquisition time as the first frame to be traversed; the value of q is the sum of m and 1, and m is a natural number greater than or equal to 2; A first recording submodule is used for recording, in response to the first traversal to the target video frame, the m video frames with the earliest acquisition time in the previous video frames of the current video frame as the starting frames of the key video segment; the distance between the key point of the target object in the target video frame and the key points of the target object in the m previous video frames meets a predetermined condition; A second recording submodule, configured to record the current video frame as a still frame in response to traversing to the target video frame; A frame number determination submodule, configured to determine the number of video frames that differ between a current video frame and the static frame in response to traversing to the non-target video frame; a segment obtaining submodule, configured to obtain a key video segment by taking the still frame as the end frame of the key video segment in response to the number of video frames being greater than or equal to n; n being a natural number greater than or equal to 2; and The first frame updating submodule is used to update the first frame to the earliest video frame collected among the untraversed video frames in response to obtaining a key video segment.
17. The device according to claim 15, wherein: The target segment determination submodule includes: A key point distance determination unit is used to determine the distance between the key point of the target object in the jth video frame and the key point of the target object in the kth video frame for the jth video frame arranged from early to late according to the acquisition time in the motion video, and obtain the moving distance; k∈[j-1,jm], j≥m+1; a target distance determining unit, configured to determine a target distance among the m moving distances that is greater than or equal to a distance threshold; and The target frame determination unit is configured to determine the j-th video frame as the target video frame in response to a proportion of the target distance in the m moving distances being greater than a proportion threshold.
18. The device according to claim 17, wherein: There are multiple key points of the target object; The key point distance determination unit comprises: A first determining subunit is used to determine, for each key point of the target object, a pixel distance between a pixel position of each key point in the j-th video frame and a pixel position of each key point in the k-th video frame as a distance for each key point; as well as The second determining subunit is used to determine the moving distance based on distances to a plurality of key points.
19. The device according to claim 12, wherein: The target key points include limb key points of the target object; The limbs of the target object include at least one pair of limbs that are symmetrically distributed; The indicator value determination module includes: A center point determination submodule, for determining the three-dimensional position of the center point of each pair of limbs according to the depth value and pixel position of the key point of each pair of limbs for each key video segment; The index determination submodule is used to determine the index value of the static posture embodied by each key video segment based on the three-dimensional position of the center point of at least one pair of limbs determined for at least one key video segment.
20. The device according to claim 19, wherein The limbs of the target object include at least two pairs of limbs; The indicator determination submodule includes: a connection line determination unit, configured to determine a vector representing a connection line of center points of the at least two pairs of limbs based on at least two three-dimensional positions of center points of the at least two pairs of limbs determined for each key video segment; as well as The angle determination unit is used to determine the body tilt angle of the target object in the static posture embodied by each key video clip based on the vector.
21. The device according to claim 19, wherein The limbs of the target object include a pair of limbs; the indicator determination submodule includes: an average position determination unit, configured to determine an average three-dimensional position of the pair of limbs for at least one key video segment based on at least one three-dimensional position of the center points of the pair of limbs determined for at least one key video segment; and The deviation determining unit is used to determine the body deviation of the static posture embodied in each key video segment based on the difference between the average three-dimensional position and the three-dimensional position of the center point of the pair of limbs determined for each key video segment.
22. The device according to claim 12, wherein: The sports video is a video shot when the target object participates in any of the following sports: rings exercise, horizontal bar exercise, weightlifting exercise, and plank exercise.
23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any one of claims 1 to 11.
24. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 11.
25. A computer program product, comprising a computer program / instruction, wherein the computer program / instruction is stored on at least one of a readable storage medium and an electronic device, and when the computer program / instruction is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
