Motion interaction method, device, electronic device and storage medium
By performing skeleton point detection and motion parameter recognition on the target user's motion images, the robot is able to realize real-time recognition and interaction of multiple motion types, solving the problems of single human-computer interaction and lack of motion interaction in the existing technology, and improving user experience. experience and recognition accuracy.
Patent Information
- Application Number
- CN202311182970.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-09-13
AI Technical Summary
Existing robots have a single human-computer interaction scenario and can only execute basic voice commands. They lack rich interactive scenarios. In the field of robots, there is no solution for real-time human movement interaction, which cannot stimulate users' desire to exercise.
By acquiring the target user's motion image, performing skeletal point detection, determining the position information of the preset skeletal points, identifying the target motion and motion parameters, and realizing real-time recognition and interaction of multiple motion types.
It realizes the distinction and recognition of multiple types of motion, improves the user experience, enhances the richness and interest of human-computer interaction, and can interact in real time based on the user's moving images, reducing the recognition error rate and improving the accuracy of motion recognition. Accuracy.
Smart Images

Figure CN117193534B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer vision technology, and in particular to a motion interaction method, device, electronic device, and storage medium. Background Art
[0002] As an important carrier of artificial intelligence, robots have brought many changes to people's lives and will also play an important role in future families. Based on voice interaction technology, users can control robots through voice.
[0003] Existing robots offer limited human-robot interaction scenarios, limited to executing basic voice commands and lacking a richer range of interactive scenarios. Health monitoring applications based on smart devices are currently attracting widespread attention, and motion-based counting can stimulate people's desire to exercise. However, there are currently no solutions in the robotics field for real-time human motion interaction. Summary of the Invention
[0004] To overcome the problems existing in the related art, the present disclosure provides a motion interaction method, device, electronic device and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a motion interaction method is provided, comprising:
[0006] Obtain at least one frame of current motion image of the target user;
[0007] Performing skeleton point detection on the motion image to determine position information of a plurality of preset skeleton points of the target user in the motion image;
[0008] determining, based on position information of the plurality of preset skeleton points in the motion image, a target motion currently being performed by the target user and motion parameters of the target motion, wherein the motion parameters represent a completion status of the target motion;
[0009] Perform motion interaction according to the motion parameters.
[0010] Optionally, determining the target motion currently being performed by the target user according to the position information of the plurality of preset skeleton points in the motion image includes:
[0011] Get multiple preset skeleton point sets, different preset skeleton point sets correspond to different motion types;
[0012] For each of the preset skeleton point sets, determining the position information of each preset skeleton point in the preset skeleton point set according to the position information of a plurality of the preset skeleton points in the motion image;
[0013] The target motion is determined according to the position information of each preset skeleton point in the preset skeleton point set.
[0014] Optionally, the motion parameters include state parameters corresponding to a plurality of preset actions of the target motion, the state parameters representing whether the corresponding preset actions are completed;
[0015] Determining the motion parameters of the target motion according to the position information of the plurality of preset skeleton points in the motion image includes:
[0016] Obtaining preset action completion conditions corresponding to a plurality of preset actions of the target motion;
[0017] Each frame of the motion image is traversed in sequence, and for the currently traversed target motion image, the state parameters corresponding to each preset action are determined according to the position information of multiple preset skeleton points in the target motion image and the preset action completion conditions corresponding to multiple preset actions.
[0018] Optionally, the preset action completion condition includes an angle range of a first angle being within a preset angle range, different preset actions correspond to different preset angle ranges, and the first angle is an angle formed by lines connecting the first skeletal points corresponding to the target motion;
[0019] The determining, based on the position information of the plurality of preset skeleton points in the target motion image and the preset action completion conditions corresponding to the plurality of preset actions, the state parameter corresponding to each preset action comprises:
[0020] determining a current angle of the first angle according to position information of a plurality of the preset skeleton points in the target motion image;
[0021] Determine a target angle range within which the current angle lies;
[0022] The state parameter corresponding to each preset action is determined according to the target angle range and the preset angle range corresponding to each preset action.
[0023] Optionally, performing motion interaction according to the motion parameters includes:
[0024] determining, based on the movement parameters, a completion status of the target movement by the target user, wherein the completion status is used to indicate whether the target user has completed the target movement once;
[0025] Perform motion interaction based on the completion.
[0026] Optionally, determining, according to the motion parameters, the completion status of the target motion by the target user includes:
[0027] Acquire a preset state parameter set corresponding to the target movement, where the preset state parameter set is used to record at least one target state parameter representing when the target user completes the target movement once;
[0028] The completion status of the target movement by the target user is determined according to the state parameters corresponding to each preset action and the preset state parameter set.
[0029] Optionally, performing motion interaction according to the completion status includes:
[0030] When it is determined according to the completion status that the target user has completed the target exercise once, updating the exercise count of the target exercise;
[0031] The updated motion count is output to the target user.
[0032] Optionally, performing motion interaction according to the completion status includes:
[0033] When it is determined according to the completion status that the target user has completed the target exercise once, obtaining a completion time when the target user completes the target exercise;
[0034] determining a movement timing of the target movement according to the completion time and a start time of the target movement set by the target user;
[0035] The exercise timing is output to the target user.
[0036] Optionally, performing motion interaction according to the completion status includes:
[0037] When it is determined according to the completion status that the target user has completed the target exercise once, executing a preset reward operation;
[0038] When it is determined based on the completion status that the target user has not reached the target exercise standard, a preset prompt message is output.
[0039] Optionally, the preset reward operation includes playing target multimedia information and / or controlling the target bionic robot to repeat the target movement.
[0040] Optionally, the method further includes:
[0041] Upon receiving a user instruction, the motion recognition function is enabled;
[0042] The acquiring of at least one frame of current motion image of the target user comprises:
[0043] After the motion recognition function is enabled, at least one frame of the current motion image of the target user is obtained.
[0044] According to a second aspect of an embodiment of the present disclosure, a motion interaction device is provided, comprising:
[0045] An acquisition module is configured to acquire at least one frame of a current motion image of a target user;
[0046] a skeleton point detection module configured to perform skeleton point detection on the motion image and determine position information of a plurality of preset skeleton points of the target user in the motion image;
[0047] a motion recognition module configured to determine the target motion currently being performed by the target user and motion parameters of the target motion based on position information of the plurality of preset skeleton points in the motion image, wherein the motion parameters represent a completion status of the target motion;
[0048] The interaction module is configured to perform motion interaction according to the motion parameters.
[0049] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0050] processor;
[0051] a memory for storing processor-executable instructions;
[0052] The processor is configured to execute the steps of the method described in the first aspect of the present disclosure.
[0053] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the motion interaction method provided in the first aspect of the present disclosure are implemented.
[0054] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: first, skeleton point detection is performed based on the motion image of the target user to obtain the position information of multiple preset skeleton points of the target user, and then based on the position information of the preset skeleton points, the target motion currently being performed by the target user is identified, and the motion parameters of the target motion are further determined, so that motion interaction with the target user can be performed based on the motion parameters. In this way, compared with the related art that can only identify and count a pre-set motion type, the present application does not need to set the motion type to be identified in advance, and can perform real-time identification of the type and completion status of the currently ongoing target motion based on the user's motion image, thereby realizing the distinction and identification of multiple motion types and improving the user experience.
[0055] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0057] Figure 1 The figure is a flow chart showing a motion interaction method according to an exemplary embodiment.
[0058] Figure 2 is based on Figure 1 The illustrated embodiment shows a flow chart of a motion interaction method.
[0059] Figure 3 is based on Figure 1 The illustrated embodiment shows a flow chart of a motion interaction method.
[0060] Figure 4 is a schematic diagram of a first angle corresponding to a squat according to an exemplary embodiment.
[0061] Figure 5 The figure is a flow chart showing a motion interaction method according to an exemplary embodiment.
[0062] Figure 6 It is a block diagram of a motion interaction device according to an exemplary embodiment.
[0063] Figure 7 It is a block diagram of an electronic device for motion interaction according to an exemplary embodiment. DETAILED DESCRIPTION
[0064] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0065] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the corresponding data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0066] The present disclosure is primarily applicable to scenarios where a user's target movements are identified. These target movements can include, for example, squats, high leg raises, push-ups, sit-ups, jumping jacks, planks, and other exercise types. In practical scenarios, target movement identification and counting can be achieved by launching a sports application on a terminal, and interaction with the user can be achieved based on the identification results.
[0067] Related technologies primarily rely on deep learning to achieve end-to-end motion counting. However, this approach suffers from low recognition accuracy and cannot accurately count the user's target motion. Furthermore, existing motion interaction methods can only recognize a single type of motion, failing to distinguish and identify multiple motion types, and lack a user-computer interaction experience.
[0068] In addition, robots, as a commonly used intelligent device for human-computer interaction, play an important role in people's production and life. However, the human-computer interaction scenarios of existing robots are single and can only execute basic voice commands. There is currently no solution for real-time human motion interaction in the robotics field.
[0069] To solve the above problems, the present disclosure provides a motion interaction method, device, electronic device, and storage medium. Specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0070] Figure 1 is a flow chart of a motion interaction method according to an exemplary embodiment, which can be applied to electronic devices (such as mobile phones or robots). Figure 1 As shown, the method includes the following steps:
[0071] In step S101 , at least one frame of current motion image of the target user is obtained.
[0072] In one implementation, upon receiving a user instruction, the electronic device activates a motion recognition function, thereby acquiring at least one frame of motion image of the target user. The user instruction may be in any form, such as a voice instruction, a gesture instruction, an action instruction, or an instruction triggered by a timer set by the user.
[0073] In another possible implementation, when it is recognized that the user has opened a target application (the target application refers to an application with a motion recognition function) and the target function (such as a motion counting function) is triggered through the target application, at least one frame of the current motion image of the target user can be obtained.
[0074] The target user's motion image can be captured in real time by an image capture device on an electronic device to obtain a data stream of the target user's current motion video. Based on the data stream of the motion video, at least one frame of the target user's current motion image can be obtained.
[0075] In step S102, skeleton point detection is performed on the motion image to determine position information of a plurality of preset skeleton points of the target user in the motion image.
[0076] Among them, the preset bone points may include, for example, nose, left eye, right eye, left ear, right ear, left shoulder, right shoulder, left elbow, right elbow, left wrist, right wrist, left hip, right hip, left knee, right knee, left ankle, right ankle and other bone points.
[0077] In one possible implementation of this step, the portrait area corresponding to the target user in the motion image can be first detected based on a pre-trained human body detection model, and then the portrait area can be further detected based on a pre-trained skeleton point detection model to obtain the position information of each preset skeleton point of the target user.
[0078] The human body detection model and skeleton point detection model here are both pre-trained deep learning models. For example, the human body detection model can be a Faster RCNN (Region-based Convolutional Neural Network) model, where the Faster RCNN model is a well-known deep learning model for target detection. The skeleton point detection model can be a model from the YOLO (You Only Look Once) series (such as the YOLO-V7 model), where YOLO is a commonly used real-time target detection algorithm. Compared with traditional target detection algorithms, YOLO has a faster detection speed and can detect multiple targets simultaneously in a single image.
[0079] In step S103, the target motion currently being performed by the target user and motion parameters of the target motion are determined based on the position information of the plurality of preset skeleton points in the motion image, where the motion parameters represent the completion status of the target motion.
[0080] The motion parameters here may include state parameters corresponding to a plurality of preset actions of the target motion, wherein the preset actions correspond to the state parameters one-to-one, and the state parameters are used to indicate whether the corresponding preset actions are completed.
[0081] For example, assuming that the target movement is a squat, a complete squat action can be decomposed into three sub-steps: shallow squat, deep squat, and standing. Then the squat can correspond to three preset actions: shallow squat, deep squat, and standing. In this way, the status parameters can be used to record the completion status of each preset action. For example, a status parameter of 1 indicates that the corresponding preset action has been completed, and a status parameter of 0 indicates that the corresponding preset action has not been completed or has not met the standard.
[0082] It is understandable that the position changes of skeletal points during different types of exercise will vary, and the angles formed by the lines connecting the skeletal points will also vary. Continuing with the example of squats, when a user performs a squat, the angles formed by the lines connecting the three skeletal points of the hip joint, knee joint, and ankle joint will change significantly. Therefore, the present disclosure can determine the type of target exercise currently being performed by the target user based on the position information of multiple preset skeletal points in the motion image, and further identify whether the user has completed the target exercise once based on the motion parameters.
[0083] In step S104, motion interaction is performed according to the motion parameters.
[0084] After determining the state parameters corresponding to each preset action of the target movement, it is possible to further determine whether the user has completed the target movement based on the state parameters of each preset action. The target movement can then be counted and / or timed, or personalized prompt information can be output when it is determined that the user has completed or not completed the target movement, thereby improving the human-computer interaction experience.
[0085] By adopting the above method, skeleton point detection is performed based on the motion image of the target user to obtain the position information of multiple preset skeleton points of the target user, and then based on the position information of the preset skeleton points, the target motion currently being performed by the target user is identified, and the motion parameters of the target motion are further determined, so that motion interaction with the target user can be performed based on the motion parameters. In this way, compared with the related technology that can only identify and count a pre-set motion type, the present application does not need to set the motion type to be identified in advance, and can perform real-time identification of the type and completion status of the currently ongoing target motion based on the user's motion image, thereby realizing the distinction and identification of multiple motion types and improving the user experience.
[0086] In the present disclosure, when determining the target motion currently being performed by a target user based on the position information of multiple preset skeletal points in a motion image, the target motion can be determined from multiple preset motions. Different preset motions can correspond to different preset skeletal point sets, each of which includes multiple target skeletal points, i.e., different motion types can correspond to different target skeletal points. In this way, the target motion currently being performed by the target user can be determined based on the position information of multiple preset skeletal points in the current motion image and the preset skeletal point sets corresponding to each preset motion.
[0087] For example, assuming that the preset exercises include two types of exercises: squats and push-ups, among which the target bone points corresponding to squats are: left hip joint, right hip joint, left knee joint, right knee joint, left ankle joint, and right ankle joint. Then, the preset bone point set corresponding to squats includes six bone points: left hip joint, right hip joint, left knee joint, right knee joint, left ankle joint, and right ankle joint; the target bone points corresponding to push-ups are: left wrist joint, right wrist joint, left elbow joint, right elbow joint, left shoulder joint, and right shoulder joint. Then, the preset bone point set corresponding to push-ups includes six bone points: left wrist joint, right wrist joint, left elbow joint, right elbow joint, left shoulder joint, and right shoulder joint. This is just an example and the present disclosure is not limited to this.
[0088] Figure 2 is based on Figure 1 The embodiment shown is a flow chart of a motion interaction method, as shown in FIG. Figure 2 As shown, step S103 includes the following sub-steps:
[0089] In step S1031 , a plurality of preset skeleton point sets are obtained, where different preset skeleton point sets correspond to different motion types.
[0090] In step S1032, for each of the preset skeleton point sets, the position information of each preset skeleton point in the preset skeleton point set is determined according to the position information of a plurality of the preset skeleton points in the motion image.
[0091] In step S1033, the target motion is determined according to the position information of each preset skeleton point in the preset skeleton point set.
[0092] For example, continuing with the preset movements including squats and push-ups, the preset bone point sets corresponding to each preset movement can be traversed in turn. First, for squats, the preset bone point set corresponding to squats can be obtained, including 6 target bone points: left hip joint, right hip joint, left knee joint, right knee joint, left ankle joint, and right ankle joint. According to the position information of multiple preset bone points in the current motion image, the position information corresponding to these 6 target bone points can be obtained. Then, based on the position information of these 6 target bone points, it can be determined whether the second angle and the third angle change synchronously, wherein the second angle refers to the angle formed by the lines connecting the three bone points of the left hip joint, the left knee joint and the left ankle joint, and the third angle refers to the angle formed by the lines connecting the three bone points of the right hip joint, the right knee joint and the right ankle joint. In this way, when it is determined that the second angle and the third angle change synchronously, and the change angles all meet the preset angle ranges corresponding to the squat, it can be determined that the current target movement is the squat. If not, the preset bone point set corresponding to the push-up can be continued to be traversed, and the same method can be used to determine whether the current target movement is the push-up. The above example is only for illustration, and the present disclosure does not limit this.
[0093] Figure 3 is based on Figure 1 The embodiment shown is a flow chart of a motion interaction method, as shown in FIG. Figure 3 As shown, step S103 includes the following sub-steps:
[0094] In step S1034, preset action completion conditions corresponding to the plurality of preset actions of the target motion are obtained.
[0095] In one implementation, the preset action completion condition may include an angle range of a first angle being within a preset angle range, different preset actions corresponding to different preset angle ranges, and the first angle being an angle formed by lines connecting first skeletal points corresponding to the target motion;
[0096] Among them, different target movements correspond to different first skeletal points. For example, if the target movement is a squat, the squat mainly focuses on the position information of the six skeletal points of the left hip, right hip, left knee, right knee, left ankle, and right ankle. If the target movement is a push-up, the push-up mainly focuses on the position information of the six skeletal points of the left wrist, right wrist, left elbow, right elbow, left shoulder, and right shoulder. Therefore, the first skeletal points corresponding to the squat are: the six preset skeletal points of the left hip joint, right hip joint, left knee joint, right knee joint, left ankle joint, and right ankle joint. The first skeletal points corresponding to the push-up are: the six preset skeletal points of the left wrist joint, right wrist joint, left elbow joint, right elbow joint, left shoulder joint, and right shoulder joint. This is only an example and is not limited to this in the present disclosure.
[0097] The preset angle range corresponding to each preset action is described below in the form of examples.
[0098] For example, let's take the target movement of squatting, which consists of three decomposed movements: a shallow squat, a deep squat, and a standing position. Once the user completes the two pre-set movements, they are considered to have completed one squat. As mentioned above, different pre-set movements correspond to different pre-set angle ranges. For the three pre-set movements of the target movement, the first skeletal points corresponding to the target movement include the hip joint, knee joint, and ankle joint. This means that as the user performs the squat, the target angles formed by the hip joint, knee joint, and ankle joint will change periodically.
[0099] For example, Figure 4 is a schematic diagram of a first angle corresponding to a squat according to an exemplary embodiment. Figure 4 As shown in the figure, the vertex of the first angle is the position of the knee joint, and the two sides of the first angle are the line connecting the hip joint and the chin joint, and the line connecting the chin joint and the ankle joint. Among them, for the three decomposed movements of shallow squat, deep squat and standing, the angle of the first angle corresponding to shallow squat is usually greater than the angle of the first angle corresponding to deep squat, as shown in the figure. Figure 4 The left picture in can be regarded as the first angle corresponding to the shallow squat, such as Figure 4 The right figure in the figure can be considered the first angle corresponding to a deep squat. Of course, the first angle corresponding to standing is greater than the first angle corresponding to a shallow squat. Therefore, the deep squat angle threshold is less than the shallow squat angle threshold. Thus, the preset angle range corresponding to the preset shallow squat is: deep squat angle threshold < current angle ≤ shallow squat angle threshold; the preset angle range corresponding to the preset deep squat is: current angle ≤ deep squat angle threshold; and the preset angle range corresponding to the preset standing action is: current angle > shallow squat angle threshold. This is merely an example and is not intended to limit this disclosure.
[0100] In step S1035, each frame of the motion image is traversed in turn, and for the currently traversed target motion image, the state parameters corresponding to each preset action are determined based on the position information of multiple preset skeleton points in the target motion image and the preset action completion conditions corresponding to multiple preset actions.
[0101] In this step, the current angle between the first angles can be determined based on the position information of multiple preset skeleton points in the target motion image; the target angle range in which the current angle is located can be determined; and the state parameters corresponding to each preset action can be determined based on the target angle range and the preset angle range corresponding to each preset action.
[0102] For example, if the target movement is a squat, the first angle corresponding to the squat is the left angle between the left hip joint, left knee joint, and left ankle joint, and the right angle between the right hip joint, right knee joint, and right ankle joint. Thus, for each preset action corresponding to the squat, if both the left angle and the right angle meet the preset completion conditions corresponding to the preset action, the user is determined to have completed the preset action. The following describes the process of determining the state parameters of each preset action, taking the squat as an example.
[0103] Assuming that the initial state of each state parameter of the three decomposed preset actions included in the squat (shallow squat, deep squat, and standing, respectively) is 0, each frame of the motion image is traversed in turn. After traversing the first frame of the motion image, based on the respective position information of the hip joint, knee joint and ankle joint corresponding to the first frame of the motion image (the hip joint, knee joint and ankle joint are the first bone points corresponding to the squat, of course including the symmetrical hip joints, knee joints and ankle joints on the left and right sides of the body), the target angle range of the current angle of the first bone point corresponding to the first frame of the motion image is determined as follows: squat angle threshold < current angle ≤ shallow squat angle threshold. The target angle range is the preset angle range corresponding to the preset action shallow squat. Therefore, the preset action that the person is performing in the first frame of the motion image is shallow squat. At this time, the state parameter corresponding to the shallow squat can be changed from 0 to 1. When traversing the second frame of motion image, the target angle range of the current angles corresponding to the hip joints, knee joints and ankle joints determined based on the second frame of image becomes: current angle ≤ squat angle threshold, and the target angle range is the preset angle range corresponding to the preset action squat. Therefore, the preset action being performed by the person in the second frame of motion image is squat. At this time, the state parameter corresponding to squat can be changed from 0 to 1; then traversing the third frame of motion image, the target angle range of the current angles corresponding to the hip joints, knee joints and ankle joints determined based on the third frame of image becomes: current angle > shallow squat angle threshold, and the target angle range is the preset angle range corresponding to the preset action standing. Therefore, the preset action being performed by the person in the third frame of motion image is standing. At this time, the state parameter corresponding to standing can be changed from 0 to 1.
[0104] It should be noted that in a possible sports scenario, for the three preset actions of shallow squat, deep squat and standing, after the user completes the shallow squat, the depth of the squat is not enough (that is, the deep squat action does not meet the standard), and the unfinished deep squat sub-step becomes standing. In this case, after the state parameter of the shallow squat is changed to 1, the target angle range detected subsequently becomes the preset angle range corresponding to standing. In this case, the state parameter corresponding to standing can be changed to 1, while the state parameter corresponding to the deep squat remains 0. The above example is only an example for illustration, and the present disclosure does not limit this.
[0105] In the process of performing motion interaction according to motion parameters, the present disclosure can determine the motion result of the target motion according to the motion parameters, and then perform motion interaction based on the motion result.
[0106] The exercise result may include an exercise count or an exercise timing of the target exercise. For example, when doing squats, a user may want to know how many squats they have completed within a certain period of time. In this scenario, the user's target exercise can be counted and the exercise count can be input to the user. When doing a plank, a user may be more concerned about the duration of a plank. In this scenario, the user's target exercise can be timed and the exercise timing can be output to the user.
[0107] After counting or timing the user's target exercise, if the number of times the user completes the target exercise or the duration of the target exercise reaches the set target value, in order to improve the human-computer interaction experience, reward information can be output to the user. For example, a voice output can be given saying "Your current number of exercises has reached the target value. As a reward, I will play a song for you." In other words, the exercise result can also include feedback information on the completion of the target exercise by the target user.
[0108] Figure 5 is based on Figure 1 The embodiment shown is a flowchart of a motion interaction method. In a possible implementation of the present disclosure, the method can be implemented by Figure 5 The motion interaction is achieved in the manner shown.
[0109] like Figure 5 As shown, step S104 includes the following sub-steps:
[0110] In step S1041 , the completion status of the target movement by the target user is determined according to the movement parameters, where the completion status is used to indicate whether the target user has completed the target movement once.
[0111] In this step, a preset state parameter set corresponding to the target movement can be obtained, and the preset state parameter set is used to record at least one target state parameter representing when the target user completes the target movement once; based on the state parameters corresponding to each of the preset actions and the preset state parameter set, the completion status of the target movement by the target user is determined.
[0112] In step S1042, motion interaction is performed according to the completion status.
[0113] In an implementation of this step, when it is determined according to the completion status that the target user has completed the target movement once, the movement count of the target movement may be updated; and the updated movement count may be output to the target user.
[0114] For example, continuing with the example of the target movement being squats, when it is identified that the target user changes from a squat state (i.e., the first angle and the second angle are both within the preset angle range corresponding to the squat state) to a standing state, it can be determined that the target user has completed a squat. When it is identified that the target user changes from a shallow squat state (i.e., the first angle and the second angle are both within the preset angle range corresponding to the shallow squat state) to a standing state, it can be determined that the target user's current squat does not meet the standard.
[0115] In addition, the preset state parameter set corresponding to the squat can be expressed as A=(a1, a2, a3), where a1 is the state parameter corresponding to the shallow squat state, a2 is the state parameter corresponding to the deep squat state, and a3 is the state parameter corresponding to the standing state. In the initial state, the state parameters of each preset action corresponding to the squat are all 0, that is, in the preset state parameter set in the initial state, a1=0, a2=0, a3=0, and each frame of the motion image is traversed in turn. After traversing the first frame of the motion image, based on the respective position information of the hip joint, knee joint and ankle joint corresponding to the first frame of the motion image, the target angle range of the current angle of the first bone point corresponding to the first frame of the motion image is determined to be: squat angle threshold < current angle ≤ shallow squat angle threshold. The target angle range is the preset angle range corresponding to the preset action shallow squat. Therefore, the preset action being performed by the person in the first frame of the motion image is shallow squat. At this time, the state parameter corresponding to the shallow squat can be changed from 0 to 1. When traversing the second frame of the motion image, the target angle range of the current angles corresponding to the hip joint, knee joint and ankle joint determined based on the second frame image becomes: current angle ≤ squat angle threshold. The target angle range is the preset angle range corresponding to the preset action shallow squat. The degree range is the preset angle range corresponding to the preset action squat. Therefore, the preset action being performed by the person in the second frame of motion image is squat. At this time, the state parameter corresponding to squat can be changed from 0 to 1; then traverse the third frame of motion image, and the target angle range of the current angles corresponding to the hip joint, knee joint and ankle joint determined based on the third frame of image becomes: current angle > shallow squat angle threshold. The target angle range is the preset angle range corresponding to the preset action standing. Therefore, the preset action being performed by the person in the third frame of motion image is standing. At this time, the state parameter corresponding to standing can be changed from 0 to 1. At this time, a1=1, a2=1, a3=1 in the preset state parameter set. Based on the state parameters of each preset action in the preset state parameter set, it can be determined that the target user changes from the squat state to the standing state, that is, the target user performs a complete squat. Therefore, the movement count corresponding to the squat is +1.
[0116] When it is identified that the target user changes from a shallow squat state (i.e., the first angle and the second angle are both within the preset angle range corresponding to the shallow squat state) to a standing state, it can be determined that the current deep squat of the target user does not meet the standard.
[0117] It should be noted that in a possible exercise scenario, the target user's squat action may not meet the standard, that is, the target angle is greater than the squat angle threshold. In this case, the exercise count of the squat action cannot be increased by 1. Corresponding to this scenario, after completing a shallow squat, the user does not squat deep enough (that is, the squat action does not meet the standard), and the sub-step of the uncompleted squat becomes standing. In this case, after the state parameter of the shallow squat is changed to 1, the subsequently detected target angle range becomes the preset angle range corresponding to standing. In this case, the state parameter corresponding to standing can be changed to 1, while the state parameter corresponding to the squat remains 0. At this time, a1=1, a2=0, and a3=1 in the preset state parameter set. Based on the state parameters of each preset action in the preset state parameter set, it can be determined that the target user has directly changed from the shallow squat state to the standing state, that is, the target user's current squat does not meet the standard. In order to improve the human-computer interaction experience, a prompt message can be output to the user, such as "Please squat deeper." The above example is only an example and the present disclosure is not limited to this.
[0118] In addition, assuming that the target movement is a push-up, the push-up can include two sub-movements: a push-up state and an initial movement state. When identifying the push-up movement, the third angle between the three skeletal points of the left wrist, left elbow, and left shoulder, and the fourth angle between the three skeletal points of the right wrist, right elbow, and right shoulder can be calculated. When it is determined that the third angle and the fourth angle are both greater than the initial state angle threshold (such as 170 degrees), it is regarded as the initial movement state. When it is determined that the third angle and the fourth angle are both less than the set push-up angle (such as 90 degrees) and subsequently return to the initial movement state, it is assumed that the user has completed one push-up. In other words, by analogy with the motion interaction method for squats disclosed in the present invention, the present invention can also identify whether the target user has completed push-ups in sequence in the same manner, and count the push-up movements of the target user according to the recognition result, and output the movement count to the user.
[0119] In another implementation of this step, when it is determined based on the completion status that the target user has completed the target movement once, the completion time when the target user completes the target movement can be obtained; the movement timing of the target movement can be determined based on the completion time and the start time of the target movement set by the target user; and the movement timing can be output to the target user.
[0120] In another implementation of this step, when it is determined based on the completion status that the target user has completed the target exercise once, a preset reward operation is performed; when it is determined based on the completion status that the target user has not met the target exercise requirements, a preset prompt message is output.
[0121] Wherein, the preset reward operation includes playing target multimedia information and / or controlling the target bionic robot to repeat the target movement.
[0122] For example, as described above, taking squats as an example, if it is determined that the target user's current squat does not meet the target, a prompt message "Please squat deeper" can be output. If it is determined that the target user has completed the target movement once, the electronic device can be controlled to play the target multimedia information and / or the target bionic robot can be controlled to repeat the target movement. This can significantly enhance the human-computer interaction experience and increase the user's enthusiasm for exercise.
[0123] By using the above method, there is no need to set the type of exercise to be identified in advance. The type and completion status of the target exercise currently in progress can be identified in real time based on the user's exercise image, thereby realizing the distinction and identification of multiple types of exercise, avoiding the identification of only one pre-set type of exercise, and improving the user experience.
[0124] In addition, the motion interaction method disclosed in the present invention can also be applied to robots, so that the robot can distinguish and identify various types of motion based on the user's motion images, and perform real-time motion interaction based on the identified motion parameters. For example, the robot can be controlled to repeat the user's current target motion, thereby increasing the fun and interactive experience.
[0125] In addition, the present disclosure identifies the positions of the skeleton points of the target user in the motion image and further performs motion recognition and interaction based on the position information of the skeleton points. Compared with directly using deep learning for end-to-end motion recognition, it can reduce the recognition error rate and improve the accuracy of motion recognition.
[0126] Figure 6 is a block diagram of a motion interaction device according to an exemplary embodiment. Figure 6 As shown, the device includes:
[0127] The acquisition module 601 is configured to acquire at least one frame of a current motion image of a target user;
[0128] The skeleton point detection module 602 is configured to perform skeleton point detection on the motion image to determine position information of a plurality of preset skeleton points of the target user in the motion image;
[0129] The motion recognition module 603 is configured to determine the target motion currently being performed by the target user and motion parameters of the target motion based on the position information of the plurality of preset skeleton points in the motion image, wherein the motion parameters represent the completion status of the target motion;
[0130] The interaction module 604 is configured to perform motion interaction according to the motion parameters.
[0131] Optionally, the motion recognition module 603 is configured to obtain multiple preset skeleton point sets, different preset skeleton point sets corresponding to different motion types; for each of the preset skeleton point sets, the position information of each preset skeleton point in the preset skeleton point set is determined based on the position information of multiple preset skeleton points in the motion image; and the target motion is determined based on the position information of each preset skeleton point in the preset skeleton point set.
[0132] Optionally, the motion parameters include state parameters corresponding to a plurality of preset actions of the target motion, the state parameters representing whether the corresponding preset actions are completed;
[0133] The motion recognition module 603 is configured to obtain the preset action completion conditions corresponding to multiple preset actions of the target motion; traverse each frame of the motion image in turn, and for the currently traversed target motion image, determine the state parameters corresponding to each of the preset actions based on the position information of multiple preset bone points in the target motion image and the preset action completion conditions corresponding to multiple preset actions.
[0134] Optionally, the preset action completion condition includes an angle range of a first angle being within a preset angle range, different preset actions correspond to different preset angle ranges, and the first angle is an angle formed by lines connecting the first skeletal points corresponding to the target motion;
[0135] The motion recognition module 603 is configured to determine the current angle of the first angle based on the position information of multiple preset bone points in the target motion image; determine the target angle range within which the current angle is located; and determine the state parameters corresponding to each preset action based on the target angle range and the preset angle range corresponding to each preset action.
[0136] Optionally, the interaction module 604 is configured to determine the target user's completion status of the target movement based on the movement parameters, where the completion status is used to indicate whether the target user has completed the target movement once; and perform movement interaction based on the completion status.
[0137] Optionally, the interaction module 604 is configured to obtain a preset state parameter set corresponding to the target motion, and the preset state parameter set is used to record at least one target state parameter representing when the target user completes the target motion once; and determine the completion status of the target user for the target motion based on the state parameters corresponding to each of the preset actions and the preset state parameter set.
[0138] Optionally, the interaction module 604 is configured to update the movement count of the target movement when it is determined according to the completion status that the target user has completed the target movement once; and output the updated movement count to the target user.
[0139] Optionally, the interaction module 604 is configured to obtain the completion time when the target user completes the target movement when it is determined based on the completion status that the target user has completed the target movement once; determine the movement timing of the target movement based on the completion time and the start time of the target movement set by the target user; and output the movement timing to the target user.
[0140] Optionally, the interaction module 604 is configured to perform a preset reward operation when it is determined based on the completion status that the target user has completed the target exercise once; and output a preset prompt message when it is determined based on the completion status that the target user has not met the target exercise requirements.
[0141] Optionally, the preset reward operation includes playing target multimedia information and / or controlling the target bionic robot to repeat the target movement.
[0142] Optionally, the acquisition module 601 is configured to enable a motion recognition function upon receiving a user instruction; after enabling the motion recognition function, acquire at least one current motion image of the target user.
[0143] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0144] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon. When the program instructions are executed by a processor, the steps of the motion interaction method provided by the present disclosure are implemented.
[0145] Figure 78 is a block diagram of an electronic device for motion interaction according to an exemplary embodiment. For example, device 800 may be a robot, a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0146] Reference Figure 7 , device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output interface 812 , a sensor component 814 , and a communication component 816 .
[0147] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the motion interaction method described above. In addition, the processing component 802 may include one or more modules to facilitate interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
[0148] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0149] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 800.
[0150] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0151] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0152] The input / output interface 812 provides an interface between the processing component 802 and peripheral interface modules, such as a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0153] The sensor assembly 814 includes one or more sensors for providing various aspects of the status assessment of the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800. The sensor assembly 814 can also detect changes in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and temperature changes of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0154] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0155] In an exemplary embodiment, the device 800 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-mentioned motion interaction method.
[0156] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above-mentioned motion interaction method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0157] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the above-mentioned motion interaction method when executed by the programmable device.
[0158] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the present disclosure. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0159] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A motion interaction method, characterized in that: include: Acquire at least one frame of current motion image of the target user; Performing skeleton point detection on the motion image to determine position information of a plurality of preset skeleton points of the target user in the motion image; Determining the target motion currently being performed by the target user and motion parameters of the target motion according to the position information of the plurality of preset skeleton points in the motion image, wherein the motion parameters represent the completion status of the target motion; The target motion is one of a plurality of preset motions, and different preset motions correspond to different motion types; Performing motion interaction according to the motion parameters; The determining, based on the position information of the plurality of preset skeleton points in the motion image, the target motion currently being performed by the target user comprises: Get multiple preset bone point sets, different preset bone point sets correspond to different motion types; For each of the preset skeleton point sets, determining the position information of each preset skeleton point in the preset skeleton point set according to the position information of a plurality of the preset skeleton points in the motion image; The target motion is determined according to the position information of each preset skeleton point in the preset skeleton point set.
2. The method according to claim 1, characterized in that The motion parameters include state parameters corresponding to a plurality of preset actions of the target motion, respectively, and the state parameters represent whether the corresponding preset actions are completed; Determining the motion parameters of the target motion according to the position information of the plurality of preset skeleton points in the motion image includes: Acquire preset action completion conditions corresponding to a plurality of preset actions of the target motion respectively; Each frame of the motion image is traversed in sequence, and for the currently traversed target motion image, the state parameters corresponding to each preset action are determined according to the position information of multiple preset skeleton points in the target motion image and the preset action completion conditions corresponding to multiple preset actions.
3. The method according to claim 2, characterized in that The preset action completion condition includes that the angle range of the first angle is within the preset angle range, different preset actions correspond to different preset angle ranges, and the first angle is the angle formed by the connecting lines between the first skeleton points corresponding to the target movement; The determining, based on the position information of the plurality of preset skeleton points in the target motion image and the preset action completion conditions respectively corresponding to the plurality of preset actions, the state parameter respectively corresponding to each preset action comprises: Determining a current angle of the first angle according to position information of a plurality of the preset skeleton points in the target motion image; Determine a target angle range within which the current angle lies; The state parameter corresponding to each of the preset actions is determined according to the target angle range and the preset angle range corresponding to each of the preset actions.
4. The method according to claim 2, characterized in that: The performing motion interaction according to the motion parameters comprises: Determine, according to the motion parameters, the completion status of the target user for the target motion, wherein the completion status is used to indicate whether the target user has completed the target motion once; Perform motion interaction according to the completion status.
5. The method according to claim 4, characterized in that The determining, according to the motion parameters, the completion status of the target motion by the target user comprises: Acquire a preset state parameter set corresponding to the target movement, where the preset state parameter set is used to record at least one target state parameter representing when the target user completes the target movement once; The completion status of the target movement by the target user is determined according to the state parameters corresponding to each of the preset actions and the preset state parameter set.
6. The method according to claim 4, characterized in that The performing motion interaction according to the completion status includes: When it is determined according to the completion status that the target user has completed the target movement once, updating the movement count of the target movement; The updated motion count is output to the target user.
7. The method according to claim 4, characterized in that The performing motion interaction according to the completion status includes: When it is determined according to the completion status that the target user has completed the target movement once, obtaining a completion time when the target user completes the target movement; Determining a movement timing of the target movement according to the completion time and a start time of the target movement set by the target user; The motion timing is output to the target user.
8. The method according to claim 4, characterized in that The performing motion interaction according to the completion status includes: When it is determined according to the completion status that the target user has completed the target exercise once, executing a preset reward operation; When it is determined according to the completion status that the target user has not reached the target exercise standard, a preset prompt message is output.
9. The method according to claim 8, characterized in that The preset reward operation includes playing target multimedia information and / or controlling the target bionic robot to repeat the target movement.
10. The method according to claim 1, characterized in that The method further comprises: Upon receiving a user instruction, the motion recognition function is enabled; The obtaining of at least one frame of current motion image of the target user comprises: After the motion recognition function is enabled, at least one frame of current motion image of the target user is acquired.
11. A motion interaction device, characterized in that: include: An acquisition module is configured to acquire at least one frame of current motion image of the target user; a skeleton point detection module, configured to perform skeleton point detection on the motion image, and determine position information of a plurality of preset skeleton points of the target user in the motion image; A motion recognition module, configured to determine the target motion currently being performed by the target user and motion parameters of the target motion according to the position information of the plurality of preset skeleton points in the motion image, wherein the motion parameters represent the completion status of the target motion; The target motion is one of a plurality of preset motions, and different preset motions correspond to different motion types; An interaction module, configured to perform motion interaction according to the motion parameters; The motion recognition module is configured to obtain a plurality of preset skeleton point sets, where different preset skeleton point sets correspond to different motion types; for each of the preset skeleton point sets, determine the position information of each preset skeleton point in the preset skeleton point set according to the position information of the plurality of preset skeleton points in the motion image; The target motion is determined according to the position information of each preset skeleton point in the preset skeleton point set.
12. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: execute the steps of the method described in any one of claims 1-10.
13. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented.
