Posture adjustment method and device, electronic equipment and readable storage medium
By collecting human posture images, determining key point information and comparing it with a standard key point set, and selecting the minimum distance set for adjustment, the problem of poor applicability of human posture adjustment is solved, achieving efficient posture adjustment without device dependence and improving user experience.
Patent Information
- Application Number
- CN202310888371.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-19
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2043-07-19
AI Technical Summary
Existing human posture adjustment methods have poor applicability and cannot effectively improve user experience.
By acquiring target images of human posture, the coordinate information of key points of the human body is determined, and the distance is compared with multiple sets of standard key points. The set of standard key points with the smallest distance is selected for posture adjustment, and augmented reality rendering is used to prompt the adjustment.
It enables human posture adjustment without the need for specific devices or sensors, improving applicability and user experience.
Smart Images

Figure CN116823953B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of artificial intelligence, and particularly relates to a posture adjustment method and device, an electronic device and a readable storage medium. BACKGROUND
[0002] In the related art, the adjustment of a human posture is usually performed by using a specific device or sensor to obtain human posture information, and then adjusting the posture according to a comparison between the obtained human posture information and standard posture information. It can be seen that the current human posture adjustment method has poor applicability. SUMMARY
[0003] The embodiments of the present application aim to provide a posture adjustment method and device, an electronic device and a readable storage medium to solve the problem of poor applicability of the current human posture adjustment method.
[0004] To solve the above technical problem, the present application is implemented as follows:
[0005] In a first aspect, a posture adjustment method is provided, comprising:
[0006] collecting a target image containing a human posture, and determining coordinate information of each key point in a first key point set corresponding to the human posture according to the target image;
[0007] determining distances between the first key point set and each standard key point set according to the coordinate information of each key point in the first key point set and the coordinate information of each key point in a plurality of preset standard key point sets;
[0008] selecting a target standard key point set with the smallest distance to the first key point set from the plurality of standard key point sets according to the distances between the first key point set and each standard key point set;
[0009] adjusting the human posture according to the target standard key point set.
[0010] In a second aspect, a posture adjustment device is provided, comprising:
[0011] a collection module configured to collect a target image containing a human posture;
[0012] a first determination module configured to determine coordinate information of each key point in a first key point set corresponding to the human posture according to the target image;
[0013] a second determination module configured to determine distances between the first key point set and each standard key point set according to the coordinate information of each key point in the first key point set and the coordinate information of each key point in a plurality of preset standard key point sets;
[0014] The selecting module is configured to select a target standard key point set with the smallest distance to the first key point set from the multiple standard key point sets according to the distances between the first key point set and each of the standard key point sets.
[0015] The adjusting module is configured to adjust the human pose according to the target standard key point set.
[0016] In a third aspect, an electronic device is provided, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
[0017] In a fourth aspect, a readable storage medium is provided, which stores a program or instructions, and the program or instructions, when executed by a processor, implement the steps of the method according to the first aspect.
[0018] In the embodiments of the present application, the human key point information corresponding to the human pose can be determined according to the target image containing the human pose, and the human pose adjustment can be implemented according to the comparison between the human key point information and the corresponding standard key point information. In this way, the human pose adjustment can be implemented without the aid of specific devices or sensors, thereby improving the applicability and user experience. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 is a flowchart of a pose adjustment method provided by the embodiments of the present application;
[0020] Figure 2 is a schematic diagram of a human 3D key point in the embodiments of the present application;
[0021] Figure 3 is a schematic diagram of a polyhedron constructed in the embodiments of the present application;
[0022] Figure 4 is a schematic diagram of an AR rendering process in the embodiments of the present application;
[0023] Figure 5 is a structural schematic diagram of a pose adjustment apparatus provided by the embodiments of the present application;
[0024] Figure 6 is a structural schematic diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0025] With reference to the drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of them. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0026] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally a category and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in a "or" relationship.
[0027] The posture adjustment method, device, electronic device and readable storage medium provided by the embodiments of the present application will be described in detail below with reference to the drawings, specific embodiments and application scenarios.
[0028] Please refer to Figure 1 , Figure 1 is a flowchart of a posture adjustment method provided by an embodiment of the present application. The method is applied to an electronic device, as shown in Figure 1 , the method comprises the following steps:
[0029] Step 11: Collect a target image containing a human posture, and determine the coordinate information of each key point in a first key point set corresponding to the human posture according to the target image.
[0030] Here, the action type corresponding to the human posture can be selected from, but is not limited to, dance action, sports action, game action, etiquette action, and command gesture action. The key point is specifically a three-dimensional (3D) key point of the human body, which can be selected from, but is not limited to, right ankle, right knee, right hip, left hip, left knee, pelvis, chest, cervical vertebra, head top, right wrist, right elbow, right shoulder, left wrist, left elbow, left shoulder, etc., as shown in Figure 2 .
[0031] Optionally, the target image containing the human body posture can be collected / pictured by a camera, a camera in a mobile phone, or the like. For example, the image can be collected by a mobile phone with a primary deep sensing camera, and image RGB-D (i.e., three primary colors plus distance) information can be obtained based on the collected image. Then, human body key point information corresponding to the human body posture in the image can be determined based on the obtained RGB-D information. For another example, a plurality of continuous frames of images can be collected by a common mobile phone camera, in which the human body can continuously move, and image RGB-D information can be generated by performing a two-dimensional (2D) to three-dimensional (3D) image transformation based on the collected plurality of continuous frames of images. Then, human body key point information corresponding to the human body posture in the image can be determined based on the generated RGB-D information.
[0032] In some embodiments, before the target image is collected, the user can be prompted to make a specified action posture, and then the target image containing the human body posture can be collected by a camera, a camera in a mobile phone, or the like.
[0033] In some embodiments, for the collected target image, human body key point information can be obtained by using a pre-trained posture key point checking model. For example, the target image can be input into the pre-trained posture key point checking model for checking, and coordinate information of each key point in a first key point set corresponding to the human body posture in the target image can be output. The posture key point checking model can be trained by using a related model training method, and is not limited in this regard.
[0034] Step 12: determining distances between the first key point set and each standard key point set according to the coordinate information of each key point in the first key point set and the coordinate information of each key point in each standard key point set.
[0035] Here, before the key point information comparison is performed, i.e., before the distances between the first key point set and each standard key point set are determined, the action type corresponding to the human body posture in the target image can be determined by a preset manner, so that the key point information comparison can be performed in combination with the action type, thereby improving the accuracy of the key point information comparison. The preset manner can include, but is not limited to, user self-selection, comparison between the obtained image and an action type database, or the like.
[0036] It should be noted that there are differences between the plurality of standard key point sets. The plurality of standard key point sets are preset because, due to differences in height, gender, weight, age, or the like, different people can have different human body key point information when performing the same standard action. According to the above difference factors, a plurality of (e.g., five) standard key point sets with differences can be preset, and a standard key point set that is relatively close can be selected to adjust the human body posture, thereby improving the accuracy of the key point information comparison.
[0037] Step 13: selecting a target standard key point set with the smallest distance to the first key point set from the plurality of standard key point sets according to the distances of the first key point set to each of the standard key point sets.
[0038] Step 14: adjusting the human posture according to the target standard key point set.
[0039] Here, after selecting the target standard key point set, the difference between the first key point set and the target standard key point set can be prompted in a voice prompt, augmented reality (AR) rendering, or the like, so that the user adjusts the human posture.
[0040] Optionally, the scenario to which the embodiments of the present application are applicable can be a case where the user posture action needs to be consistent with the standard action as much as possible during fitness exercises, sign language practice, etiquette action practice, and command gesture practice. Through the scheme in the present application, when the user posture action is inconsistent with the standard action, the user posture can be adjusted. For example, the user can be prompted through augmented reality rendering to adjust the user posture.
[0041] The posture adjustment method of the embodiments of the present application can determine human key point information corresponding to the human posture according to the target image containing the human posture, and realize human posture adjustment according to the comparison between the human key point information and corresponding standard key point information. In this way, human posture adjustment can be realized without the aid of specific devices or sensors, thereby improving applicability and improving user experience.
[0042] Optionally, in the present embodiment, in order to quickly exclude incorrect postures and reduce the amount of calculation, after the target image is acquired, the target image can be input into a pre-trained posture classification neural network model for classification to determine whether the human posture in the target image and the specified human posture are of the same type, such as dance action or game action, and then when the human posture in the target image and the specified posture are of the same type, the human key point information corresponding to the human posture in the target image is determined, and human posture adjustment is realized according to the comparison between the human key point information and the corresponding standard key point information. If the human posture in the target image and the specified posture are not of the same type, the user can be prompted to perform the action again, and the target image containing the human posture is re-acquired. This can be understood as a rough judgment, and when the user posture is determined to be the same as the specified posture through the rough judgment, subsequent fine judgment is performed. The purpose of the rough judgment is to quickly exclude incorrect postures and reduce the amount of calculation.
[0043] Optionally, the process of determining the distance between the first key point set and each of the plurality of standard key point sets according to the coordinate information of each key point in the first key point set and the coordinate information of each key point in the plurality of standard key point sets can include:
[0044] According to the coordinate information of each key point in the first key point set, a center point and a reference vector of the first key point set are determined, and according to the coordinate information of each key point in each standard key point set, a center point and a reference vector of each standard key point set are determined;
[0045] The first key point set is transformed with the center point of each standard key point set as an origin, to obtain a plurality of second key point sets; wherein the center point of each second key point set coincides with the center point of the corresponding standard key point set, and the direction of the reference vector of each second key point set is consistent with the direction of the reference vector of the corresponding standard key point set;
[0046] The distance between each second key point set and the corresponding standard key point set is calculated to obtain the distance between the first key point set and each standard key point set.
[0047] In this way, by transforming the first key point set, the reference vector direction of the obtained second key point set can be consistent with that of the corresponding standard key point set, thereby improving the accuracy of key point information comparison.
[0048] For example, if the reference vector of a standard key point set A is a, and the reference vector of a first key point set B is b, there is a transformation matrix T such that a = b * T, at this time, T can be used to perform coordinate transformation on each key point in the first key point set B to obtain a second key point set B ′ , and the transformation formula is: B ′ = B * T.
[0049] In the embodiments of the present application, for the first key point set and each standard key point set, the center point and the reference vector need to be determined. The above-mentioned determination of the center point and the reference vector of the first key point set according to the coordinate information of each key point in the first key point set, and the determination of the center point and the reference vector of each standard key point set according to the coordinate information of each key point in the plurality of standard key point sets can include:
[0050] For the third key point set, the third key point set is the first key point set or any standard key point set in the plurality of standard key point sets, the following steps are performed:
[0051] S1: selecting a plurality of first key points from the third key point set, determining the center point of a polyhedron composed of the plurality of first key points according to the coordinate information of the plurality of first key points, and determining the center point of the polyhedron as the center point of the third key point set;
[0052] S2: determining a reference vector of the third key point set according to a center point of the third key point set and a first reference point, wherein the first reference point is determined based on coordinate information of at least two key points in the third key point set.
[0053] That is, for the first key point set, the center point and the reference vector of the first key point set can be determined by performing the above S1 and S2. For each set of standard key point set, the center point and the reference vector of each set of standard key point set can be determined by performing the above S1 and S2.
[0054] In some embodiments, a plurality of first key points can be selected from the third key point set based on a preset manner such as user self-selection, etc. For example Figure 3 As shown, the key points of the left hip 3, the pelvic bone 6, the right hip 2, the right shoulder 12, the cervical vertebra 8 and the left shoulder 13 can be selected, and the corresponding polyhedral region is the trunk and pelvic region between the double shoulders and double hip joints of the body, and the reason is that the variation range of the center of gravity of the body is basically controlled within the region, and the center point can be determined more accurately.
[0055] In some embodiments, in the above S2, two key points can be selected from the third key point set, such as the left and right wrist key points, and the coordinate mean of the two key points is calculated, the intermediate point corresponding to the coordinate mean is taken as the first reference point, and a reference vector is determined according to the center point and the first reference point, such as the reference vector from the center point to the first reference point.
[0056] Optionally, the center point can be determined based on the arithmetic mean of the key point coordinates. The process of determining the center point of the polyhedron composed of the plurality of first key points in the above S1 can include:
[0057] According to the coordinate information of the plurality of first key points, the average value of the coordinate information of the plurality of first key points is calculated, and the coordinate point corresponding to the average value of the coordinate information of the plurality of first key points is determined as the center point of the polyhedron.
[0058] For example, the center point coordinates can be calculated by using the following formula:
[0059]
[0060] wherein (x C ,y C ,z C ) represents the center point coordinates. n represents the number of first key points. i represents the i-th key point, i = 1, 2…n. (x i ,y i ,z i ) represents the coordinates of the i-th key point.
[0061] Optionally, the process of determining the center point of the polyhedron formed by the plurality of first key points in S1 above may include:
[0062] Based on the multiple first key points, a triangulation point set is constructed. The triangulation point set contains multiple key point groups, and each key point group contains three first key points. For example, the Delaunay triangulation algorithm can be used to triangulate the set of multiple first key points, that is, any three key points form a triangle, and the triangulation point set (i.e. the set of vertex pairs that form the triangle) is obtained.
[0063] Traverse each key point group in the triangulated point set, and calculate the volume of the tetrahedron formed by the three first key points and the first center point in each key point group. The first center point is determined based on the coordinate information of the multiple first key points; for example, the center point o can be determined by calculating the arithmetic mean of the coordinate information of the multiple first key points. If the triangulated point set contains m key point groups, that is, m pairs of triangle vertices, then m tetrahedrons can be formed with the center point o.
[0064] The coordinates of the central body of the tetrahedron formed by the three first key points and the first center point in each key point group are weighted and averaged according to the volume of the corresponding tetrahedron to obtain the coordinate results.
[0065] The coordinate point corresponding to the coordinate result is determined as the center point of the polyhedron.
[0066] For example, consider a tetrahedron with four vertices whose coordinates are (x1, y1, z1), (x2, y2, z2), (x3, y3, z3), and (x4, y4, z4). That is, x1, x2, x3, x4 are the x-coordinates of the four vertices, y1, y2, y3, y4 are the y-coordinates, and z1, z2, z3, z4 are the z-coordinates. The volume V of this tetrahedron can be represented as follows:
[0067]
[0068] For example, if n tetrahedrons are formed, their corresponding volumes are V1, V2, ..., V. n The corresponding center points are C1, C2…C n Using the arithmetic mean of the four vertices of the tetrahedron as the coordinates of the center point, the coordinates C of the center point of the polyhedron can be expressed as:
[0069]
[0070] Optionally, the above calculating the distance between each second key point set and the corresponding standard key point set respectively to obtain the distance between the first key point set and each standard key point set can include:
[0071] calculating the distance between each second key point set and the corresponding key point in the corresponding standard key point set respectively to obtain a plurality of distance lists;
[0072] weighting the distance in each distance list respectively to obtain the distance score between the first key point set and each standard key point set.
[0073] For example, if a standard key point set is A and the corresponding second key point set is B ′ , the distance score between the first key point set and the standard key point set can be calculated by the following formula:
[0074]
[0075] wherein, A i represents the coordinate of the i th key point in the standard key point set A, B i ′ represents the coordinate of the i th key point in the second key point set B ′ , W i represents the weight of the i th key point, and S represents the number of key points in the standard key point set A and the second key point set B ′ .
[0076] In some embodiments, in order to improve accuracy, the distance between the new second key point set and the corresponding key point in the new standard key point set can be calculated after the second key point set and the corresponding standard key point set are normalized to obtain a distance list.
[0077] For example, if a standard key point set is A and the corresponding second key point set is B ′ , the following formula can be used for normalization respectively:
[0078]
[0079] wherein, x i represents the x-axis coordinate of the i th key point in the standard key point set A or the second key point set B ′ , x o represents the x-axis coordinate of the center point in the standard key point set A or the second key point set B ′ , x max represents the maximum value of the x-axis coordinates of all key points in the standard key point set A or the second key point set B ′ , and x min represents the maximum value of the x-axis coordinates of all key points in the standard key point set A or the second key point set B′ The minimum value in the x-axis coordinates of all the key points in the first key point set is normalized to 1. Similarly, the y-axis coordinates and the z-axis coordinates can be normalized.
[0080] In some embodiments, after obtaining the distance scores of the first key point set and each set of standard key points, the scores of each set of standard key points can be superimposed first, and then the set of standard key points with the minimum distance score to the first key point set is selected as the target set of standard key points, and the posture adjustment is performed according to the target set of standard key points.
[0081] For example, the minimum value in the distance scores of the first key point set can be determined by the following formula:
[0082] Target=Min(score j +f j )
[0083] Wherein, score j represents the distance score of the first key point set and the jth set of standard key points. f j represents the preset score of the jth set of standard key points, which can be understood as an initial score, which can be set based on actual conditions.
[0084] In the embodiments of the present application, after the target set of standard key points is selected, the user can be prompted by an augmented reality (AR) rendering method to adjust the user's posture. The adjustment process in step 14 above can include:
[0085] Rendering a human body according to the coordinate information of each key point in the target set of standard key points to obtain a human body rendering image; for example, an AR rendering method can be used to obtain a semi-transparent human outline;
[0086] Fitting the human body rendering image to the human body posture to obtain a fitting result, and displaying the fitting result; wherein the fitting result is used to prompt the difference between the human body posture and the standard posture, and the user adjusts the human body posture based on the fitting result.
[0087] Further, the posture adjustment method in the embodiments can further include:
[0088] Selecting a second key point from the first key point set, the distance between the first key point set and the corresponding second key point in the target set of standard key points is greater than or equal to a preset threshold, that is, the key point with a distance greater than or equal to a preset threshold is selected;
[0089] On the displayed fitting result, the difference between the first key point set and the corresponding second key point in the target set of standard key points is marked, thereby facilitating accurate adjustment of the human body posture.
[0090] For example, when marking differences, solid or dashed lines can be used to connect the two corresponding second key points, and arrows can be used to indicate the direction of adjustment of the second key points.
[0091] For example Figure 4 As shown, assuming the standard pose is hands on hips, after selecting the target standard keypoint set, AR rendering can be used to obtain a semi-transparent human silhouette with hands on hips. Then, it can be overlaid with the human pose in the acquired image, and keypoints with a distance greater than or equal to a preset threshold can be marked. For example... Figure 4 As shown, since the distance to the key point 'right elbow' exceeds the preset threshold, the adjustment direction can be marked with a solid line with an arrow to facilitate user adjustment; similarly, since the distance to the key point 'left elbow' exceeds the preset threshold, the adjustment direction can be marked with a solid line with an arrow to facilitate user adjustment.
[0092] It should be noted that the attitude adjustment method provided in this application embodiment can be executed by an attitude adjustment device or a control module within that attitude adjustment device for executing the attitude adjustment method. This application embodiment uses an attitude adjustment device executing the attitude adjustment method as an example to illustrate the attitude adjustment device provided in this application embodiment.
[0093] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an attitude adjustment device provided in an embodiment of this application. This device is applied to electronic devices, such as... Figure 5 As shown, the attitude adjustment device 50 includes:
[0094] Acquisition module 51 is used to acquire target images containing human postures;
[0095] The first determining module 52 is used to determine the coordinate information of each key point in the first key point set corresponding to the human posture based on the target image.
[0096] The second determining module 53 is used to determine the distance between the first key point set and each set of standard key points based on the coordinate information of each key point in the first key point set and the coordinate information of each key point in a preset set of multiple standard key point sets.
[0097] The selection module 54 is used to select the target standard key point set with the smallest distance from the first key point set to each set of standard key points based on the distance between the first key point set and each set of standard key points.
[0098] The adjustment module 55 is used to adjust the human posture according to the target standard key point set.
[0099] Optionally, the second determining module 53 comprises:
[0100] a determining unit, configured to determine a center point and a reference vector of the first key point set according to coordinate information of each key point in the first key point set, and determine a center point and a reference vector of each standard key point set according to coordinate information of each key point in the plurality of standard key point sets;
[0101] a transforming unit, configured to transform the first key point set respectively with the center point of each standard key point set as an origin, to obtain a plurality of second key point sets; wherein the center point of each second key point set coincides with the center point of the corresponding standard key point set, and the direction of the reference vector of each second key point set is consistent with the direction of the reference vector of the corresponding standard key point set;
[0102] a calculating unit, configured to calculate the distance between each second key point set and the corresponding standard key point set respectively, to obtain the distance between the first key point set and each standard key point set.
[0103] Optionally, the determining unit is specifically configured to:
[0104] for a third key point set, the third key point set being the first key point set or any standard key point set in the plurality of standard key point sets, the following steps are performed:
[0105] selecting a plurality of first key points from the third key point set, determining a center point of a polyhedron formed by the plurality of first key points according to coordinate information of the plurality of first key points, and determining the center point of the polyhedron as the center point of the third key point set;
[0106] determining a reference vector of the third key point set according to the center point of the third key point set and a first reference point, wherein the first reference point is determined based on coordinate information of at least two key points in the third key point set.
[0107] Optionally, the determining unit is specifically configured to:
[0108] calculating an average value of coordinate information of the plurality of first key points according to the coordinate information of the plurality of first key points, and determining a coordinate point corresponding to the average value of the coordinate information of the plurality of first key points as the center point of the polyhedron.
[0109] Optionally, the determining unit is specifically configured to:
[0110] According to the plurality of first key points, a triangulation point set is constructed, the triangulation point set including a plurality of key point groups, each key point group including three first key points; each key point group in the triangulation point set is traversed, and a volume of a tetrahedron formed by the three first key points in each key point group and a first center point is calculated respectively, the first center point being determined according to coordinate information of the plurality of first key points; a center coordinate of the tetrahedron formed by the three first key points in each key point group and the first center point is weighted and averaged according to a volume of the corresponding tetrahedron to obtain a coordinate result; and a coordinate point corresponding to the coordinate result is determined as the center point of the polyhedron.
[0111] Optionally, the computing unit is specifically configured to:
[0112] The distances between each set of second key point sets and the corresponding key points in the corresponding standard key point set are calculated respectively to obtain a plurality of distance lists; and the distances in each distance list are weighted and calculated respectively to obtain distance scores of the first key point set and each set of standard key point sets.
[0113] Optionally, the adjusting module 55 is specifically configured to:
[0114] According to the coordinate information of each key point in the target standard key point set, a human body rendering is performed to obtain a human body rendering image; the human body rendering image is fitted with the human body pose to obtain a fitting result, and the fitting result is displayed; wherein the fitting result is used to prompt the difference between the human body pose and the standard pose, and the human body pose is adjusted by the user based on the fitting result.
[0115] Optionally, the pose adjusting apparatus 50 further includes:
[0116] The labeling module is configured to select second key points from the first key point set, the distance between the first key point set and the corresponding second key points in the target standard key point set being greater than or equal to a preset threshold; and label the difference between the first key point set and the corresponding second key points in the target standard key point set on the displayed fitting result.
[0117] The pose adjusting apparatus 50 of the embodiments of the present application can implement each process of the method embodiments shown above, and achieve the same technical effects. To avoid repetition, details are not described herein. Figure 1
[0118] Optionally, as Figure 6 As shown, the embodiment of the present application further provides an electronic device 60, which comprises a processor 61, a memory 62, and a program or instruction stored in the memory 62 and executable on the processor 61. The program or instruction is executed by the processor 61 to implement the processes of the above posture adjustment method embodiment and achieve the same technical effects. To avoid repetition, details are not described herein.
[0119] The embodiment of the present application further provides a readable storage medium, which stores a program or instruction. The program or instruction is executed by a processor to implement the processes of the above posture adjustment method embodiment and achieve the same technical effects. To avoid repetition, details are not described herein.
[0120] Computer readable media includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carriers.
[0121] It should be noted that in this paper, the term "include", "contain" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0122] The above sequence number of the embodiment of the present application is only for description, not representing the advantages and disadvantages of the embodiment.
[0123] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, also can be through hardware, but in many cases the former is the better embodiment. Based on such understanding, the technical scheme of the present application essentially or the part which contributes to the prior art can be embodied in the form of software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions to make a service classification device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method described in each embodiment of the present application.
[0124] The above only describes the preferred embodiments of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should be considered as the protection scope of the present application.
Claims
1. A posture adjustment method applied to an electronic device, comprising: The method comprises: collecting a target image containing a human pose, and determining coordinate information of each key point in a first key point set corresponding to the human pose according to the target image; determining distances between the first key point set and each standard key point set according to the coordinate information of each key point in the first key point set and the coordinate information of each key point in a plurality of preset standard key point sets; selecting a target standard key point set with the smallest distance to the first key point set from the plurality of standard key point sets according to the distances between the first key point set and each standard key point set; adjusting the human pose according to the target standard key point set; wherein the determination of the distances between the first key point set and each standard key point set according to the coordinate information of each key point in the first key point set and the coordinate information of each key point in the plurality of standard key point sets comprises: determining a center point and a reference vector of the first key point set according to the coordinate information of each key point in the first key point set, and determining a center point and a reference vector of each standard key point set according to the coordinate information of each key point in the plurality of standard key point sets; transforming the first key point set with the center point of each standard key point set as the origin to obtain a plurality of second key point sets, wherein the center point of each second key point set coincides with the center point of the corresponding standard key point set, and the direction of the reference vector of each second key point set is consistent with the direction of the reference vector of the corresponding standard key point set; calculating the distances between each second key point set and the corresponding standard key point set to obtain the distances between the first key point set and each standard key point set; wherein the determination of the center point and the reference vector of the first key point set according to the coordinate information of each key point in the first key point set, and the determination of the center point and the reference vector of each standard key point set according to the coordinate information of each key point in the plurality of standard key point sets comprises: for a third key point set, the third key point set being the first key point set or any standard key point set in the plurality of standard key point sets, the following steps are performed: selecting a plurality of first key points from the third key point set, determining a center point of a polyhedron formed by the plurality of first key points according to the coordinate information of the plurality of first key points, and determining the center point of the polyhedron as the center point of the third key point set; determining a reference vector of the third key point set according to the center point of the third key point set and a first reference point, wherein the first reference point is determined based on the coordinate information of at least two key points in the third key point set; wherein the determination of the center point of the polyhedron formed by the plurality of first key points according to the coordinate information of the plurality of first key points comprises: constructing a triangulation point set containing a plurality of key point groups, each key point group containing three first key points according to the plurality of first key points; traverse each key point group in the triangulated point set, respectively calculate the volume of the tetrahedron formed by the three first key points in each key point group and a first center point, the first center point being determined according to the coordinate information of the plurality of first key points; weight average the center coordinates of the tetrahedron formed by the three first key points in each key point group and the first center point according to the volume of the corresponding tetrahedron to obtain coordinate results; determine the coordinate point corresponding to the coordinate results as the center point of the polyhedron.
2. The method of claim 1, wherein, The respective calculation of the distance between each set of second key points and the corresponding standard key point set to obtain the distance between the first key point set and each standard key point set includes: Respectively calculate the distance between each set of second key points and the corresponding key points in the corresponding standard key point set to obtain a plurality of distance lists; Respectively calculate the distance in each distance list to obtain the distance score of the first key point set and each standard key point set.
3. The method of claim 1, wherein, The adjustment of the human body posture according to the target standard key point set includes: Perform human body rendering according to the coordinate information of each key point in the target standard key point set to obtain a human body rendering image; Fit the human body rendering image with the human body posture to obtain a fitting result, and display the fitting result; wherein the fitting result is used to prompt the difference between the human body posture and the standard posture, and the user adjusts the human body posture based on the fitting result.
4. The method of claim 3, wherein, The method further includes: Select a second key point from the first key point set, wherein the distance between the first key point set and the corresponding second key point in the target standard key point set is greater than or equal to a preset threshold; Mark the difference between the first key point set and the corresponding second key point in the target standard key point set on the displayed fitting result.
5. The method of claim 1, wherein, The center point of the polyhedron formed by the plurality of first key points is determined according to the coordinate information of the plurality of first key points, including: Calculate the average of the coordinate information of the plurality of first key points according to the coordinate information of the plurality of first key points; Determine the coordinate point corresponding to the average of the coordinate information of the plurality of first key points as the center point of the polyhedron.
6. A posture adjusting device, characterized by, It includes: The acquisition module is used for acquiring a target image containing a human body posture; The first determination module is used for determining the coordinate information of each key point in the first key point set corresponding to the human body posture according to the target image; The second determination module is used for determining the distance between the first key point set and each standard key point set according to the coordinate information of each key point in the first key point set and the coordinate information of each key point in the plurality of standard key point sets; The selection module is used for selecting the target standard key point set with the smallest distance from the plurality of standard key point sets according to the distance between the first key point set and each standard key point set; The adjustment module is used for adjusting the human body posture according to the target standard key point set; The second determination module includes: determining, according to coordinate information of each key point in the first key point set, a center point and a reference vector of the first key point set, and determining, according to coordinate information of each key point in each standard key point set, a center point and a reference vector of each standard key point set; transforming, respectively, the first key point set with the center point of each standard key point set as an origin, to obtain a plurality of second key point sets; wherein the center point of each second key point set coincides with the center point of the corresponding standard key point set, and the direction of the reference vector of each second key point set is consistent with the direction of the reference vector of the corresponding standard key point set; calculating, respectively, a distance between each second key point set and the corresponding standard key point set to obtain a distance between the first key point set and each standard key point set; The determining unit is specifically configured to: for a third key point set, the third key point set being the first key point set or any standard key point set in the plurality of standard key point sets, the following steps are performed: selecting a plurality of first key points from the third key point set, and determining a center point of a polyhedron formed by the plurality of first key points according to coordinate information of the plurality of first key points, and determining the center point of the polyhedron as the center point of the third key point set; determining a reference vector of the third key point set according to the center point of the third key point set and a first reference point, wherein the first reference point is determined based on coordinate information of at least two key points in the third key point set; The determining unit is further configured to: construct a triangulation point set according to the plurality of first key points, the triangulation point set containing a plurality of key point groups, each key point group containing three first key points; traverse each key point group in the triangulation point set, and calculate a volume of a tetrahedron formed by the three first key points in each key point group and a first center point, the first center point being determined according to coordinate information of the plurality of first key points; perform a weighted average on center coordinates of the tetrahedron formed by the three first key points in each key point group and the first center point according to the volume of the corresponding tetrahedron to obtain a coordinate result; and determine a coordinate point corresponding to the coordinate result as the center point of the polyhedron.
7. The apparatus of claim 6, wherein, The determining unit is further configured to: calculate an average value of coordinate information of the plurality of first key points according to the coordinate information of the plurality of first key points; and determine a coordinate point corresponding to the average value of the coordinate information of the plurality of first key points as the center point of the polyhedron.
8. An electronic device, comprising: The processor, the memory, and the program or instructions stored in the memory and executable on the processor are included, and the program or instructions are executed by the processor to implement the steps of the pose adjustment method according to any one of claims 1 to 5.
9. A readable storage medium, characterized by, The program or instructions are stored on the readable storage medium, and the program or instructions are executed by the processor to implement the steps of the pose adjustment method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and apparatus for prompting motion, electronic device and storage medium
US20210319213A1