Human body motion scoring method, device, equipment and storage medium
By identifying key images in the video stream and extracting human action features through sliding windows, the problem of low accuracy of human action scoring in the existing technology is solved, and more efficient and accurate action scoring is achieved.
Patent Information
- Application Number
- CN202111183046.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-10-11
AI Technical Summary
Existing human movement scoring methods are based on scoring of key points, resulting in large errors and low accuracy when the user's position changes or the movements are cluttered.
Extract each frame of image in the video stream, identify image features based on pixel gradients, filter key images, and extract the similarity between human action features and standard action features through a sliding window for scoring.
It improves the accuracy and efficiency of human movement scoring, reduces the number of images analyzed, and enhances the refined comparison of movements.
Smart Images

Figure CN113920582B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a human motion scoring method, device, electronic device and computer-readable storage medium. Background Art
[0002] Human skeleton motion recognition is an important branch of artificial intelligence, and has broad application scenarios in smart home, education, and video game industries. Especially in the application of motion teaching in the education industry, everyone hopes to obtain the accuracy of their own practice movements more intuitively. Therefore, scoring human body movements in videos has become a widespread demand.
[0003] Most existing methods for scoring human body movements in videos are based on key point scoring, that is, the key points of the action are marked in the video, and the user's action is scored according to the coverage of all key points in the picture by the user's action. In this method, it is impossible to fully monitor the user's action. When the user's position changes, or when many key points are covered by messy actions in a short period of time, it will cause a large error in the compensation. Therefore, the accuracy of scoring the human body movements made by the user based only on key points is low. Summary of the invention
[0004] The present invention provides a human motion scoring method, a device and a computer-readable storage medium, the main purpose of which is to solve the problem of low accuracy in human motion scoring.
[0005] To achieve the above object, the present invention provides a human action scoring method, comprising:
[0006] Extract each frame of image from the preset video stream;
[0007] Identify image features of each frame of image based on pixel gradients in each frame of image, and filter out key images in the video stream according to the image features;
[0008] Selecting an image at a preset timestamp in a preset standard action video as the standard action image corresponding to the key image;
[0009] Extracting human motion features of the key image based on a preset sliding window, and extracting standard human motion features of the standard motion image;
[0010] The similarity between the human motion feature and the standard human motion feature is calculated, and the similarity is used as the human motion score of the key image.
[0011] Optionally, extracting each frame of image in a preset video stream includes:
[0012] Extracting the frame rate and video duration of the video stream;
[0013] Calculating the number of frames of the video stream according to the frame rate and the video duration;
[0014] The video stream is segmented according to the frame number to obtain each frame image of the video stream.
[0015] Optionally, identifying the image features of each frame of image based on pixel gradients in each frame of image includes:
[0016] Selecting one frame of image in the video stream as the target image one by one;
[0017] Dividing the target image into a plurality of image blocks according to a preset ratio, calculating the pixel gradient of each pixel in each image block, and obtaining a gradient histogram of each image block according to the pixel gradient statistics;
[0018] The gradient histogram is converted into a vector, and the vector is concatenated into a graphic image feature.
[0019] Optionally, screening out key images in the video stream according to the image features includes:
[0020] Calculating the matching value between the image features of each frame of the video stream and the preset standard features;
[0021] The image corresponding to the image feature whose matching value is greater than a preset matching threshold is selected as the key image.
[0022] Optionally, the selecting an image at a preset timestamp in a preset standard action video as the standard action image corresponding to the key image includes:
[0023] Extracting the timestamp of the key image in the video stream;
[0024] An image with the timestamp captured from the standard action video is used as the standard action image corresponding to the key image.
[0025] Optionally, the extracting the human motion features of the key image based on a preset sliding window includes:
[0026] The key images are framed one by one using a preset sliding window to obtain a pixel window;
[0027] Selecting a human body action area from the pixel window according to extreme value pixels in the pixel window;
[0028] Vectorize the pixel values of all key points in the human action area;
[0029] The obtained vectors are collected into a vector matrix of the target area, and the vector matrix is used as the human motion feature of the human motion area.
[0030] Optionally, selecting a human body motion area from the pixel window according to extreme pixel points in the pixel window includes:
[0031] Select one pixel point from the pixel window one by one as the target pixel point;
[0032] Determine whether the pixel value of the target pixel is an extreme value within the pixel window;
[0033] When the pixel value of the target pixel point is not an extreme value in the pixel window, returning to the step of selecting one of the pixel points in the pixel window as the target pixel point one by one;
[0034] When the pixel value of the target pixel point is an extreme value within the pixel window, the target pixel point is determined to be a key point;
[0035] The area surrounded by all key points is determined to be the human body action area of the key image.
[0036] In order to solve the above problems, the present invention also provides a human body action scoring device, the device comprising:
[0037] An image extraction module is used to extract each frame of image in a preset video stream;
[0038] A first screening module, used for identifying image features of each frame of image based on pixel gradients in each frame of image, and screening out key images in the video stream according to the image features;
[0039] A second screening module is used to select an image at a preset timestamp in a preset standard action video as a standard action image corresponding to the key image;
[0040] A feature extraction module, used to extract the human body motion features of the key image based on a preset sliding window, and to extract the standard human body motion features of the standard motion image;
[0041] The action scoring module is used to calculate the similarity between the human action feature and the standard human action feature, and use the similarity as the human action score of the key image.
[0042] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0043] at least one processor; and,
[0044] a memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the human motion scoring method described above.
[0046] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the human motion scoring method described above.
[0047] The embodiment of the present invention can filter out key images of human actions from a video stream, and subsequently analyze only the key images, thereby avoiding the analysis of each frame of the video stream, reducing the number of images that need to be analyzed and scored, and improving the scoring efficiency. The standard action image corresponding to each key image can be filtered out from the standard action video, and then the features of the key image and its corresponding standard action image can be respectively extracted, and then the score of the user action can be calculated according to the similarity between the features, thereby realizing a refined comparison based on the special features within the image, and improving the accuracy of the human action score finally generated. Therefore, the human action scoring method, device, electronic device and computer-readable storage medium proposed in the present invention can solve the problem of low accuracy when scoring human actions. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram of a flow chart of a human body motion scoring method provided by an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of a process for extracting each frame of an image from a video stream provided by an embodiment of the present invention;
[0050] Figure 3 A schematic diagram of a process for identifying image features of each frame of image based on pixel gradients in each frame of image provided by an embodiment of the present invention;
[0051] Figure 4 A functional module diagram of a human motion scoring device provided by an embodiment of the present invention;
[0052] Figure 5 A schematic diagram of the structure of an electronic device for implementing the human motion scoring method provided by an embodiment of the present invention.
[0053] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0055] The embodiment of the present application provides a method for scoring human motion. The execution subject of the human motion scoring method includes but is not limited to at least one of the electronic devices that can be configured to execute the method provided by the embodiment of the present application, such as a server, a terminal, etc. In other words, the human motion scoring method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0056] Reference Figure 1 FIG. 1 is a flow chart of a human motion scoring method provided by an embodiment of the present invention. In this embodiment, the human motion scoring method includes:
[0057] S1. Extract each frame of image in a preset video stream.
[0058] In the embodiment of the present invention, the video stream may be any video clip containing human body movements, for example, a video recorded of a user learning according to a fat-reducing movement instruction, or a video recorded of a user learning according to a yoga movement video instruction, etc.
[0059] In detail, a computer statement with a data capture function (such as a python statement, a java statement, etc.) can be used to obtain a video stream containing human body movements from a predetermined storage area for storing the video stream, wherein the storage area includes but is not limited to a database, a blockchain node, and a network cache.
[0060] In one of the practical application scenarios of the present invention, since the video stream contains a large number of images, in order to achieve the scoring of human body movements in the video stream, each frame image in the video clip can be extracted to facilitate the subsequent analysis of each frame image and then the scoring of human body movements in the video stream.
[0061] In the embodiment of the present invention, Figure 2 As shown, the step of extracting each frame of an image in a preset video stream includes:
[0062] S21, extracting the frame rate and video duration of the video stream;
[0063] S22, calculating the number of frames of the video stream according to the frame rate and the video duration;
[0064] S23. Segment the video stream according to the number of frames to obtain each frame image of the video stream.
[0065] In detail, a Java statement with a frame rate recognition function can be used to extract the frame rate of the video stream. The frame rate refers to the number of image frames contained in the video stream per second. For example, if the frame rate of the video stream is 24 frames, then the video stream contains 24 images per second.
[0066] Specifically, the frame rate and the video duration (unit: seconds) may be multiplied to obtain the number of frames of the video stream.
[0067] In the embodiment of the present invention, the pictures in the video stream may be intercepted and separated according to the number of frames of the video stream, thereby obtaining each frame image included in the video stream.
[0068] S2. Identify image features of each frame of image based on pixel gradients in each frame of image, and select key images in the video stream according to the image features.
[0069] In the embodiment of the present invention, due to the continuity of the video stream, that is, the actions of the characters in the video stream are continuous, therefore, the key action images screened out using preset standard features may contain multiple images with high similarity within a continuous time period, resulting in a large number of key action images identified within the continuous time period. However, when scoring the human body movements in the video stream, if each frame of the image is scored, it will not only take up a large amount of computing resources and reduce the real-time performance of the scoring, but the user is only concerned with the scoring of the key actions. Therefore, the key images in the video stream can be screened out to reduce the amount of data for subsequent scoring and improve the efficiency of scoring.
[0070] Therefore, the embodiment of the present invention can merge the key action images with high similarity contained in the video stream to reduce the number of key action images in the video stream and improve the accuracy of key action recognition.
[0071] In the embodiment of the present invention, Figure 3 As shown, the method of identifying the image features of each frame of image based on the pixel gradient in each frame of image includes:
[0072] S31, selecting one frame of image in the video stream as the target image one by one;
[0073] S32, dividing the target image into a plurality of image blocks according to a preset ratio, calculating the pixel gradient of each pixel in each image block, and obtaining a gradient histogram of each image block according to the pixel gradient statistics;
[0074] S33, converting the gradient histogram into vectors, and concatenating the vectors into graphic image features.
[0075] In detail, the target image may be divided into a plurality of image blocks according to a preset ratio, and the pixel gradient of each pixel in each pixel block may be calculated one by one. By calculating the pixel gradient, the image features of the target image may be captured.
[0076] The pixel gradient of each pixel in each image block may be calculated using a preset gradient algorithm, wherein the gradient algorithm includes but is not limited to a two-dimensional discrete derivative algorithm, a Soble operator, and the like.
[0077] Specifically, the gradient histogram in each image block can be statistically calculated based on the pixel gradient, and then the value of each gradient in the gradient histogram can be used to generate a vector for identifying the gradient histogram, and the vectors of all gradient histograms of the target image can be spliced to obtain the image features of the target image.
[0078] Furthermore, the image features may be used to filter each frame of the image in the video stream, and then the frames of key actions may be filtered out as key images.
[0079] In the embodiment of the present invention, the step of selecting the key image in the video stream according to the image features includes:
[0080] Calculating the matching value between the image features of each frame of the video stream and the preset standard features;
[0081] The image corresponding to the image feature whose matching value is greater than a preset matching threshold is selected as the key image.
[0082] In detail, the preset standard features are correct features corresponding to different human body movements acquired in advance.
[0083] Specifically, the matching value between the image feature of each frame of the video stream and the preset standard feature can be calculated using the following matching value algorithm:
[0084]
[0085] Wherein, P is the matching value, A n is the image feature corresponding to the nth frame image in the video stream, B n is the preset standard feature corresponding to the nth frame image in the video stream.
[0086] In the embodiment of the present invention, an image corresponding to the image feature whose matching value is greater than a preset matching threshold value may be screened out from the video stream, and the selected image may be determined as a key image of the video stream.
[0087] S3. Selecting an image at a preset timestamp in a preset standard action video as the standard action image corresponding to the key image.
[0088] In the embodiment of the present invention, the standard action video is a video clip containing a standard action corresponding to the human body action in the video stream.
[0089] In detail, a standard action image corresponding to the key image may be screened out from the standard action video, and then the key image may be compared with the screened standard action image to achieve scoring of human body movements.
[0090] In one of the embodiments of the present invention, since the video stream is a video generated by a user learning movements based on the standard action video, the human body movements in the video stream have a high degree of time synchronization with the human body movements in the standard action video. Therefore, the standard action image corresponding to the key image in the standard action video can be screened out based on the time of the key image in the video stream.
[0091] In the embodiment of the present invention, the step of selecting an image at a preset timestamp in a preset standard action video as the standard action image corresponding to the key image includes:
[0092] Extracting a timestamp of the key image in the video stream;
[0093] An image with the timestamp captured from the standard action video is used as the standard action image corresponding to the key image.
[0094] In detail, a Java statement with a timestamp extraction function may be used to extract the timestamp corresponding to the key image from the video stream, and then the standard action image may be extracted from the standard action video according to the timestamp.
[0095] For example, there is a key image A, and the timestamp of the key image A in the video stream is 1 minute and 22 seconds. According to the temporal consistency between the video stream and the action in the standard action video, the image with the timestamp of 1 minute and 22 seconds in the standard action video can be selected as the standard action image corresponding to the key image A.
[0096] S4. Extracting human motion features of the key image based on a preset sliding window, and extracting standard human motion features of the standard motion image.
[0097] In one of the practical application scenarios of the present invention, since the key image and the standard action image may contain more background images, but when performing key action recognition, it is only necessary to pay attention to the actions of the characters in the image. Therefore, if the key image and the standard action image are directly analyzed, it will lead to low analysis efficiency. At the same time, due to the influence of image information in the background image, the accuracy of the analysis result will be low.
[0098] In an embodiment of the present invention, the human body motion areas in the key image and the standard motion image can be extracted respectively, thereby avoiding analyzing all image information in the key image and the standard motion image, improving analysis efficiency, and at the same time removing the influence of image information in the background picture on subsequent analysis, thereby improving the accuracy of the analysis results.
[0099] In the embodiment of the present invention, the extracting of the human motion features of the key image based on a preset sliding window includes:
[0100] The key images are framed one by one using a preset sliding window to obtain a pixel window;
[0101] Selecting a human body action area from the pixel window according to extreme value pixels in the pixel window;
[0102] Vectorize the pixel values of all key points in the human action area;
[0103] The obtained vectors are collected into a vector matrix of the target area, and the vector matrix is used as the human motion feature of the human motion area.
[0104] In detail, the sliding window may be a pre-constructed selection box with a certain area, which may be used to select pixels in the target area, for example, a square selection box constructed with a height of 10 pixels and a width of 10 pixels.
[0105] In the embodiment of the present invention, selecting a human body motion area from the pixel window according to extreme pixel points in the pixel window includes:
[0106] Select one pixel point from the pixel window one by one as the target pixel point;
[0107] Determine whether the pixel value of the target pixel is an extreme value within the pixel window;
[0108] When the pixel value of the target pixel point is not an extreme value in the pixel window, returning to the step of selecting one of the pixel points in the pixel window as the target pixel point one by one;
[0109] When the pixel value of the target pixel point is an extreme value within the pixel window, the target pixel point is determined to be a key point;
[0110] The area surrounded by all key points is determined to be the human body action area of the key image.
[0111] In detail, the extreme value includes a maximum value and a minimum value. When the pixel value of the target pixel point is a maximum value or a minimum value in the pixel window, the target pixel point is determined to be a key point of the pixel window.
[0112] Specifically, the area surrounded by all key points in the key image may be determined as the human body action area of the key image.
[0113] Furthermore, the pixel values of each row of pixels in the human motion area may be converted into row vectors and spliced into human motion features of the human motion area.
[0114] For example, the human action area includes three rows of 9 key point pixels. The pixel values of the first row of pixels are a, b, c, the pixel values of the second row of pixels are d, e, f, and the pixel values of the third row of pixels are g, h, i. The pixel values of each row of pixels can be used as row vectors and spliced into the following vector matrix:
[0115]
[0116] In other embodiments of the present invention, HOG (Histogram of Oriented Gradient), DPM (Deformable Part Model), LBP (Local Binary Patterns) and the like may be used to extract human motion features of the human motion area, or a pre-trained artificial intelligence model with a specific image feature extraction function may be used to extract human motion features of the human motion area, and the artificial intelligence model includes but is not limited to a VGG-net model and a U-net model.
[0117] In the embodiment of the present invention, the step of extracting the standard human motion features of the standard motion image is consistent with the step of extracting the human motion features of the key image based on a preset sliding window, and will not be described in detail here.
[0118] S5. Calculate the similarity between the human motion feature and the standard human motion feature, and use the similarity as the human motion score of the key image.
[0119] In the embodiment of the present invention, the similarity between the human motion feature and the standard human motion feature can be calculated, and then the similarity can be used as a score for the human motion of the key image generated by the user.
[0120] In detail, the calculating the similarity between the human motion feature and the standard human motion feature includes:
[0121] The similarity between the human motion feature and the standard human motion feature is calculated using the following similarity algorithm:
[0122]
[0123] Wherein, L is the similarity, a is the human motion feature, and b is the standard human motion feature.
[0124] In the embodiment of the present invention, after the similarity is calculated and used as the human action score of the key image, the method further includes:
[0125] The human body movement scores are divided into preset scoring levels and displayed to the user in the form of animation, sound effects, etc.
[0126] The embodiment of the present invention can filter out key images of human actions from the video stream, reduce the number of images that need to be analyzed and scored, improve the scoring efficiency, and filter out the standard action image corresponding to each key image from the standard action video, and then respectively extract the features of the key image and the corresponding standard action image, and then calculate the score of the user action according to the similarity between the features, thereby realizing a refined comparison based on the special features within the image and improving the accuracy of the human action score finally generated. Therefore, the human action scoring method proposed by the present invention can solve the problem of low accuracy when scoring human actions.
[0127] like Figure 4 , which is a functional module diagram of a human motion scoring device provided in one embodiment of the present invention.
[0128] The human motion scoring device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the human motion scoring device 100 can include an image extraction module 101, a first screening module 102, a second screening module 103, a feature extraction module 104 and a motion scoring module 105. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0129] In this embodiment, the functions of each module / unit are as follows:
[0130] The image extraction module 101 is used to extract each frame of image in a preset video stream;
[0131] The first screening module 102 is used to identify image features of each frame of image based on pixel gradients in each frame of image, and screen out key images in the video stream according to the image features;
[0132] The second screening module 103 is used to select an image at a preset timestamp in a preset standard action video as a standard action image corresponding to the key image;
[0133] The feature extraction module 104 is used to extract the human body motion features of the key image based on a preset sliding window, and to extract the standard human body motion features of the standard motion image;
[0134] The action scoring module 105 is used to calculate the similarity between the human action feature and the standard human action feature, and use the similarity as the human action score of the key image.
[0135] In detail, each module in the human body motion scoring device 100 in the embodiment of the present invention is used in the same manner as described above. Figures 1 to 3 The human motion scoring method described in the present invention is a technical method that is similar to the human motion scoring method described in the present invention and can produce the same technical effect, so it will not be repeated here.
[0136] like Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a method for scoring human motions provided by an embodiment of the present invention.
[0137] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a human motion scoring program.
[0138] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a human motion scoring program, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0139] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device, such as the code of a human motion scoring program, but may also be used to temporarily store data that has been output or is to be output.
[0140] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0141] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0142] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0143] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0144] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0145] The human motion scoring program stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0146] Extract each frame of image from the preset video stream;
[0147] Identify image features of each frame of image based on pixel gradients in each frame of image, and filter out key images in the video stream according to the image features;
[0148] Selecting an image at a preset timestamp in a preset standard action video as the standard action image corresponding to the key image;
[0149] Extracting human motion features of the key image based on a preset sliding window, and extracting standard human motion features of the standard motion image;
[0150] The similarity between the human motion feature and the standard human motion feature is calculated, and the similarity is used as the human motion score of the key image.
[0151] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0152] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0153] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0154] Extract each frame of image from the preset video stream;
[0155] Identify image features of each frame of image based on pixel gradients in each frame of image, and filter out key images in the video stream according to the image features;
[0156] Selecting an image at a preset timestamp in a preset standard action video as the standard action image corresponding to the key image;
[0157] Extracting human motion features of the key image based on a preset sliding window, and extracting standard human motion features of the standard motion image;
[0158] The similarity between the human motion feature and the standard human motion feature is calculated, and the similarity is used as the human motion score of the key image.
[0159] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0160] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0162] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0163] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0164] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0165] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0166] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0167] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A human action scoring method, characterized in that: The method comprises: Extract each frame of image from the preset video stream; Identify image features of each frame of image based on pixel gradients in each frame of image, and filter out key images in the video stream according to the image features; According to the timestamp of the key image in the video stream, a standard action image corresponding to the key image is screened out from preset standard action videos; Extracting the human motion features of the key image based on a preset sliding window, including: using the preset sliding window to frame the key image one by one to obtain a pixel window, selecting a human motion region from the pixel window according to extreme pixel points in the pixel window, vectorizing the pixel values of all key points in the human motion region, aggregating the obtained vectors into a vector matrix of the target region, and using the vector matrix as the human motion features of the human motion region; Extracting standard human body motion features of the standard motion image; The similarity between the human motion feature and the standard human motion feature is calculated, and the similarity is used as the human motion score of the key image.
2. The human body motion scoring method according to claim 1, characterized in that: The step of extracting each frame of an image from a preset video stream comprises: Extracting the frame rate and video duration of the video stream; Calculating the number of frames of the video stream according to the frame rate and the video duration; The video stream is segmented according to the frame number to obtain each frame image of the video stream.
3. The human body motion scoring method according to claim 1, characterized in that: The identifying the image features of each frame of image based on the pixel gradient in each frame of image comprises: Selecting one frame of image in the video stream as the target image one by one; Dividing the target image into a plurality of image blocks according to a preset ratio, calculating the pixel gradient of each pixel in each image block, and obtaining a gradient histogram of each image block according to the pixel gradient statistics; The gradient histogram is converted into a vector, and the vector is concatenated into a graphic image feature.
4. The human body motion scoring method according to claim 1, characterized in that: The step of screening out the key image in the video stream according to the image features includes: Calculating the matching value between the image features of each frame of the video stream and the preset standard features; The image corresponding to the image feature whose matching value is greater than a preset matching threshold is selected as the key image.
5. The human body motion scoring method according to claim 1, characterized in that: The step of selecting a standard action image corresponding to the key image from a preset standard action video according to a timestamp of the key image in the video stream includes: Extracting the timestamp of the key image in the video stream; An image with the timestamp captured from the standard action video is used as the standard action image corresponding to the key image.
6. The human body motion scoring method according to claim 1, characterized in that: The step of selecting a human body motion area from the pixel window according to the extreme pixel points in the pixel window comprises: Select one pixel point from the pixel window one by one as the target pixel point; Determine whether the pixel value of the target pixel is an extreme value within the pixel window; When the pixel value of the target pixel point is not an extreme value in the pixel window, returning to the step of selecting one of the pixel points in the pixel window as the target pixel point one by one; When the pixel value of the target pixel point is an extreme value within the pixel window, the target pixel point is determined to be a key point; The area surrounded by all key points is determined to be the human body action area of the key image.
7. A human motion scoring device, characterized in that: The device comprises: An image extraction module is used to extract each frame of image in a preset video stream; A first screening module, used for identifying image features of each frame of image based on pixel gradients in each frame of image, and screening out key images in the video stream according to the image features; A second screening module, configured to screen out a standard action image corresponding to the key image from a preset standard action video according to a timestamp of the key image in the video stream; A feature extraction module is used to extract the human motion features of the key image based on a preset sliding window, including: using the preset sliding window to frame the key image one by one to obtain a pixel window, selecting a human motion area from the pixel window according to extreme pixel points in the pixel window, vectorizing the pixel values of all key points in the human motion area, aggregating the obtained vectors into a vector matrix of the target area, and using the vector matrix as the human motion features of the human motion area; Extracting standard human body motion features of the standard motion image; The action scoring module is used to calculate the similarity between the human action feature and the standard human action feature, and use the similarity as the human action score of the key image.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the human motion scoring method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the human action scoring method according to any one of claims 1 to 6 is implemented.
